commit 854bf52eebd2da47ff45f6ae85f4cb89bae89876 Author: tpearson Date: Mon Mar 1 18:55:11 2010 +0000 Added old KDE3 version of SMB4K git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/smb4k@1097609 283d02a7-25f6-0310-bc7c-ecb5cbfe19da diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..c7d50f0 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,8 @@ +Developers: +Alexander Reinholdt +Massimo Callegari +Franck Babin (retired) + +Translators: +The current list of translators can be found at +http://smb4k.berlios.de diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..657358b --- /dev/null +++ b/BUGS @@ -0,0 +1,10 @@ +You are strongly encouraged to commit a bug report to +http://developer.berlios.de/bugs/?group_id=769, if you find a problem. +Please do not forget to include: +(a) a detailed description of what you did to receive the issue you are + reporting +(b) the error message or backtrace. +(c) the version of Smb4K you are using +(d) the operating system and distribution (in case of Linux) you are using +(e) all additional information that might be helpful to reproduce and + fix the bug diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c13faf0 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..65945b7 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,1191 @@ +Smb4K 0.9.4: +- Smb4KGlobal::timer() is now deprecated. +- The core classes now use QObject::timerEvent() instead of a connection + to Smb4KGlobal::timer(). +- Smb4K will try to launch the wallet manager before it opens the wallet. + This should prevent it from hanging on start-up (closes #12707). +- If the digital wallet could not be opened, KWallet support won't be + disabled completely anymore but only for the current session. +- Fixed blocking of tooltips in the network browser. +- Fixed invalid check in the network browser's tool tip code. +- Simplified code in smb4k_cat. Bumped version to 0.8. +- Fixed disabled configuration dialog when another user edited the same + system file. +- Fixed wrong path when the strings "cifs" or "smbfs" were part of the + mount point name (closes #13342). +- Fixed unrecognized authentication error when querying the workgroup + master browser for the workgroup members (closes #12830). +- Fixed flickering of items in the shares views. +- Applied patch by Dirk Mueller that installs the configuration dialog as + KDE module. + +Smb4K 0.9.3: +- Revised and optimized the code of the password handler. One consequence + is, that the format of the wallet entries is not compatible with previous + versions. The old entries will be converted automatically. +- Fixed a regression in the browser, where the list of shares was not deleted + when an host item was collapsed. +- Fixed an unmount problem that occurred when mount.smbfs is indeed a symlink + to or a copy of mount.cifs. +- The mount command now includes the NetBIOS name of the local host, which + is at least needed when using port 139. + +Smb4K 0.9.2: +- Added a few "What's this?" help texts to the "Shares" configuration page. +- Updated translations. +- The preview dialog does not show the "." and ".." directories if the user + chose to see hidden directories. +- The bookmark folder in the system tray widget now has a bookmark folder + icon. +- Applied patch provided by Carsten Lohrke so that Smb4K's desktop file + complies with freedesktop.org's specifications. +- Fixed double declaration in Smb4KSystemTray class. +- Removed Smb4KConfigDialogFactory::setConfigObject() function that was not + used. +- Fixed poor IP address check in Smb4KScanner::searchForHost(). +- Fixed saving of default login data when the wallet was closed. +- Updated handbook. + +Smb4K 0.9.1 +- Replaced all occurences of getenv("USER") by getpwuid(getuid())->pw_name. +- Corrected spelling mistakes in German translation. +- Fixed compilation error under FreeBSD. +- Fixed fails-to-build-from-source bugs with upcoming GCC 4.3. + +Smb4K 0.9.0: +- Cleaned up the code and updated the copyright statements (class descriptions, + e-mail address and year). +- Smb4K now uses KConfig XT throughout the whole application. This breaks + compatibility with older versions of Smb4K. +- Replaced the old configuration dialog with a new one based on KConfigDialog + to take advantange of the KConfig XT infrastructure. It is a KDE module + library: libsmb4kconfigdialog. +- Added some configuration options: + + The '-S ' (signing state) and '-P' (use machine account) arguments of + smbclient are now supported. + + Added several advanced mount.cifs options and the ability to pass custom + options to mount.cifs (closes #10249). You will need Linux kernel >= 2.6.15 + to take advantage of most of them. + + Added the ability to remove all options at once in the "Custom" tab of the + Samba configuration page. +- Changed some configuration options: + + The hidden files and directories are not displayed in the preview dialog by + default. + + Rsync's '--existing' and '--ignore-existing' option can be active at the + same time. + + The default UID and GID are now those of the user. +- Removed obsolete Smb4KUser class. +- Implemented validity checks into the core container classes, so that only IPv4 + and IPv6 IP addresses are used (closes #11470). +- Modified Smb4KGlobal namespace: + + Removed Smb4KGlobal::kernelVersion() function. + + Removed Smb4KGlobal::systemName() function. + + Removed Smb4KGlobal::config() function. + + Removed Smb4KGlobal::getUMASK(). +- Removed Smb4KHomesShareHandler::convert() function. +- Revised Smb4KCore class: + + Rewrote Smb4KCore::searchPrograms(). + + Removed Smb4KCore::smb4k_core() static pointer and replaced it with a better + approach (Smb4KCore::self() and static pointers to the core classes). + + Added Smb4KCore::init() function, that initializes the core, i.e. starts the + scanning of the network and the import and remounting of shares. +- Improved Smb4KSambaOptionsHandler class: + + The constructor does not take a KConfig object anymore. + + The client charset and server codepage will be auto-detected if the 'unix + charset' and 'dos charset' options are present in smb.conf, respectively + (closes #10805). +- Modified Smb4KShare class: + + Moved to KUser and KUserGroup to retrieve information about the user and the + group of the mounted share. This sets the minimum requirement to KDE 3.3. + + Added Smb4KShare::setUID() and Smb4KShare::setGID() functions. + + Smb4KShare::equals() now takes a constant reference instead of a pointer. +- Improved Smb4KMounter class: + + Removed legacy code from mountRecent() function and renamed it to remount(). + + Renamed Smb4KMounter::State::MountRecent to Smb4KMounter::State::Remount. + + Smb4KMounter::findShareByName() now returns a list of all mounts of the + specified share that are present on the system. This way the checks for + mounted shares etc. could be improved. + + Rewrote Smb4KMounter::mount() function. + + Cleaned up Smb4KMounter::unmount() and improved the remaining checks. + + Removed check for correct Linux kernel if the "Force Unmounting" feature is + used. The operating system will throw an error if the wrong kernel is used. + + Added a new function Smb4KMounter::checkAccessibilty( Smb4KShare *share ). + It replaces code in Smb4KMounter::import() and Smb4KMounter::processMount() + and simplifies maintenance. + + The "bad user name" and "bad group name" messages that are returned by + mount.cifs if a bad UID/GID are provided are recognized as errors. + + Improved Smb4KMounter::isMounted(). It takes now a boolean as second argument + that determines whether all or only user mounts should be considered. +- Modified Smb4KScanner class: + + Removed preview code from class. + + Improved code for custom search requests. + + Renamed Smb4KScanner::addHost() function to Smb4KScanner::insertHost() and + improved it. + + Added hostAdded() signal that is emitted when a single host has been added + via the insertHost() function to the list of known hosts. +- Moved Smb4KMounterPrivate and Smb4KScannerPrivate classes to own files. Now + the users can use the --enable-final configure option without problems. +- Introduced Smb4KPreviewer core class that takes care of previews of remote + shares. +- Rewrote Smb4KPreviewItem class and moved it into own files. +- Introduced new Smb4KSynchronizationInfo container class. +- Modified Smb4KSynchronizer class: + + Replaced the "--devices" option by the "--devices --specials" options, so + that also fifos, etc. can be preserved. + + Replaced the "--remove-sent-files" option by "--remove-source-files". This + makes rsync 2.6.9 a requirement, if you want to take advantage of this + option. + + Removed the URL requester and the progress dialog. + + Added new signals: progress() and finished(). + + Make use of the new Smb4KSynchronizationInfo container class. + + A new synchronization request won't be taken if one is already processed. +- Modified Smb4KPasswordHandler class: + + Removed import() function which imported authentication data from old + password file (versions prior to Smb4K 0.6.0). + + The constructor does not take a KConfig object anymore. + + The descriptive text in the askpass dialog now distinguishes between a + server and a share. +- Did a major revision of Smb4KFileIO class: + + Removed Smb4KFileIO::getUsers(). + + Removed Smb4KFileIO::writeSuperUserEntries(). + + Removed Smb4KFileIO::removeSuperUserEntries(). + + Removed Smb4KFileIO::processOutput(). + + Removed obsolete compatibility code. + + Introduced Smb4KFileIO::writeSudoers(). + + Introduced Smb4KFileIO::writeSuperTab(). + + Introduced Smb4KFileIO::processSudoers(). + + Introduced Smb4KFileIO::processSuperTab(). + + The env_keep list will not be replaced, but PASSWD and USER are appended + to it. +- Modified definitions in smb4kdefs.h. For changes see the file itself. +- Improved Smb4KBookmark class: + + Added ability to define an alternative label that can be used to identify + the bookmark in a custom way. + + Added constructor that takes a Smb4KHostItem object. +- Improved Smb4KBookmarkHandler class: + + Implemented support for the new label feature. + + Replaced findBookmark() by findBookmarkByName() and findBookmarkByLabel() + functions. + + Rewrote addBookmark() function. +- Smb4KPrint now supports the "application/x-shellscript" mime type. +- Unified API of the network item classes. +- Bumped version of the core library to 2.0.0. +- Rewrote main window: + + Smb4KApp now inherits KParts::DockMainWindow. + + Removed labels that gave information about the WINS server and the look-up + method. + + Made the status bar messages a bit more informative. +- Redesigned shares icon view: + + Removed Smb4KShareWidget, Smb4KShareWidgetItem, Smb4KShareActionMenu, and + Smb4KShareTooltip classes. + + Introduced new classes: Smb4KSharesIconView, Smb4KSharesIconViewItem, + Smb4KSharesIconViewPart, and Smb4KSharesIconViewToolTip. + + The shares iconview is now a KParts KDE module: libsmb4ksharesiconview. + + Removed the fake list view feature. + + Added ability to open a mounted share with Konsole. This is useful for + people who need to execute shell scripts on the share. +- Added new shares list view: + + The features of the new list view are similar to the ones of the icon view. + + The new list view consists of the classes: Smb4KSharesListViewPart, + Smb4KSharesListView, Smb4KSharesListViewItem and Smb4KSharesListViewToolTip. +- Redesigned network browser: + + Removed Smb4KBrowserWidget, Smb4KBrowserWidgetItem, Smb4KBrowserActionMenu, + and Smb4KNetworkItemTooltip classes. + + Introduced new classes: Smb4KNetworkBrowser, Smb4KNetworkBrowserItem, + Smb4KNetworkBrowserPart and Smb4KNetworkBrowserToolTip. + + The network browser is now a KParts KDE module: libsmb4knetworkbrowser. +- Redesigned search dialog: + + Applied a major revision to the Smb4KSearchDialog class. Among other things, + the widget that shows the search results is now a KListView. + + Introduced new Smb4KSearchDialogItem class for easier handling of the items + in the list view. + + Introduced Smb4KSearchDialogPart class that manages the communication with + the core and the rest of the application. + + The search dialog is now a KParts KDE module: libsmb4ksearchdialog. (An rc + file is not provided because it's not needed.) +- Introduced a new synchronization dialog (Smb4KSynchronizationDialog) where the + old URL requester and the progress dialog from Smb4KSynchronizer were merged. +- Redesigned the print dialog. +- Revised the preview dialog. It now uses the new Smb4KPreviewer class and the + reworked Smb4KPreviewItem class. +- Modified and improved the bookmark editor: + + It is now possible to define a custom label to identify a bookmark. + + The workgroup is not editable anymore. +- Rewrote Smb4KSystemTray class from scratch: + + The old functionality has been preserved. + + Added the ability to unmount all mounted shares at once. +- Ported the Konqueror plugin to the new widgets. +- Modified utility programs: + + Removed deprecated arguments from smb4k_mount. + + Removed deprecated arguments from smb4k_umount. + + Adjusted help screens where necessary. + + Bumped versions where appropriate. + +Smb4K 0.8.7: +- Fixed smb4k_cat utility program: + + Enlarged the allowed length per line to 1024 (instead of 255) characters + (closes #12262). + + Fixed a bug that could lead to corrupted files. +- Fixed Smb4KPasswordHandler::readDefaultAuth() that returned a pointer that was + freed when the function exited. +- Fixed Smb4KMounter: + + Smb4K won't consider foreign shares for remounting on start-up. This also + seems to solve the crash bug initially reported in #11973 (closes #11467 + and #12369). + + Fixed unmount command line in slotShutdown() function under FreeBSD. + + Fixed unmount command line in unmount() function under FreeBSD. + +Smb4K 0.8.6: +- Fixed a crash in Smb4KMounter::findShareByPath() (closes #11499, #11543 and + #11973). + +Smb4K 0.8.5: +- Updated the handbook. +- Fixed compile errors in Smb4KMounter class under FreeBSD. + +Smb4K 0.8.4: +- Reintroduced Polish translation provided by Jerzy Trzeciak. +- Updated Turkish translation and improved smb4k_add.desktop file. Thanks go + to Serdar Soytetir for providing the patches. +- Fixed missing functionality of the --ignore-existing argument of rsync. +- Fixed 'net rap server domain' command that is incompatible with Samba + 3.0.25 (and later?). +- Fixed Smb4KPasswordHandler::readAuth() that returned a pointer that was + freed when the function exited. +- Fixed broken Smb4KPrint::print() function. +- Fixed a bug in the preview dialog that led to the hanging of the whole + application. +- Fixed DCOP-related hanging of Smb4K during KDE start-up (closes #11189): + + Added 'X-DCOP-ServiceType=Unique' entry to smb4k.desktop file. + + Implemented KUniqueApplication::start() in main.cpp. +- Fixed a potential memory leak in the bookmark editor. + +Smb4K 0.8.3: +- Fixed command lines in Smb4KMounter:unmount() that provoked smb4k_umount + to complain about a deprecated argument. +- Applied Turkish translation patch provided by Ismail Donmez. + +Smb4K 0.8.2: +- Modified utility programs: + + Fixed the "No mode was specified" bug in smb4k_mount/smb4k_umount and + related issues in the other utility programs. + + Modified the help screens of the utility programs with respect to clarity + and better readability. + + Warnings are shown if deprecated arguments are used. + + Increased all versions by 0.1. +- Worked around a bug where shares where remounted with UID=0 and GID=0 when + using the CIFS file system. +- Improved the 'Trouble Shooting' section of the handbook and bumped its + version to 1.1.2. + +Smb4K 0.8.1: +- Rewrote smb4k_mount, smb4k_umount, smb4k_kill, smb4k_cat, and smb4k_mv from + scratch in order to fix the following security weaknesses discovered by + Ben Hutchings (should finally close #9631): + + Due to insufficient sanitation, smb4k_mount allowed an user to mount any + (local) device if the program was used in combination with sudo or super. + + The function findprog(), which was present in smb4k_mount, smb4k_umount, + and smb4k_kill, returned a pointer to memory that was freed when the + function exited. + + The function replace_special_characters(), that was present in smb4k_mount + and smb4k_umount, returned a pointer to memory that was freed after the + function exited. Additionally, it didn't replace the hyphen. +- Changes in smb4k_mount: + + Moved to getopt_long() to parse the command line options. + + Added '-n' and '-s' switches (not under FreeBSD) as short forms of the + '--suid' and '--no-suid' arguments, respectively. + + Added '--version' argument. + + Out of the many arguments that may be passed to the 'mount' binary, only + '-t ' and '-o ' are still supported with smb4k_mount. + + All file systems except 'smbfs' and 'cifs' will result in an error. + + Fixed order of the arguments that were passed to 'mount.cifs' and + 'smbmount' (the '-o ' argument must be placed at the end). + + Added check if a share in the form //HOST/SHARE is supplied. If this is + not the case, smb4k_mount will error out. + + Improved FreeBSD support. +- Changes in smb4k_umount: + + Moved to getopt_long() to parse the command line arguments. + + Added '-n' and '-s' switches (not under FreeBSD) as short forms of the + '--suid' and '--no-suid' arguments, respectively. + + Added '--version' argument. + + Added check if a mount point is supplied at all. + + Improved FreeBSD support. + + The '--smbfs' and '--cifs' arguments have been deprecated and are now + inoperable. They are still present for backward compatibility, but may be + removed any time soon. +- Changes in smb4k_kill: + + Moved to getopt_long() to parse the command line arguments. + + Added '--version' argument. + + smb4k_kill does not take a signal number anymore. You can only terminate + a process with the SIGTERM signal. +- Changes in smb4k_cat: + + Moved to getopt_long() to parse the command line arguments. + + Added '--version' argument. +- Changes in smb4k_mv: + + Moved to getopt_long() to parse the command line arguments. + + Added '--version' argument. + + Added a check if the source and destination files are regular files. If + they are not, smb4k_mv will error out. +- Adjusted Smb4KMounter class to the slightly changed behavior of the utility + programs: + + Removed SIGTERM signal from command line in Smb4KMounter::abort() because + of the changes made to smb4k_kill. + + Changed the command lines for smb4k_mount and smb4k_umount. +- Started to address the browsing problems experienced by users in Active + Directory environments: If the NT_STATUS_ACCOUNT_DISABLED error is + encountered (which actually seems to be an authentication issue), Smb4K + won't error out anymore but ask the user for the user name and password + (closes #10280). +- Fixed two bugs in Smb4KFileIO: + + The search for the lock file directory will not return a directory that is + not readable and writeable anymore (except /var and /tmp are mounted ro). + + If the lock file does not exist when Smb4KFileIO::removeLockFile() wants + to delete it, no error will be shown anymore. +- Fixed a compilation error under SUSE (10.2) and with the upcoming GCC 4.3. +- Smb4K now uses the CIFS file system by default (closes #10804). +- The handbook was updated to reflect the changes made to the utility programs. + +Smb4K 0.8.0: +- smb4k_konqplugin: implemented working toolbar code + search dialog connected + to toolbar +- smb4k_konqplugin: fixed unmount all shares on exit +- Moved source files of the Konqueror plugin to own directory. +- Improved the build system: + + Added '--with-konqplugin=ARG' argument which allows the user to disable + the compilation of the Konqueror plugin. + + Added a check for Konqueror plugin header file if '--with-konqplugin=yes' + (default) was supplied. The configuration will be aborted with an error + message if the check fails (closes #8755). +- Updated admin/ directory. +- Utility programs: + + Removed file search function from smb4k_cat. + + Exchanged all occurrences of strcpy() by strncpy() (closes #9631). + + Implemented several other security releated fixes proposed by Kees Cook + after a security audit (closes #9631). They include the elimination of + stack overflows and a design error in smb4k_kill. +- Removed the Smb4KDataItem class again, because its introduction was not a + good idea. +- Revised Smb4KShare: + + Now references to strings are returned instead of copies of these strings. + + Smb4KShare::path() and Smb4KShare::canonicalPath() are now QCStrings. +- Made Smb4KUser, Smb4KPrintInfo return references to strings instead of copies + of those strings. +- Logins with umlauts and other special characters are now supported. +- Introduced the ability to define custom options for mounting and browsing + (closes #3822, #6490). Changes in detail: + + Added a new container class: Smb4KOptionsInfo + + Added a new core class that manages all Samba related options: + Smb4KSambaOptionsHandler + + Custom options are stored in ~/.kde/share/apps/custom_options. + + Added new dialog were the options can be defined. + + Added new "Custom" tab to the Samba configuration tab. Here you can edit + and delete the custom options. +- Introduced a new class named Smb4KHomesSharesHandler that handles the homes + shares: + + Moved the list of 'homes' shares and the user names defined for them to the + file ~./kde/share/apps/smb4k/homes_shares. + + Added new read and write functions for the data. + + Moved the "Specify User" dialog to this class. + + Improved "Specify User" dialog by adding a "Clear List" button that enables + the user to clear all names from the combo box. +- Introduced new Smb4KError class which handles the error messages: + + Renamed and removed several error codes. + + Adjusted code to use the new error codes. + + Improved error messages. +- Revised Smb4KGlobal namespace: + + Moved Smb4KPasswordHandler here. + + Added Smb4KSambaOptionsHandler. + + Added Smb4KHomesSharesHandler. + + Smb4KGlobal now provides a function that creates a temporary directory. The + core classes were ported to use it. +- Revised Smb4KMounter class: + + Optimized code in Smb4KMounter::import(). + + Merged Smb4KMounter::unmount() and Smb4KMounter::forceUnmount() into a more + powerful Smb4KMounter::unmount() function. Accordingly, the public function + forceUnmountingShare() has been removed and replaced by an enhanced version + of unmountShare(). + + Fixed missing port statement in the mount command under FreeBSD. +- Revised Smb4KScanner class: + + Improved code in Smb4KScanner::init(). + + Rewrote code for retrieving IP addresses. + + Added a new 'IP scan' method to retrieve the browse list (closes #7933). + + Adjusted code in Smb4KScanner::processHosts(). In case of an IP scan, the + hosts won't be deleted from the list but only additional info we be added + to existing host items. + + The constructor now takes a list for workgroups and one for hosts. Both + are provided by Smb4KCore and are used to make all discovered workgroups + and hosts available to the core classes. + + Replaced Smb4KScanner::authFailed() signal with Smb4KScanner::failed() and + implemented it more places. + + Revised the shell command for previewing shares. + + /bin/sh is not required to be present on your system anymore, but you need + a shell that understands the '-c command' option. +- Added update functionality to Smb4KBookmarkHandler class (closes #8832): + + The constructor now takes a pointer to the global host list provided by + Smb4KCore. + + Added Smb4KBookmarkHandler::update() which searches the hosts list for + changes of the IP address and updates the bookmarks, if necessary. +- Completely rewrote the Smb4KFileIO class: + + The automatic conversion of old super.tab entries has been dropped now. + + Implemented several security fixes proposed by Kees Cook after a security + audit: Moved the lock file to /var/lock, fixed a race vulneribility with + the lock file, and moved to mkstemp (closes #9630). +- Revised print code: + + Rewrote Smb4KPrint class. + + Improved Smb4KPrintDialog class. +- Improved the network item container classes: + + Smb4KShareItem: Added isHidden(), isPrinter(), isIPC(), and isADMIN(). + + Smb4KPreviewItem: Added isHidden(). +- Revised Smb4KShareWidget class: + + Disabled the ability to move the items around. + + Added Drag 'n' Drop support (closes #3027). It must be enabled in the + configuration dialog in order to use it. + + The tool tips will be displayed in a distance of 5 points away from the + mouse pointer. + + Enhanced overall handling of tooltips. +- Revised Smb4KBrowserWidget class: + + Made the browser behave much smarter. + + The tool tips will be displayed in a distance of 5 points away from the + mouse pointer. + + Enhanced overall handling of tooltips. + + The current network item will be collapsed if the Smb4KScanner::failed() + signal is received. +- Smb4KBrowserWidgetItem class now inherits KListViewItem instead of + QListViewItem. +- Revised Smb4KPreviewDialog class: + + The constructor now takes a pointer to an Smb4KShareItem object and looks up + the IP address of the host by itself. + + Added Smb4KPreviewDialog::initialized(). It returns a boolean and can be + used to only show the dialog if the preview dialog was initialized properly. + + Added a 'Back' and a 'Forward' button. + + Code clean-ups and optimizations. + + Preview of hidden files and directories may be switched off in the + configuration dialog. + + Added scrollbars to the combobox's listbox. +- Configuration dialog: + + Renamed several settings in network options tab. + + Replaced 'Appearance' by 'User Interface' configuration page and added several + new settings. + + Some widgets won't appear under operating systems anymore where they are + useless. +- The bookmark editor will reload the bookmarks if the bookmark handler emitted + the updatedBookmarks() signal. + +Smb4K 0.7.5: +- Fixed a serious bug in Smb4KFileIO that could cause a corrupted /etc/sudoers + file if debug or error output was received via stderr while reading the file + for subsequent processing. Many thanks go to h-gent-o who reported this + issue to the Ubuntu bug tracker and to Richard Johnson from the Ubuntu + project who brought it to our attention (closes #9527). + +Smb4K 0.7.4: +- Fixed error handling in Smb4KMounter::processMount() under FreeBSD. +- Fixed a bug in Smb4KSearchDialog::slotCheckItemInBrowser() that occurred + when a server item had no IP address displayed. +- Fixed a bug in the shell code that was used to retrieve the list of + workgroup/domain members from the master browser. Under certain circum- + stances the bug caused the master browser not to return the browse list. + Please note, that you need the 'sh' command being present now! On most + systems, this is a symlink to a sh-compatible shell, which is fine. +- Improved error handling in Smb4KScanner::processHosts(). +- Implemented better error handling in Smb4KSynchronizer: The synchronization + is canceled if an error occurrs. This prevents the user from being flooded + with error dialogs. +- Fixed disabled "Linux charset" and "Server codepage" combo boxes in the + configuration dialog under operating systems different from Linux. +- Fixed a bug that occurred when reading or writing the file and directory + mask. +- Changed the address used for reporting bugs via Help->Report Bugs. +- Updated several translations. + +Smb4K 0.7.3: +- Rewrote help texts of the utility programs and added version info. +- Updated handbook to version 1.0.0. +- Updated README file. +- Fixed several issues in Smb4KFileIO: + + Added a missing signal in Smb4KFileIO::write_lock_file(). + + Fixed writing of /etc/sudoers under Ubuntu. +- A host item will be closed (collapsed) if the authentication failed + (closes #8325). +- Fixed insertion of a host from the search dialog to the browser window + when the host has no IP address displayed. +- Added missing error code to Smb4KGlobal::showCoreError(). +- The preview dialog won't accept the contents of a wrong address anymore. +- The wallet will be reopened if it was closed by the user, the screensaver, + etc. (closes #8558). +- Reintroduced Chinese Traditional (zh_TW) translation. Many thanks go to + Wei-Lun Chao for providing it. +- Updated several translations. +- The text streams are now aware of the locale. + +Smb4K 0.7.2: +- Fixed another crash in Smb4KNetworkItemTooltip class. +- Fixed missing header file in smb4kcore.cpp. +- Shares having special characters in their names do not appear broken + anymore (closes #8036, #8108). +- Updated handbook. +- Fixed removal of temporary files after printing. +- Updated admin directory for autoconf 2.60 support. +- Fixed a minor bug in search routine of the smb4k_cat utility. +- Fixed potential crash in Smb4KApp::readOptions(). +- Fixed compilation error of smb4k_umount.cpp on IRIX (closes #7927). +- Fixed memory leak in Smb4KPrint::init(). +- Updated several translations. + +Smb4K 0.7.1: +- Fixed compilation error occurring with Smb4KBrowserWidgetItem::update() + (closes #7261, #7263). +- Fixed compilation error(s) in smb4k_umount.cpp under Solaris (closes #4419, + #7269). +- Updated translations. +- Updated handbook. However, it's still work-in-progress. +- Introduced the possibility to modify the length of the interval between + checks for external mounts/umounts and dead shares. This is especially + useful on systems with many mounted shares and/or to reduce the load + on remote servers (closes #6907). +- The timer will be disconnected from Smb4KScanner::start() if the scanner + is idle (closes #6907). This drastically reduces the CPU load! +- Fixed input validation when using smbclient for searching (closes #7429). +- Fixed a bug that prevented the correct saving of updated authentication + information. +- Fixed smb4k.desktop file. +- Removed two queries for a non-existent config entry. So, using Kerberos + with smbclient works again and the domain is included in the argument + string for nmblookup. +- Made the synchronization progress dialog work correctly with the latest + version of rsync. +- Fixed broken translation in the Konqueror plugin. +- Fixed a crash in the network browser's tooltip code. +- Fixed several small issues in Smb4KFileIO. + +Smb4K 0.7.0: +- KonqSidebar_Smb4K: hang up the new alreadyMountedShare signal from mounter. + No error dialogs of "already been mounted share" anymore (partially + closes #5636). +- The old tab widget in the main window has been removed. +- Added shortcuts to the main window that allow jumping to each dock widget: + CTRL+1: Network Browser, CTRL+2/CTRL+S: Search Dialog, CTRL+3: Shares View. +- Unified look of dialogs. +- Did a major revision of the browser widget (GUI): + + Introduced tooltips that carry information about the network item + underneath the mouse pointer. + + The master browser will be displayed with blue color. + + The popup menu has the highlighted network item as title. + + Improved the "Rescan" action. If you open the popup menu, the selected + workgroup or server will be scanned. If you use the rescan action on + the empty viewport or from the toolbar/menu, the old behavior will + be preserved. + + Moved "Mount Manually" action here. + + Removed obsolete "This computer is already in the list." error + message box. +- Did a major revision of the search dialog (GUI): + + Redesigned the widget and made it a stand-alone dock widget. + + Hosts can be added by simply double clicking them (closes #2247). + + A host that is already in the browse list is underlaid with the + "button_ok" pixmap. This makes the "This computer is already in the + list." message box obsolete (see above). +- Did several changes to the shares view (GUI): + + The popup menu has the share name as title. + + Introduced tooltips that carry the information about the mounted + share. + + Replaced the old icon for broken shares by a a new combined icon + (mounted hard drive overlayed by a semi-transparent cancel icon). + + The item width of the share icons has been enlarged to 500 pixels in + list mode. +- The bookmark editor allows editing of the IP address and workgroup. +- Put Smb4KShareWidgetItem class in own files. +- Removed obsolete options "This master browser needs authentication" and + "Use authentication when querying the workgroup master browsers" from + the configuration dialog. +- When closing the configuration dialog, the root password is only asked, + if the user changed one of the super user options (partially closes #5636). +- The removal of the super user entries from super.tab and/or sudoers is + now determined by the choice in the configuration dialog. +- Rewrote Smb4KSharesMenuWidget class. +- Added new Smb4KShareActionMenu and Smb4KBrowserActionMenu classes. They + contain the actions that were defined in Smb4KShareWidget and + Smb4KBrowserWidget before,respectively. The use of Smb4KShareActionMenu in + the system tray icon closes #5622. +- Replaced deprecated KStdActions. +- Introduced new Smb4KDataItem container for the core classes. +- Revised bookmark handling: + + The bookmark handler does not use KConfig anymore but has its own read + and write functions. Thus, you won't be able to read the bookmark file + with prior versions once you ran Smb4K 0.7.0. + + The bookmarks are now stored with workgroup/domain and IP address (closes + #6316). +- The scanner class underwent a major revision: + + The net command now replaces most of the smbclient command lines. This + substantially simplifies the code and also seems to speed up the + look-up processes. As a consequence, however, the support of Samba 2.2 + has been dropped. + + Implemented list of all discovered hosts in Smb4KScanner. This significantly + reduces the network traffic. + + Moved IP address look-up code to the scanner (and thus removed Smb4KIPFinder + class). + + Introduced a "background process" which processes the IP address look-up + and the gathering of additional information (OS and server string). + + An automatic rescan using the RAP protocol will be initiated if the query + for the shares of a certain host failed because of the wrong protocol + (closes #4417). + + Added possibility to query the current workgroup master browser to + retrieve the browse list. +- Massively changed the entries and groups in the configuration file. + As consequence, Smb4K will be incompatible with prior versions. +- Added ability to synchronize a local copy with a remote share and vice + versa (closes #1940). This feature uses Rsync. A few of the many options + have been stripped, because they are used for transfer from remote hosts, + which is no the case here. +- Information of any share will now be collected by the mounter. Smb4KCore + has been tidied up accordingly. Information of the number of files and + directories has been dropped (for now). +- Removed Catalan, Norwegian Nynorsk, Chinese Traditional (zh_TW) and + Simplified (zh_CN), Russian and Polish translation because they were + unmaintained and hopelessly out-dated. +- Removed the Smb4KShellIO class, because its only purpose was to provide + the Samba version. This is not necessary anymore, because we switched + to Samba 3. +- Introduced smb4k_cat and smb4k_mv utilities to read and copy/move system + config files. +- The handbook shipping with this release actually contains useful information. + However, it is still work in progress. The license of the handbook has been + changed from GFDL to GPL. +- If a user tries to mount an already mounted share, no error message will + be displayed anymore. +- Renamed the global namespace to Smb4KGlobal and several functions inside. +- Centralized the application's timer in the Smb4KGlobal namespace. As a + side effect, this seems to fix the very-fast-vanishing-tooltips problem. +- If the user canceled the writing to /etc/super.tab or /etc/sudoers, the + previous state will be re-established. +- Removed "Specify User" dialog from Smb4KBrowserWidget and moved it to + Smb4KGlobal namespace. Now only core classes are using it. +- Reworked and cleaned up Linux specific code in Smb4KMounter::import(). +- Moved error handling to Smb4KGlobal namespace. The reason is, that the + previous signal/slot model was not able to handle errors during the + initialization of the core. +- Removed Smb4KPasswordHandler::AskPass class and integrated its functionality + into Smb4KPasswordHandler::askpass(). This should fix the compilation errors + encountered when using MIPSpro Compilers on IRIX/MIPS (closes #6811). +- When reading the smb.conf file, a line beginning with a semicolon is valued + as comment. +- Reduced CPU load by stretching the interval between checks for externally + mounted and broken shares from 1000 ms to 2500 ms. + +Smb4K 0.6.10: +- Fixed a bug in smb4k_umount that did not allow the unmounting of a share + when the mount point was quoted. +- Fixed a bug in smb4k_umount that did not allow the unmounting of a broken + share. +- [Patch 0.6.10a] Fixed input validation when using smbclient for searching + (backport from 0.7 branch, closes #7429). +- [Patch 0.6.10a] Fixed broken translations in Konqueror plugin. +- [Patch 0.6.10a] Updated admin directory for autoconf 2.60 support. +- [Patch 0.6.10a] Fixed removal of temporary files after printing. +- [Patch 0.6.10a] Fixed smb4k.desktop file. +- [Patch 0.6.10a] Fixed memory leak in Smb4KPrint::init(). +- [Patch 0.6.10a] Fixed occurrence of annoying error dialog on start-up when + a share had already been mounted. +- [Patch 0.6.10a] Fixed a potential crash in Smb4KBrowserWidget::insertItem(). +- [Patch 0.6.10a] The preview dialog won't accept the contents of a wrong + address anymore. + +Smb4K 0.6.9: +- Integrated startup fix for Samba 2.2 users by Chris Clayton and extented it. +- Updated French and Czech translation. +- The "Remove Entries" button in the "Super User" configuration tab will now + be disabled together with the "Apply" and "OK" button if Smb4K writes to a + system configuration file. + +Smb4K 0.6.8: +- Fixed another bug in the bookmark menu widget. It will again be properly + updated during run time, when bookmarks are added or removed. +- Fixed enabling of "Authentication" action in browser widget. +- Fixed a crash (NULL pointer access) in Smb4KShareWidget::slotMountedShares(), + that was found by Glen Masgai, who also sent the patch. +- Added support of mount.cifs and umount.cifs. This should enable users to + mount CIFS shares as normal user depending on the configuration of the + system and on the presence of these two utilities. NOTE: You have to set the + setuid root bit for both binaries. +- Revised start-up: Smb4K will run on systems where either only smbmount/ + smbumount or mount.cifs/umount.cifs are present. + +Smb4K 0.6.7: +- Fixed a crash in Smb4KBookmarkMenuWidget::insertBookmarks(), that was + introduces by the "fix" in 0.6.6. +- Updated Turkish translation. + +Smb4K 0.6.6: +- Fixed too small buffer size in Smb4KUser on systems with many users and + groups (closes #6070). +- Fixed crash in Smb4KNetworkTab::slotKilled() (closes #3125). +- Fixed these issues found by Marc Hansen (Thanks!): + + crash in Smb4KBrowserWidget::slotMembers() + + searching for illegal strings such as #, ', () shows search command + as search result + + the application might crash if you press "Apply" and "OK" successively + in the configuration dialog and system files have to be written (As + consequence, the OK and the Apply button will be disabled while the + configuration is written to disk.) + + shares are displayed although the user has to supply a password + + printer shares are displayed although they are disabled in the + configuration dialog + + crash in Smb4KBookmarkMenuWidget::insertBookmarks() (closes #6146) + + unusable entries were written when the user bookmarked a 'homes' share + without providing a user name +- Fixed the broken writing to the configuration file and the popping up + of multiple information dialogs in Smb4KPasswordHandler. + +Smb4K 0.6.5: +- Fixed writing to ~/.nsmbrc file under FreeBSD. +- Fixed freezing of Smb4K when a share went offline (closes #3676). Smb4K + will lock-up for a short amount of time if it encounters a broken share + and will then continue its work without any problems. +- Fixed the generation of wrong file permissions for /etc/sudoers and + /etc/super.tab, respectively. The permissions are no longer hard coded, + but the stat() system call is used to read the original permissions that + will then be preserved. +- Introduced global KConfig object and ported all classes to use it. +- Fixed login problem when trying to preview a WinXP share or similar. +- Added support of the 'include' directive in the smb.conf file (closes + #5948). NOTE: The file that is to be included *must* be given with its + full path! +- Moved from getgrgid() to getgrgid_r() in Smb4KUser. This should close the + "Smb4KUser: Could not get group name!" issue also known as #4914. +- KonqSidebar_Smb4K: switched to global config system. Now parameters changed + from the option dialog have effect into the konqueror plugin. +- Executing a network item in the browser by clicking its name (not the [+]) + will show/hide its contents (closes #3352). + +Smb4K 0.6.4: +- REALLY fixed the security issues in Smb4KFileIO. Now, temporary files + and directories are used to copy and modify sensitive data and the lock + file is checked to be not a symlink. +- Fixed unmount-all-shares-on-exit functionality, that was broken due to + changes that were applied to the smb4k_umount utility program in earlier + versions of Smb4K. +- Fixed forced unmounting of shares. +- Fixed running progress bar after you denied the forced unmounting of a + share. +- Fixed missing exit( EXIT_FAILURE ) statement in smb4k_umount utility. +- Fixed several memory leaks. +- Fixed compilation error under FreeBSD. +- The PASSWD environment variable will be preserved when the 'env_reset' + flag has been set in /etc/sudoers (closes #4945). The user needs to + rewrite the entries, though. See FAQ for details. + +Smb4K 0.6.3: +- Fixed security issue: An attacker could get access to the full contents + of the /etc/super.tab or /etc/sudoers file by linking a simple text file + FILE to /tmp/smb4k.tmp and /tmp/sudoers, respectively, because Smb4K didn't + check for the existance of these files before writing any contents. When + using super, the attack also resulted in /etc/super.tab being a symlink to + FILE. +- Included three patches by Montel Laurent, that + + add moc file inclusion to the bookmark editor, + + fix a memory leak in the Konqueror plugin, + + fix ./smb4k/Makefile.am, + + disable the OK button of the mount dialog if the input line is empty. + +Smb4K 0.6.2: +- Fixed security issue: When ignoring the kdesu dialog a copy of the + super.tab file was left under /tmp. +- Error messages won't pop up anymore when ignoring the kdesu dialog. The + reporting of unknown errors has been disabled in + Smb4KFileIO::slotReceivedStderr() (closes #4309). +- Fixed reading of authentication data. +- Removed check for mount.smbfs (under Linux) which is actually needless + because it is either a symlink to smbmount or nonexistent. +- Updated ./admin directory. Smb4K now needs automake 1.9. +- Fixed command line for mount.cifs (closes #4854). The 'domain' instead + of the 'workgroup' option is used. +- Fixed crash when the user clicked the "Show search dialog" action and the + tab group widget wasn't shown. + +Smb4K 0.6.1: +- Improved lock file handling (closes #4310). Now the editing of a system + file is only denied, if another instance of Smb4K (i. e. another user) + is modifying the same system file. Additionally, the lock file will now + be removed (or processed), if the application emits the shutDown() signal. +- Fixed a bug in the code that removes the entries from the sudoers file. +- Fixed wrong assignment of RAP protocol config entry to RPC radio button + in configuration dialog. +- Moved to QString::compare() to compare strings, because "==" caused + crashes under certain circumstances (closes #3604). +- The wallet won't be opened on start-up but when a password is actually + needed. + +Smb4K 0.6.0: +- Rewrote password handling: Added KWallet support as default method + (closes #3695). If you do not want to use KWallet, login information + won't be saved but only stored temporarily. There is also the possibility + to deny the password storage altogether. + ATTENTION: If you deny access to the wallet on the first start-up, all + passwords stored in the passwords file will be lost! +- Improved FreeBSD support. The passwords will now be stored encrypted in + the ~/.nsmbrc file. +- Added Dutch translation. +- Put the core and (most of) the widget classes into shared libraries. +- The DNS won't be queried anymore when doing an IP lookup. +- Added Konqueror plugin by Massimo Callegari (closes #2731). An installation + of KDE Base is necessary to make it compile. +- Moved to default KDE icons for the network items. +- Added support of the 'net' command (closes #2227). This adds the advantage + of the ADS and RPC protocol being used and even very large share names will + be displayed. Additionally, it seems to significantly speed up the lookup + process. Smb4K will automatically use the 'net' command if found on the + system. + There is a disadvantage though: A valid login and password are necessary + to logon to a server. If neither is known, Smb4K will try to authenticate + with the 'guest' user and an empty password. This will work with (almost + all) Windows machines and with Samba servers that have set the security + option to SHARE. For all others you will have to provide a login and + password. +- Added namespace Smb4K_Global which contains functions used by several + classes. +- Improved KAction handling in popup menus. +- Added a patch by Nuts Mueller that adds /usr/local/bin and /usr/local/sbin + to the paths that are searched by the utility programs. +- Added a patch by Steven Lawrance that fixes buffer size problems in + the Smb4KUser constructor. +- Fixed mounting via bookmarks (ampersand issue). +- Added FAQ file. +- Redesigned some widgets in the configuration dialog. +- Cleaned many strings from full stops and exclamation marks (closes #2869). +- Fixed crash in Smb4KBrowserWidget::slotAddIPAddress() that occurred when + opening a workgroup (closes #3351). Thanks go to Nuts Mueller who helped + me finding the problem. +- Implemented 'iocharset' option for CIFS mounts (closes #4071). +- Fixed mounting of CIFS shares. The file_mode and dir_mode options were not + provided in octal which resulted in broken mounts that could not be accessed. +- Fixed the "probably not smb-filesystem" issue (closes #1837). + +Smb4K 0.5.2: +- Fixed naming of Norwegian translations. +- Fixed crash that appeared when trying to determine the disk usage. Thanks + go to Bamfox who helped me finding the problem. +- Added Icelandic and Danish translation; updated Chinese Simplified + translation. +- Added additional cleaning of the mount prefix on exit. +- Added patch by Yura Pakhuchiy that fixes wrong IP address resolution for + hosts starting with a hyphen. +- Fixed problems with special characters in passwords (closes #3444, #3728). +- The warning that Konqueror might hang if you open CIFS shares will only be + shown with KDE <= 3.3.92. Thanks go to Stefan Gehn (aka mETz) who send a + patch. +- Fixed compilation errors under FreeBSD. +- Improved printing by switching to smbspool. + +Smb4K 0.5.1: +- Reduced CPU load by using QDir::isReadable() and QDir::exists() instead + of QDir::entryList() to determine if a share is broken and by increasing + the check interval for external mounts/unmounts. +- Fixed crash that occurred when trying to forcibly unmount a (broken) + share (should close #3029). +- Fixed mandatory password input for browsing (unprotected) WinXP shares. +- Added patch #303 by Ian Abbott that fixes the failure of smb4k_mount, + smb4k_umount and smb4k_kill in the case the user does not have read + access to mount/umount/smbmount/smbumount/kill (closes #3094). +- Updated French translation. +- Added Chinese (Taiwan) translation. Thanks go to Jack Liu. +- Fixed unmounting of hidden shares. + +Smb4K 0.5.0: +- Only one instance of Smb4K can be started (closes #2636). +- The hide/close behavior is now KDE compliant. +- Removed Smb4KStarter class and distributed its duties to the Smb4KCore + class and the main() function. +- Added support of sudo (closes #2222). +- Added support of the CIFS file system (closes #1874). Samba 3 is required. +- Introduced smb4k_mount, smb4k_umount, and smb4k_kill utilities and ported + classes to use them. This fixes several security concerns regarding the + use of mount and umount with super (and sudo). +- Closed several memory leaks. +- Replaced the QSplitters in the main window by KDockWidgets. Now, you can + move the network browser and tab widget around or even detach them. +- Removed the Smb4KView class. +- Moved to nice KActionMenus. This included a complete rewrite of the + Smb4KSystemTray and Smb4KBookmarkMenuWidget classes (closes #2007). +- Mounted shares are optically advertized in the browser widget. +- If the mountpoint can't be created, an error message will be emitted and + the mounter will exit. +- Every mountpoint within the mount prefix will automatically be removed + after the share was unmounted. This made the "Clean up default directory + on exit." option obsolete. +- Share names containing blanks are fully supported. LIMITATION: If Smb4K + cannot figure out, that the share contains a blank instead of an + underscore, the latter one will be shown. +- Removed the readOptions() functions from the core classes. Options are + now read when they are needed (i.e. at the beginning of a function). +- Changed the format of the entries in the super.tab file. It's not + compatible with the old one and will be converted on the first program + start. +- Revised Smb4KBookmarkHandler class and moved the bookmark editor to its + own class. +- Disk usage information is now provided by the statvfs() system call. + *** Program freezes may still happen if the network connection is bad or + the share vanishes. Help is wanted to fix this issue! *** +- Improved Smb4KShareWidgetItem class and cleaned up Smb4KShareWidget class. +- Added Czech and Turkish translations. Thanks go to Alois Nespor and G�kem + Cetin. +- Added "Super User" tab to configuration dialog and moved the "Super User + Privileges" options there. +- Reorganized and cleaned up the configuration file. +- Restricted the "Unmount all shares on exit." option to those shares that + are owned by the user. +- Removed "obsolete" '-N' options from smbclient commands. Instead '-U %' + is used which serves the same purpose. +- Fixed searching for hosts via smbclient. Hosts that are not available are + no longer reported as existent. +- Added the ability to mount shares manually (closes #1640, #2546). +- Redesigned the askpass dialog and added information why it is shown + (closes #2226). +- IP addresses are now also assigned correctly if host names are partly the + same (closes #2769). +- Improved support of FreeBSD. +- Included patch #286 by Andrei Bulava to add codepage cp1251 to Linux charset + selection (closes #2962). +- Enhanced source code documentation. +- Broken shares (i.e. empty CDROM shares, etc.) are marked as such and the + user will only be able to unmount them. No other actions may be performed. + (closes #2998, #3000) + REMARK: This feature does not include shares that got unavailable due to + the shut-down of a server. This issue is still NOT solved. + +Smb4K 0.4.1a: +- Fixed severe bug in Smb4KMounter::unmountAll(), which led under certain + circumstances to complete data loss on remote shares. Thanks go to Jeremy + Shaw for informing us and sending a patch. +- Updated French and Polish translations. +- Added missing connection to Smb4KApp::slotQuit() to system tray. + +Smb4K 0.4.1: +- Fixed multiple occurrences of workgroups in the browser widget. +- Fixed malfunction when super program was chosen and became deinstalled. +- Fixed handling of passwords with special characters (closes #2146). +- Fixed problems opening shares with Konqueror by moving from + KApplication::invokeBrowser() to KRun. +- Fixed two potential crashes by adding NULL pointers to the return statements + of Smb4KMounter::findShareByName() and Smb4KMounter::findShareByPath(). +- Fixed blocking of KDE's logout if the main window was open. +- Added Smb4KCore class as container for all core classes. +- Centralized error message handling in Smb4KCore. +- Added error messages for errors that might occur while trying to mount + a share. +- Added ability to print PS and PDF files directly over the net (closes #1737). + This is still experimental. To have full functionality, you'll have to have + the programs 'dvips' and 'enscript' installed. +- Added error codes to smb4kdefs.h file and ported core classes to use them. +- Added Japanese, Bulgarian and Norwegian translations. Thanks go to Toyohiro + Asukai, Atanas Mavrov and Nils Kristian Tomren for providing them. +- Removed abandoned Russian and Catalan translations. +- Added several codepages (closes #2094). +- Added Smb4KShellIO class, that takes care of all shell IO operations, + that are not connected to mounting and unmounting of shares and network + operations. Moved Smb4KShareTab's shell operations there. +- Printer shares are shown by default. +- Changed default behavior if a WINS server was found: The network instead + of the WINS will be queried to get the browse list. +- Revised the configuration dialog. Most important change is, that the + config dialog does not need that much space anymore. +- Sped up the retrieval of IP addresses in the Smb4KIPFinder class. +- Revised mouse handling in Smb4KShareWidget class. +- Smb4K can detect the IP address also with Samba pre-releases correctly. +- Ported Smb4KScanner, Smb4KBrowserWidget and Smb4KBrowserWidgetItem classes + to use Smb4K*Item containers. +- Revised code in Smb4KPasswdReader class and renamed several functions. +- Rewrote program detection in Smb4KStarter (closes #1861). +- Major revision of Smb4KMounter class. Many functions have been modified + and many bugs fixed. + +Smb4K 0.4.0: +- This version REQUIRES KDE 3.2.0 or higher. +- Fixed unmounting of all shares upon exit. +- Fixed several memory leaks (closes #1144). +- Fixed layout problem with Plastik theme in the network tab of the + configuration dialog. +- Fixed unmounting of shares that contain parentheses. +- Added ability to execute mount and umount SUID root. This feature requires + the program super [ftp://ftp.ucolick.org/pub/users/will/]. +- Added ability to force the unmounting of dead shares (closes #764). This + feature requires Linux kernel 2.4.11 or later, a recent util-linux package + and the program super. +- Added the ability to bookmark shares (closes #1319). +- Added special handling of 'homes' shares. +- Added system tray icon for the application with the ability to open mounted + shares and to open the configuration dialog. It shows also available + bookmarks. +- With the implementation of the system tray, the application is started + minimized. +- Added support of advanced Samba options (closes #1359 and #1488). +- Added ability to authenticate to master browsers when retrieving browse + lists (closes #1439). +- Added ability to select the program used for network searches (closes #1501). +- Added searching for hosts via IP addresses. +- Added detection, displaying and usage of IP addresses. +- Added user and group information to the "Share" tab. +- Added the ability to allow the user to unmount shares that are not owned by + him/her. This feature is off by default. +- Added "Quit" and "Configure Smb4K..." action to toolbar. +- Added French, Slovak and Spanish translation. Thanks go to Nicolas Ternisien + Michal Sulek and Quique for providing them. +- Revised the Smb4KStarter class: added detection of mandatory programs and + Samba's version; added error message box that reports missing programs; + removed the splash screen; moved the mounting of recently used shares to the + Smb4KMounter class. +- Revised the Smb4KPasswdReader class and removed some bugs. +- Revised the Smb4KShareWidget and Smb4KShareWidgetItem classes. +- Improved the error messages of the configuration dialog. +- Improved the status bar message handling and made Smb4K more communicative. +- Revised the process of handling the list of mounted shares centralizing it + with Smb4KShare +- Moved error dialogs to the core classes. +- Moved desktop entry to category "Utilities". + +Smb4K 0.3.2: +- Fixed crash in Smb4KBrowserWidget class (closes #1145). +- Fixed hanging when exiting after long use. +- Fixed generation of wrong address entry after using the combo box to + switch directories in the preview dialog. +- Fixed a bug in search tab, that led to an insertion attempt of a non-existent + share when clicking 'Add' after clearing. +- Fixed handling of passwords containing special characters (closes #1182). +- Fixed compilation error with KDE 3.2 pre-releases. +- Added ability to force the generated subdirectories to be lower case. +- Added weak password obfuscation. NOTE: After the first use the authentication + info won't be usable for prior version of Smb4K. +- Added ability to hide shares that are not owned by the user. +- Added Brazilian Portuguese, Ukrainian, and Hungarian translation. Thanks go + to Giovanni Degani, Ivan Petrouchtchak, and Karoly Barcza for providing them. +- Added ability to navigate through the main window's tabs by pressing the + shortscuts CTRL+1/2/3. +- Added OS and version detection. +- Added credits. +- Added default login (closes #1133). +- Added support for empty passwords (closes #1268 and #1269). +- Removed the preview's info dialog. +- Revised shares view: major feature enhancements and new look. +- Revised the Smb4KMounter class: major improvements and bug fixes. +- Revised the Smb4KScanner class: major improvements and bug fixes. +- Revised share tab. +- Revised network browser widget. +- Revised configuration dialog; renamed and added pages; options will also + be reread when pressing "Apply"; moved some configuration entries. +- Rewrote Smb4KStarter class and added major enhancements. +- Rewrote internal communication infrastructure. +- Renamed some pages of the configuration dialog (and their classes too). +- All buttons now respect KDE's global option "Show icons on buttons". +- Unified error message boxes. + +Smb4K 0.3.1: +- Fixed a crash in the browse window. +- Fixed duplicate share entries. +- Added status messages for the mount process. +- Added titles to the pop-up menus. +- Added progress bar to the splash screen. +- Added Chinese (zh_CN) and Russian translation. Thanks go to Nick Chen + and Yudin Stanislav for providing them. +- Added monitoring of selected share to "Share" tab. +- Added ability to open a share by executing it. +- Revised internal communication of the program parts. +- Revised core classes: many changes and bug fixes were done; source + code documentation has been improved. +- Improved the authentication tab of the configuration dialog. +- Improved preview dialog and fixed handling of hidden files/directories. +- Improved error handling of the browse code. +- Improved status bar and added progress bar to it. +- Improved WINS server support. +- The search function now uses nmblookup, which makes it more reliable. +- The "ERRDOS - ERRnoaccess" error message is now respected by the mounter. +- Only one global password reader instance is used. +- And, as always: Some more improvements and minor bug fixes. + +Smb4K 0.3.0a: +- Fixed crash upon start-up. + +Smb4K 0.3.0: +- Fixed faulty checking during mount process. +- Fixed the host-in-wrong-workgroup problem. +- Fixed truncated workgroup entries, if the WINS server was queried. +- Fixed crash, if the user pressed CTRL+U and no share was highlighted. +- Fixed bug in the "Unmount All" routine. +- Fixed bug #765: Shares that contain spaces (e. g. "Shared Files") are + handled correctly. +- Added popup menu to the browser window. +- Added preview of network shares. +- Added authentication dialog. +- Added request buffering to the browse and mount code. +- Added selection of the look-up method. +- Added directory info to "Share" tab; made overall improvements. +- Added type info to the "Network" tab. +- Added nice caption. +- Added Polish translation. Thanks go to Radoslaw Zawartko for providing it. +- Added detection of external mounts/unmounts during program run. +- Improved "splash screen". +- /usr/local/etc (FreeBSD) is searched for smb.conf, too. +- Merged Smb4KSearch and Smb4KScanner core classes. +- Removed KProcess::setEnvironment() stuff from the browse and mount code. + It only caused problems. +- Changed password handling. Passwords for single shares can be defined. + Unfortunaltelly, it is INCOMPATIBLE with the old one. Sorry, folks! +- Scanning for Server and OS info is only done, if it is necessary. +- Clicking onto an empty space in the browser window will hide the entries + in the "Network" tab. +- And, as always: Some more improvements and minor bug fixes. + +Smb4K 0.2.1: +- Fixed hanging of Smb4K when exiting via File->Quit. +- Fixed wrong master entry for hosts, that were added by a network search. +- Fixed duplicate workgroup entries. +- Fixed several problems in the browse code. +- Fixed a crash in the "Logins" config tab. +- Improved the "Network" and "Share" tab. +- Improved the share view's popup menu. +- Redesigned the configuartion dialog. Now it complies with KDE standards. +- Added Catalan translation. Many thanks go to Leopold Palomo Avellaneda for + providing it. +- Added Swedish translation. +- Added experimental WINS server support. +- Separated KProcess stuff from the widget classes. +- Login information is stored in a separate file with strict permissions. +- Many more improvements, bug fixes and code clean-ups. + +Smb4K 0.2.0a: +- Fixed truncated kde_qt_dirs variable in the configure script. The compilation + problems with Red Hat and other distributions should be gone now. +- Fixed a bug in the browse code, that made the browse lists of some hosts + inaccessible under certain circumstances. +- Fixed a bug in the mount routine, that prevented a share from being displayed, + if output appeared on stdout/stderr during mounting. + +Smb4K 0.2.0: +- Fixed two bugs, that prevented the "Abort" action from being disabled after a + network scan. +- Fixed the annoying disappearance of the type and comment entries in the + browser window after the configuration dialog was closed. +- Fixed a bug in the "Network" and "Share" tab, that made the entries appear + clustered in the upper left corner. +- Fixed wrong nmblookup command line, that made Smb4K not work with Samba + >=3.0alpha24. +- Added possibility to unmount all shares at once (even on exit). +- Added option to mount recently used shares on start-up. +- Added basic network search. +- Added icons to all tabs. +- Added shortcuts. +- Redesigned the tabs in the configuration dialog. +- The "Network" tab now shows the comment at all times. +- The widget sizes can freely be adjusted and will be restored on start-up. + There are no hard coded values anymore. +- Many other bug fixes, internal changes and code clean-ups. + +Smb4K 0.1.1: +- Actions are only enabled, when they are needed. +- New program icon. It comes from the Crystal 0.85 icon set. +- Added explanation to the "Logins" tab of the configuration dialog. +- Labels were shortened and unified. +- Printer shares can be hidden now. +- Added comment to the network info tab. Whether the comment will be shown + depends on your choice in the configuration dialog. +- A few more bug fixes and improvements I can't remember exactly. + +Smb4K 0.1.0: +- Initial release. diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..cbd510b --- /dev/null +++ b/Doxyfile @@ -0,0 +1,283 @@ +# Doxyfile 1.5.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = smb4k +PROJECT_NUMBER = CVS_HEAD +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/alex/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/alex/Entwicklung/smb4k_09 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = smb4k.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/FAQ b/FAQ new file mode 100644 index 0000000..009c00b --- /dev/null +++ b/FAQ @@ -0,0 +1,344 @@ +Frequently Asked Questions (FAQ) +================================ + +(Version: 2005-12-20) + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! This file is deprecated. Please refer to the "Frequently Asked Questions" ! +! section of the handbook for the latest version of the FAQ. ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +Reporting bugs +-------------- + +Q: I think, I found a bug. Where can I report it? + +A: There are two possible ways, how to do it. You can either click on the + menu item Help->Report Bug... and submit your report there, or you go to + the project's bug tracking site: + http://developer.berlios.de/bugs/?group_id=769. + + NOTE: + - Before reporting a bug, try the latest version of Smb4K. Maybe the bug + you found has already been fixed. + - If you are reporting a bug, please include as much information as + possible. To reproduce your problem, it is mandatory that you tell us + what you did exactly. Also, it is necessary that you provide the version + of Smb4K and KDE that you are using and which operating system (Linux, + FreeBSD, etc.) and distribution (if applicable) is running on your + computer. + + +Compilation and Installation +---------------------------- + +Q: I have compiled Smb4K from source. After starting it, I can't see the + toolbar. What went wrong? + +A: Most likely, you installed Smb4K to the wrong place. To correct this, + uninstall Smb4K first. Go to the source's root directory and run + + $ su -c "make uninstall" + + from the shell. + + NOTE: + This will not work, if you ran + + $ make distclean + + in the meantime. + + Now, reconfigure the source by passing the '--prefix=PREFIX' option to + the configure script: + + $ ./configure --prefix=`kde-config --prefix` + + Afterwards, compile and install it: + + $ make && su -c "make install" + + Smb4K will be installed to the right path and everything should work fine. + + +Q: I want to compile Smb4K from source and I want to be able to uninstall it + easily. Is that possible? + +A: If you want to be able to uninstall Smb4K easily, you might want to use + checkinstall. It keeps track of all files installed by the "make install" + command or equivalent, creates a Slackware, RPM, or Debian package with + those files, and adds it to the installed packages database, allowing for + easy package removal or distribution. + + Configuration, compilation and installation using checkinstall will work + like this (see also above): + + $ ./configure --prefix=`kde-config --prefix` && make && su -c "checkinstall" + + +Q: The configure script fails and tells me, it can't find my Qt + installation. + +A: There are two things you should check: + 1. It may be that the Qt header files are not installed. If this is true, + install them and run the configure script again. + 2. The QTDIR environment variable might not be set properly or at all. + Check for the following line in your ~/.bashrc file + + export QTDIR=PREFIX + + and add it, if it is not present. Replace PREFIX with the prefix of your + Qt installation. Run + + $ source ~/.bashrc + + from the shell. Now, you're set for a second configuration attempt. + + If the header files are installed and the QTDIR variable is set, but you + still get the same error, you might want to try to pass the + '--with-qt-includes=/path/to/header/files' option to the configure script. + + +Q: The configure script fails and tells me, it can't find my KDE + installation. + +A: There are two things you should check: + 1. Probably the KDE header files are not installed. If so, install them and + run the configure script again. + 2. The KDEDIR environment variable might not be set properly or at all. + Check for the following line in your ~/.bashrc file + + export KDEDIR=PREFIX + + and add it, if it is not present. Replace PREFIX with the prefix of your + KDE installation. Run + + $ source ~/.bashrc + + from the shell. Now, you're set for a new configuration attempt. + + +Browsing +-------- + +Q: When I scan the network, there are several workgroups appearing, that + are not accessible. What can I do to avoid this behavior? + +A: This behavior might be caused by Samba's enhancements to cross-subnet browse + propagation (see smb.conf(5) manual page). You can switch off this feature in + the smb.conf by adding the following entry to the [global] section: + + [global] + ... + enhanced browsing = no + ... + + This option seems to have no effect, if you do not use a WINS server. + + +Q: When I start Smb4K, there is nothing in the network browser! + +A: Please follow this list to fix the problem: + - If your network has a WINS server, add it to the [global] section of + your smb.conf file and restart Samba (if necessary) and Smb4K. + - Make sure the SMB ports 137 (TCP+UDP), 138 (UDP), 139 (TCP+UDP), and 445 + (TCP+UDP) are not blocked by a firewall. If you are using SUSE's firewall, + see below. + - Try to use a different look-up method. Therefore, change the settings + under Settings->Configure Smb4K...->Network->Browse List. + + If there still isn't anything visible in the browser widget, ask for help on + the Smb4K-general mailing list or file a bug report. + + +Q: I'm using SUSE Linux with its firewall enabled. As normal user, I cannot + browse the network neighborhood. The browser window is always empty. + +A: The solution to this issue is covered by several pages on the net. You may + want to take a look at: + - Novell Cool Solutions: + http://www.novell.com/coolsolutions/feature/11952.html + - HOWTO at TweakHound: + http://www.tweakhound.com/linux/samba/page_8.htm + - SUSE Linux Forums: + http://forums.suselinuxsupport.de/ + + +Q: If I open a Windows 98 server, there are no shares shown although I know + that there should be serveral. What's wrong? + +A: As of version 0.6.0, Smb4K uses the 'net' command to retrieve the list of + shares from a host. With the default settings, the 'net' command will try + to guess the protocol that is needed to communicate with the server (RAP or + RPC). Unfortunately, this does not seems to work well with Windows 98 and + earlier. To make things work, go to Settings->Configure Smb4K...->Samba-> + net->Protocol and check the RAP button. + + NOTE: + This does not apply to versions prior to 0.6.0, because they use the RAP + protocol based 'smbclient' command to retrieve the browse list. Smb4K + 0.7.0 and above will automatically rescan the target server with the RAP + protocol if the first attempt failed. + + +Mounting/Unmounting of shares +----------------------------- + +Q: Mounting a share fails and I get the following error message: + + smbmnt must be installed suid root for direct user mounts (500,500) + smbmnt failed: 1 + + What does that mean? + +A: It means, that you do not have enough permissions to mount SMB shares. + There are two things you can do: + 1. Set the SUID root bit for smbmnt. Therefore you have to find out, + where the binary is located. Try + + $ ls -la `which smbmnt` + + in the shell. If this is a symlink, follow it to find the binary. + Change into the directory, where smbmnt resides and run + + $ chmod +s smbmnt + + Now the mounting should work. + + WARNING: + Do not set the SUID root bit for smbmount! If you do, mounting will + too fail with the following error message: + + libsmb based programs must *NOT* be setuid root. + 6002: Connection to dustpuppy failed + SMB connection failed + + 2. You can execute mount and umount SUID using the program super (since + Smb4K 0.4.0) or sudo (since Smb4K 0.5.0). To enable this feature, you + have to go to Settings->Configure Smb4K...->Super User and adjust the + settings. + + +Q: If I want to unmount a share, I get the following message: + + smbumount must be installed suid root + + What do I have to do? + +A: You have similar options as above. Either you set the SUID root bit for + smbumount or you enable the feature "Use super user privileges to mount and + unmount shares" under Settings->Configure Smb4K...->Super User->Actions. + For details see above. + + +Q: I'm using the CIFS file system for mounting and I've set the UID/GID in + the configuration dialog, but Smb4K does not seem to care about that at + all! + +A: This is a Samba feature. If the target server supports the CIFS Unix + extentions, the uid and gid option will be ignored. For more information + see the mount.cifs(8) manual page. + + +Q: When I try to mount a share from a Windows 2003 server, I get the following + error message + + cli_negprot: SMB signing is mandatory and we have disabled it. + 4377: protocol negotiation failed + SMB connection failed + + and the mounting fails. What's wrong? + +A: You are using the SMBFS file system that does not support signing. You + have to switch to the CIFS file system in order to be able to mount the + share. Go to Settings->Configure Smb4K...->Samba->File System and choose + CIFS instead of SMBFS. + + NOTE: + Smb4K will use the mount.cifs binary to mount CIFS shares. That's why + you should also enable the "Use super user privileges to mount and unmount + shares" option under Settings->Configure Smb4K...->Super User->Actions. + + +Q: Smb4K fails unmounting a share. The error message is: + + Could not unmount /mount/point: Device or resource busy + + How can I make unmounting work? + +A: First of all, check that you haven't opened the mount point or one of its + subdirectories in a shell or with a file manager. Also, make sure you + haven't opened any file belonging to the share. If neither is the case, + you might have encountered a problem, that is known but not related to + Smb4K. It seems, that under certain circumstances (that we could not + figure out exactly) kdeinit (KDE < 3.4) background processes access files + and/or directories of the share and keep them open. Unmounting is not + possible unless you send + + $ kill -HUP + + to each kdeinit instance that has access to the share or its files. + + Alternatively, you can force the unmounting of the share. Highlight the + share and use the Shares->Force Unmounting menu item or press Ctrl+F. + + +Q: I'm using sudo and the CIFS file system. Everytime I want to mount a share + (from a Windows 2003 server), I get the following error: + + mount error 13 = Permission denied + Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) + + What can I do to make mounting work? + +A: It is very possible, that the 'env_reset' flag has been set in the + /etc/sudoers file (It's the default in Gentoo for example.), which + resets the environment to only contain a limited number of environment + variables. Especially, the PASSWD variable is removed which is needed by + Smb4K. + + To make mounting work, there are three things you should try alternatively: + - Insert manually the following line after the line beginning with + "User_Alias SMB4KUSERS": + Defaults:SMB4KUSERS env_keep=PASSWD + This should be the preferred method on a multi-user system. + - Remove the Smb4K user entries from /etc/sudoers manually or using + Smb4K and rewrite them (Smb4K >= 0.6.4). + - Comment out the 'env_reset' variable (not recommended). + + If you are still not able to mount a share, please file a bug report. + + +Miscellaneous +------------- + +Q: I'm using Smb4K 0.4.x. After starting it, I cannot see the main window. + Is this a bug? + +A: No. This is a special behavior of the 0.4.x series, which was changed in + later releases. Smb4K 0.4.x immediately docks to the system tray. You'll + find an icon there with which you can bring up the main window. Restoring + the visible main window after logging in will not work. + + +Q: I want to use super to mount and unmount the shares. When I try to enable + either "Use super user privileges to force the unmounting of (broken) + shares" or "Use super user privileges to mount and unmount shares", Smb4K + complains that it cannot find the super.tab file. What do I have to do? + +A: Create the super.tab file in the appropriate etc directory. Therefore + change into it (most likely /etc (Linux) or /usr/local/etc (FreeBSD)) and + run + + $ touch super.tab && chmod 0644 super.tab + + as root. Smb4K will take care of the rest. + + +Q: After installing Smb4K, I wanted to take advantage of the Konqueror + plugin but I couldn't find it. What do I have to do? + +A: Right-click on the frame of Konqueror's navigation widget and choose + Add New->Samba Browser from the menu. The Konqueror plugin will be + added. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..02a4a07 --- /dev/null +++ b/INSTALL @@ -0,0 +1,167 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..ddfca88 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,21 @@ +if compile_konqplugin + PLUGINDIR=plugin +endif + +EXTRA_DIST = admin AUTHORS COPYING ChangeLog INSTALL README TODO smb4k.lsm BUGS FAQ + +AUTOMAKE_OPTIONS = foreign 1.5 + +MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files + +package-messages: + $(MAKE) -f admin/Makefile.common package-messages + $(MAKE) -C po merge + +#include admin/deps.am + +SUBDIRS = smb4k $(PLUGINDIR) utilities po doc + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) `find . -name \*.cpp` -o $(podir)/smb4k.pot diff --git a/Makefile.cvs b/Makefile.cvs new file mode 100644 index 0000000..be59a86 --- /dev/null +++ b/Makefile.cvs @@ -0,0 +1,14 @@ +all: + @echo "This Makefile is only for the CVS repository" + @echo "This will be deleted before making the distribution" + @echo "" + @if test ! -d admin; then \ + echo "Please recheckout this module!" ;\ + echo "for cvs: use checkout once and after that update again" ;\ + echo "for cvsup: checkout kde-common from cvsup and" ;\ + echo " link kde-common/admin to ./admin" ;\ + exit 1 ;\ + fi + $(MAKE) -f admin/Makefile.common cvs + +.SILENT: diff --git a/README b/README new file mode 100644 index 0000000..4fa224f --- /dev/null +++ b/README @@ -0,0 +1,168 @@ +Smb4K README (version 0.9.x) +============================ + +Smb4K is an SMB/CIFS share browser for KDE. It uses the Samba software suite to +access the SMB/CIFS shares of the local network neighborhood. Its purpose is to +provide a program that's easy to use and has as many features as possible. + +Features: +--------- +- Scanning for (active) workgroups, hosts, and shares +- Mounting and unmounting of SMB/CIFS shares, including unmounting all shares + at once +- Access to the files of a mounted SMB/CIFS share using Konqueror +- Auto-detection of external mounts/unmounts +- Mounting of recently used shares on start-up +- Miscellaneous infos about the SMB/CIFS shares +- Network search +- WINS server support +- Preview of SMB/CIFS shares +- Selectable look-up and search methods +- Default login +- Ability to execute mount and umount SUID root +- Special handling of homes shares +- Ability to bookmark favorite shares +- System tray icon +- Support of advanced Samba options +- Support of printer shares +- Konqueror plugin +- KWallet support +- Synchronization of a remote share with a local copy and vice versa +- Ability to define custom options for individual servers and shares + +Translations: +------------- +For the list of currently supported translations please visit Smb4K's home page +at http://smb4k.berlios.de/information.html. + +Supported operating systems: +---------------------------- +Smb4K officially supports Linux (kernel >= 2.2.x) and since version 0.4.1 also +FreeBSD (>= 4.10-RELEASE). Smb4K might also run on other operating system (e.g. +Solaris). + +Requirements: +------------- +This version of Smb4K depends on the development files of the following +libraries: +- KDE Libs & Base (>= 3.3.0): The powerful Open Source graphical desktop + environment for Unix workstations [http://www.kde.org] +- Qt (>= 3.3.0): A multiplatform C++ application development framework. + [http://www.trolltech.no] +- X.org or XFree86 - Freely redistributable implementations of the X Window + System [http://www.x.org or http://www.xfree86.org] +- An implementation of the C library + +Make sure that you also have installed all header files of the libraries Qt +and KDE are depending on. Recent versions of automake and autoconf are also +needed. + +For a proper operation, you implicitly need: +- Support of the /proc filesystem compiled into your kernel if you are using + Linux +- A sh-compatible shell (bash, dash, ash, etc.) with an existing link /bin/sh + or the sh shell itself. +- Samba (3.x) - Tools to access to a server's filespace and printers via + SMB [http://www.samba.org] +- grep - GNU grep [http://www.gnu.org/directory/grep.html] +- GNU awk (GAWK) or similar - A pattern scanning and processing language. + [http://www.gnu.org/directory/gawk.html] +- sed - The GNU stream editor [http://www.gnu.org/directory/sed.html] +- findutils (xargs) - The GNU Find Utilities are the basic directory searching + utilities of the GNU operating system + [http://www.gnu.org/directory/findutils.html] +- util-linux (mount, umount) - Miscellaneous system utilities + [ftp://ftp.kernel.org/pub/linux/utils/util-linux] + +To enable full functionality, you may also want to install these packages: +- super or sudo - Programs to allow general users to do superuser things + [ftp://ftp.ucolick.org/pub/users/will/ or http://www.sudo.ws/sudo/] +- teTeX or similar (dvips) - A TeX distribution for Unix + [http://tug.org/teTeX/] +- GNU enscript - A tool to convert ASCII files to PostScript + [http://people.ssh.fi/mtr/genscript/] +- rsync - A file transfer program to keep (remote) files in sync + [http://rsync.samba.org/] + +Compilation and Installation +---------------------------- +(a) Full installation: + +1. Change into the root directory of the source code: + $ cd smb4k-x.x.x + (Replace x.x.x with the version number) +2. Configure the source code with at least the following command + $ ./configure --prefix=`kde-config --prefix` + Several more options can be added. Run + $ ./configure --help + to find out which ones are available. +3. Compile the source code: + $ make +4. Install the application. For that, become root + $ su + and run + $ make install + in the root directory of the source code. If you want to be able to + remove Smb4K with your package manager, install the 'checkinstall' + package and run + $ checkinstall + instead. + +(b) Installation without Konqueror plugin: + +Those of you, who do not use KDE or who do not wish to install the Konqueror +plugin, should run this configure command + $ ./configure --prefix=`kde-config --prefix` --without-konqplugin +instead of the one mentioned above and else proceed as described. + +Additional information about compiling and installing the software is available +in the INSTALL file. + +Debugging the Source Code +------------------------- +If you experience crashes or similar and want to debug the source code yourself, +compile the source code with debugging symbols. The procedure is similar to the +one described in the "Compilation and Installation" section above except that +you need to modify the configure command slightly: + $ ./configure --prefix=`kde-config --prefix` --enable-debug=full +Now compile and install the program as stated above. If you do not want to +install but only debug the newly compiled program, you may execute Smb4K from +within the source code directory. Change into the 'smb4k' subdirectory and run: + $ ./smb4k --nofork +If you found the cause for a bug, please let us know. A backtrace or a patch +will be much appreciated. + +Help and Support +---------------- +If you encounter problems when using Smb4K and need help or support, please +read the 'Trouble Shooting' section of the handbook first. You can access the +handbook from the 'Help' menu by selecting the 'Smb4K Handbook' entry or by +pressing the F1 key. An online version handbook is also available at +http://smb4k.berlios.de/handbook/index.html. Most of the common problems that +arise when working with Smb4K are already covered there. If that's not the +case, we recommend that you contact the Smb4K-general mailing list at +https://lists.berlios.de/mailman/listinfo/smb4k-general to get help. Some of +the developers and many users are subscribed and can help. + +Bugs +---- +You are strongly encouraged to send a bug report to +http://developer.berlios.de/bugs/?group_id=769, if you find a problem. Please +do not forget to include information about the version of Smb4K and the +operating system you are using (Linux or FreeBSD). It might also help if you +mention the distribution you have installed (Linux). +If you experienced a crash, we would appreciate if you sent us the backtrace, +i.e. the output provided by KDE's crash dialog. Please see the section "Debug- +ging the Source Code" for a description how to make sure useful debugging output +is returned. + +Copyright +--------- +Smb4K is released under the terms of the GNU General Public License (GPL), +version 2. A copy of the license is available in the file COPYING. + +Latest Version +-------------- +The latest stable version of Smb4K is always available from the Smb4K home page +at http://smb4k.berlios.de. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..956dbae --- /dev/null +++ b/TODO @@ -0,0 +1,65 @@ +TODO list: + +for 0.10.x: +- Make Smb4K a KDE4 program. +- Move to cmake. +- Use KConfigSkeletonItem::label() in the config dialog instead of the strings + present at the moment. +- Replace getenv( "USER" ) cuserid(). Use something like the following code + snippet: + + char cu[L_cuserid]; + user = QString::fromLocal8Bit( cuserid( cu ), -1 ); + + or + + user = QString::fromLocal8Bit( cuserid( NULL ), -1 ); // returning static pointer + +- Move smb4k/core subdirectory to the root directory of the source. +- Rename libsmb4kcore to libsmb4k? +- Make authentication entries accessible and editable through the configuration + dialog. +- Revise how Smb4K handles authentication data. +- Improve search? We want to be able to find *shares* (use smbtree). Maybe we + could also implement mounting. +- Move the GPL v3? +- If "default" options have been defined for Samba commands, they should not + appear in the command. +- Don't save information about foreign shares and about shares that only + use default values in ~/.kde/share/apps/smb4k/custom_options file. +- Rewrite Smb4KSambaOptionsHandler::netOptions(). +- Allow more than one file manager. +- Implement scripting functionality (D-BUS/DCOP(?)). +- Add command line options (--no-tray-widget, --minimal, etc.) +- Move Smb4KWorkgroupItem, Smb4KHostItem, and Smb4KShareItem into own files. + Maybe rename them. +- Merge Smb4KShare and Smb4KShareItem. Add IP address and host. +- Save IP address with the information that's needed to remount a share. +- Use plain system functions to read /proc/mounts. This hopefully will lead + to lower CPU usage. +- Add the ability to define the file system for all shares of a server through + the "Custom Options" dialog. +- Open with different file managers: dolphin, thunar (XFCE), nautilus (GNOME), + ... + +Deferred: +- Introduce a smb4k:/ kio slave? +- Support SELinux. +- Make it configurable if the workgroup master browser should be queried + to retrieve the comment etc. for a host or not when using the IP scan + method. +- Smb4KMounter: + + The functions of the mounter should only take Smb4KShare objects where + possible. + + Smb4KMounter::mountShare() should take an Smb4KShareItem object (we have + to add Smb4KShareItem::m_ip, etc., for that). +- Remove SMBFS support as soon as it is removed from the kernel. +- Add possibility to download files and directories from the preview dialog. +- Add support for multiple port declarations in smb.conf (How?). +- Add eyecandy: If the mouse is over an icon, show it as active. Use KDE + settings (KControl). +- Use setGrid[XY]() in Smb4KShareWidget to dynamically adjust the item size + in list mode. +- Implement more 'net' commands. Especially the 'rpc shutdown' command seems + to be very nice. +- Allow multiple sync instances (remove synchronizer from Smb4KCore?). diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..e29977a --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,11919 @@ +## -*- autoconf -*- + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) +dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301, USA. + +dnl IMPORTANT NOTE: +dnl Please do not modify this file unless you expect your modifications to be +dnl carried into every other module in the repository. +dnl +dnl Single-module modifications are best placed in configure.in for kdelibs +dnl and kdebase or configure.in.in if present. + +# KDE_PATH_X_DIRECT +dnl Internal subroutine of AC_PATH_X. +dnl Set ac_x_includes and/or ac_x_libraries. +AC_DEFUN([KDE_PATH_X_DIRECT], +[ +AC_REQUIRE([KDE_CHECK_LIB64]) + +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. +AC_TRY_CPP([#include <$x_direct_test_include>], +[# We can compile using X headers with no special include directory. +ac_x_includes=], +[# Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done]) +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" +AC_TRY_LINK([#include ], [${x_direct_test_function}(1)], +[LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries=], +[LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \ + /usr/X11/lib${kdelibsuff} \ + /usr/X11R6/lib${kdelibsuff} \ + /usr/X11R5/lib${kdelibsuff} \ + /usr/X11R4/lib${kdelibsuff} \ + \ + /usr/lib${kdelibsuff}/X11 \ + /usr/lib${kdelibsuff}/X11R6 \ + /usr/lib${kdelibsuff}/X11R5 \ + /usr/lib${kdelibsuff}/X11R4 \ + \ + /usr/local/X11/lib${kdelibsuff} \ + /usr/local/X11R6/lib${kdelibsuff} \ + /usr/local/X11R5/lib${kdelibsuff} \ + /usr/local/X11R4/lib${kdelibsuff} \ + \ + /usr/local/lib${kdelibsuff}/X11 \ + /usr/local/lib${kdelibsuff}/X11R6 \ + /usr/local/lib${kdelibsuff}/X11R5 \ + /usr/local/lib${kdelibsuff}/X11R4 \ + \ + /usr/X386/lib${kdelibsuff} \ + /usr/x386/lib${kdelibsuff} \ + /usr/XFree86/lib${kdelibsuff}/X11 \ + \ + /usr/lib${kdelibsuff} \ + /usr/local/lib${kdelibsuff} \ + /usr/unsupported/lib${kdelibsuff} \ + /usr/athena/lib${kdelibsuff} \ + /usr/local/x11r5/lib${kdelibsuff} \ + /usr/lpp/Xamples/lib${kdelibsuff} \ + /lib/usr/lib${kdelibsuff}/X11 \ + \ + /usr/openwin/lib${kdelibsuff} \ + /usr/openwin/share/lib${kdelibsuff} \ + ; \ +do +dnl Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done]) +fi # $ac_x_libraries = NO +]) + + +dnl ------------------------------------------------------------------------ +dnl Find a file (or one of more files in a list of dirs) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_FIND_FILE], +[ +$3=NO +for i in $2; +do + for j in $1; + do + echo "configure: __oline__: $i/$j" >&AC_FD_CC + if test -r "$i/$j"; then + echo "taking that" >&AC_FD_CC + $3=$i + break 2 + fi + done +done +]) + +dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs, +dnl if-not-found, test-parameter, prepend-path) +dnl +dnl Look for program-name in list-of-dirs+$PATH. +dnl If prepend-path is set, look in $PATH+list-of-dirs instead. +dnl If found, $variable-name is set. If not, if-not-found is evaluated. +dnl test-parameter: if set, the program is executed with this arg, +dnl and only a successful exit code is required. +AC_DEFUN([KDE_FIND_PATH], +[ + AC_MSG_CHECKING([for $1]) + if test -n "$$2"; then + kde_cv_path="$$2"; + else + kde_cache=`echo $1 | sed 'y%./+-%__p_%'` + + AC_CACHE_VAL(kde_cv_path_$kde_cache, + [ + kde_cv_path="NONE" + kde_save_IFS=$IFS + IFS=':' + dirs="" + for dir in $PATH; do + dirs="$dirs $dir" + done + if test -z "$6"; then dnl Append dirs in PATH (default) + dirs="$3 $dirs" + else dnl Prepend dirs in PATH (if 6th arg is set) + dirs="$dirs $3" + fi + IFS=$kde_save_IFS + + for dir in $dirs; do + if test -x "$dir/$1"; then + if test -n "$5" + then + evalstr="$dir/$1 $5 2>&1 " + if eval $evalstr; then + kde_cv_path="$dir/$1" + break + fi + else + kde_cv_path="$dir/$1" + break + fi + fi + done + + eval "kde_cv_path_$kde_cache=$kde_cv_path" + + ]) + + eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" + + fi + + if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then + AC_MSG_RESULT(not found) + $4 + else + AC_MSG_RESULT($kde_cv_path) + $2=$kde_cv_path + + fi +]) + +AC_DEFUN([KDE_MOC_ERROR_MESSAGE], +[ + AC_MSG_ERROR([No Qt meta object compiler (moc) found! +Please check whether you installed Qt correctly. +You need to have a running moc binary. +configure tried to run $ac_cv_path_moc and the test didn't +succeed. If configure shouldn't have tried this one, set +the environment variable MOC to the right one before running +configure. +]) +]) + +AC_DEFUN([KDE_UIC_ERROR_MESSAGE], +[ + AC_MSG_WARN([No Qt ui compiler (uic) found! +Please check whether you installed Qt correctly. +You need to have a running uic binary. +configure tried to run $ac_cv_path_uic and the test didn't +succeed. If configure shouldn't have tried this one, set +the environment variable UIC to the right one before running +configure. +]) +]) + + +AC_DEFUN([KDE_CHECK_UIC_FLAG], +[ + AC_MSG_CHECKING([whether uic supports -$1 ]) + kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` + AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache, + [ + cat >conftest.ui < +EOT + ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null" + if AC_TRY_EVAL(ac_uic_testrun); then + eval "kde_cv_prog_uic_$kde_cache=yes" + else + eval "kde_cv_prog_uic_$kde_cache=no" + fi + rm -f conftest* + ]) + + if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then + AC_MSG_RESULT([yes]) + : + $3 + else + AC_MSG_RESULT([no]) + : + $4 + fi +]) + + +dnl ------------------------------------------------------------------------ +dnl Find the meta object compiler and the ui compiler in the PATH, +dnl in $QTDIR/bin, and some more usual places +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_PATH_QT_MOC_UIC], +[ + AC_REQUIRE([KDE_CHECK_PERL]) + qt_bindirs="" + for dir in $kde_qt_dirs; do + qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc" + done + qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin" + if test ! "$ac_qt_bindir" = "NO"; then + qt_bindirs="$ac_qt_bindir $qt_bindirs" + fi + + KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE]) + if test -z "$UIC_NOT_NEEDED"; then + KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""]) + if test -z "$UIC_PATH" ; then + KDE_UIC_ERROR_MESSAGE + exit 1 + else + UIC=$UIC_PATH + + if test $kde_qtver = 3; then + KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no) + KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no) + + if test x$ac_uic_supports_libpath = xyes; then + UIC="$UIC -L \$(kde_widgetdir)" + fi + if test x$ac_uic_supports_nounload = xyes; then + UIC="$UIC -nounload" + fi + fi + fi + else + UIC="echo uic not available: " + fi + + AC_SUBST(MOC) + AC_SUBST(UIC) + + UIC_TR="i18n" + if test $kde_qtver = 3; then + UIC_TR="tr2i18n" + fi + + AC_SUBST(UIC_TR) +]) + +AC_DEFUN([KDE_1_CHECK_PATHS], +[ + KDE_1_CHECK_PATH_HEADERS + + KDE_TEST_RPATH= + + if test -n "$USE_RPATH"; then + + if test -n "$kde_libraries"; then + KDE_TEST_RPATH="-R $kde_libraries" + fi + + if test -n "$qt_libraries"; then + KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries" + fi + + if test -n "$x_libraries"; then + KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries" + fi + + KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH" + fi + +AC_MSG_CHECKING([for KDE libraries installed]) +ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5' + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + AC_MSG_RESULT(yes) +else + AC_MSG_ERROR([your system fails at linking a small KDE application! +Check, if your compiler is installed correctly and if you have used the +same compiler to compile Qt and kdelibs as you did use now. +For more details about this problem, look at the end of config.log.]) +fi + +if eval `KDEDIR= ./conftest 2>&5`; then + kde_result=done +else + kde_result=problems +fi + +KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log +kde_have_all_paths=yes + +KDE_SET_PATHS($kde_result) + +]) + +AC_DEFUN([KDE_SET_PATHS], +[ + kde_cv_all_paths="kde_have_all_paths=\"yes\" \ + kde_htmldir=\"$kde_htmldir\" \ + kde_appsdir=\"$kde_appsdir\" \ + kde_icondir=\"$kde_icondir\" \ + kde_sounddir=\"$kde_sounddir\" \ + kde_datadir=\"$kde_datadir\" \ + kde_locale=\"$kde_locale\" \ + kde_cgidir=\"$kde_cgidir\" \ + kde_confdir=\"$kde_confdir\" \ + kde_kcfgdir=\"$kde_kcfgdir\" \ + kde_mimedir=\"$kde_mimedir\" \ + kde_toolbardir=\"$kde_toolbardir\" \ + kde_wallpaperdir=\"$kde_wallpaperdir\" \ + kde_templatesdir=\"$kde_templatesdir\" \ + kde_bindir=\"$kde_bindir\" \ + kde_servicesdir=\"$kde_servicesdir\" \ + kde_servicetypesdir=\"$kde_servicetypesdir\" \ + kde_moduledir=\"$kde_moduledir\" \ + kde_styledir=\"$kde_styledir\" \ + kde_widgetdir=\"$kde_widgetdir\" \ + xdg_appsdir=\"$xdg_appsdir\" \ + xdg_menudir=\"$xdg_menudir\" \ + xdg_directorydir=\"$xdg_directorydir\" \ + kde_result=$1" +]) + +AC_DEFUN([KDE_SET_DEFAULT_PATHS], +[ +if test "$1" = "default"; then + + if test -z "$kde_htmldir"; then + kde_htmldir='\${datadir}/doc/HTML' + fi + if test -z "$kde_appsdir"; then + kde_appsdir='\${datadir}/applnk' + fi + if test -z "$kde_icondir"; then + kde_icondir='\${datadir}/icons' + fi + if test -z "$kde_sounddir"; then + kde_sounddir='\${datadir}/sounds' + fi + if test -z "$kde_datadir"; then + kde_datadir='\${datadir}/apps' + fi + if test -z "$kde_locale"; then + kde_locale='\${datadir}/locale' + fi + if test -z "$kde_cgidir"; then + kde_cgidir='\${exec_prefix}/cgi-bin' + fi + if test -z "$kde_confdir"; then + kde_confdir='\${datadir}/config' + fi + if test -z "$kde_kcfgdir"; then + kde_kcfgdir='\${datadir}/config.kcfg' + fi + if test -z "$kde_mimedir"; then + kde_mimedir='\${datadir}/mimelnk' + fi + if test -z "$kde_toolbardir"; then + kde_toolbardir='\${datadir}/toolbar' + fi + if test -z "$kde_wallpaperdir"; then + kde_wallpaperdir='\${datadir}/wallpapers' + fi + if test -z "$kde_templatesdir"; then + kde_templatesdir='\${datadir}/templates' + fi + if test -z "$kde_bindir"; then + kde_bindir='\${exec_prefix}/bin' + fi + if test -z "$kde_servicesdir"; then + kde_servicesdir='\${datadir}/services' + fi + if test -z "$kde_servicetypesdir"; then + kde_servicetypesdir='\${datadir}/servicetypes' + fi + if test -z "$kde_moduledir"; then + if test "$kde_qtver" = "2"; then + kde_moduledir='\${libdir}/kde2' + else + kde_moduledir='\${libdir}/kde3' + fi + fi + if test -z "$kde_styledir"; then + kde_styledir='\${libdir}/kde3/plugins/styles' + fi + if test -z "$kde_widgetdir"; then + kde_widgetdir='\${libdir}/kde3/plugins/designer' + fi + if test -z "$xdg_appsdir"; then + xdg_appsdir='\${datadir}/applications/kde' + fi + if test -z "$xdg_menudir"; then + xdg_menudir='\${sysconfdir}/xdg/menus' + fi + if test -z "$xdg_directorydir"; then + xdg_directorydir='\${datadir}/desktop-directories' + fi + + KDE_SET_PATHS(defaults) + +else + + if test $kde_qtver = 1; then + AC_MSG_RESULT([compiling]) + KDE_1_CHECK_PATHS + else + AC_MSG_ERROR([path checking not yet supported for KDE 2]) + fi + +fi +]) + +AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS], +[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" || + test -z "$kde_icondir" || test -z "$kde_sounddir" || + test -z "$kde_datadir" || test -z "$kde_locale" || + test -z "$kde_cgidir" || test -z "$kde_confdir" || + test -z "$kde_kcfgdir" || + test -z "$kde_mimedir" || test -z "$kde_toolbardir" || + test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" || + test -z "$kde_bindir" || test -z "$kde_servicesdir" || + test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" || + test -z "$kde_styledir" || test -z "kde_widgetdir" || + test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" || + test "x$kde_have_all_paths" != "xyes"; then + kde_have_all_paths=no + fi +]) + +AC_DEFUN([KDE_MISSING_PROG_ERROR], +[ + AC_MSG_ERROR([The important program $1 was not found! +Please check whether you installed KDE correctly. +]) +]) + +AC_DEFUN([KDE_MISSING_ARTS_ERROR], +[ + AC_MSG_ERROR([The important program $1 was not found! +Please check whether you installed aRts correctly or use +--without-arts to compile without aRts support (this will remove functionality). +]) +]) + +AC_DEFUN([KDE_SET_DEFAULT_BINDIRS], +[ + kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin" + test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs" + if test -n "$KDEDIRS"; then + kde_save_IFS=$IFS + IFS=: + for dir in $KDEDIRS; do + kde_default_bindirs="$dir/bin $kde_default_bindirs " + done + IFS=$kde_save_IFS + fi +]) + +AC_DEFUN([KDE_SUBST_PROGRAMS], +[ + AC_ARG_WITH(arts, + AC_HELP_STRING([--without-arts],[build without aRts [default=no]]), + [build_arts=$withval], + [build_arts=yes] + ) + AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no") + if test "$build_arts" = "no"; then + AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts]) + fi + + KDE_SET_DEFAULT_BINDIRS + kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs" + KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)]) + KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)]) + if test "$build_arts" '!=' "no"; then + KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)]) + KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)]) + fi + KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs]) + + kde32ornewer=1 + kde33ornewer=1 + if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then + kde32ornewer= + kde33ornewer= + else + if test "$kde_qtver" = "3"; then + if test "$kde_qtsubver" -le 1; then + kde32ornewer= + fi + if test "$kde_qtsubver" -le 2; then + kde33ornewer= + fi + if test "$KDECONFIG" != "compiled"; then + if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then + kde33ornewer= + fi + fi + fi + fi + + if test -n "$kde32ornewer"; then + KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)]) + KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)]) + fi + if test -n "$kde33ornewer"; then + KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)]) + AC_SUBST(MAKEKDEWIDGETS) + fi + KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""]) + + if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then + kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share" + test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs" + AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET) + if test "$KDE_XSL_STYLESHEET" = "NO"; then + KDE_XSL_STYLESHEET="" + else + KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl" + fi + fi + + DCOP_DEPENDENCIES='$(DCOPIDL)' + if test -n "$kde32ornewer"; then + KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)' + DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)' + AC_SUBST(KCONFIG_COMPILER) + AC_SUBST(KCFG_DEPENDENCIES) + AC_SUBST(DCOPIDLNG) + fi + AC_SUBST(DCOPIDL) + AC_SUBST(DCOPIDL2CPP) + AC_SUBST(DCOP_DEPENDENCIES) + AC_SUBST(MCOPIDL) + AC_SUBST(ARTSCCONFIG) + AC_SUBST(MEINPROC) + AC_SUBST(KDE_XSL_STYLESHEET) + AC_SUBST(XMLLINT) +])dnl + +AC_DEFUN([AC_CREATE_KFSSTND], +[ +AC_REQUIRE([AC_CHECK_RPATH]) + +AC_MSG_CHECKING([for KDE paths]) +kde_result="" +kde_cached_paths=yes +AC_CACHE_VAL(kde_cv_all_paths, +[ + KDE_SET_DEFAULT_PATHS($1) + kde_cached_paths=no +]) +eval "$kde_cv_all_paths" +KDE_CHECK_PATHS_FOR_COMPLETENESS +if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then + # wrong values were cached, may be, we can set better ones + kde_result= + kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir= + kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir= + kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir= + kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir= + kde_have_all_paths= + kde_styledir= + kde_widgetdir= + xdg_appsdir = xdg_menudir= xdg_directorydir= + KDE_SET_DEFAULT_PATHS($1) + eval "$kde_cv_all_paths" + KDE_CHECK_PATHS_FOR_COMPLETENESS + kde_result="$kde_result (cache overridden)" +fi +if test "$kde_have_all_paths" = "no"; then + AC_MSG_ERROR([configure could not run a little KDE program to test the environment. +Since it had compiled and linked before, it must be a strange problem on your system. +Look at config.log for details. If you are not able to fix this, look at +http://www.kde.org/faq/installation.html or any www.kde.org mirror. +(If you're using an egcs version on Linux, you may update binutils!) +]) +else + rm -f conftest* + AC_MSG_RESULT($kde_result) +fi + +bindir=$kde_bindir + +KDE_SUBST_PROGRAMS + +]) + +AC_DEFUN([AC_SUBST_KFSSTND], +[ +AC_SUBST(kde_htmldir) +AC_SUBST(kde_appsdir) +AC_SUBST(kde_icondir) +AC_SUBST(kde_sounddir) +AC_SUBST(kde_datadir) +AC_SUBST(kde_locale) +AC_SUBST(kde_confdir) +AC_SUBST(kde_kcfgdir) +AC_SUBST(kde_mimedir) +AC_SUBST(kde_wallpaperdir) +AC_SUBST(kde_bindir) +dnl X Desktop Group standards +AC_SUBST(xdg_appsdir) +AC_SUBST(xdg_menudir) +AC_SUBST(xdg_directorydir) +dnl for KDE 2 +AC_SUBST(kde_templatesdir) +AC_SUBST(kde_servicesdir) +AC_SUBST(kde_servicetypesdir) +AC_SUBST(kde_moduledir) +AC_SUBST(kdeinitdir, '$(kde_moduledir)') +AC_SUBST(kde_styledir) +AC_SUBST(kde_widgetdir) +if test "$kde_qtver" = 1; then + kde_minidir="$kde_icondir/mini" +else +# for KDE 1 - this breaks KDE2 apps using minidir, but +# that's the plan ;-/ + kde_minidir="/dev/null" +fi +dnl AC_SUBST(kde_minidir) +dnl AC_SUBST(kde_cgidir) +dnl AC_SUBST(kde_toolbardir) +]) + +AC_DEFUN([KDE_MISC_TESTS], +[ + dnl Checks for libraries. + AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD + AC_SUBST(LIBUTIL) + AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD + AC_SUBST(LIBCOMPAT) + kde_have_crypt= + AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes], + AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [ + AC_MSG_WARN([you have no crypt in either libcrypt or libc. +You should install libcrypt from another source or configure with PAM +support]) + kde_have_crypt=no + ])) + AC_SUBST(LIBCRYPT) + if test $kde_have_crypt = yes; then + AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) + fi + AC_CHECK_SOCKLEN_T + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + AC_CHECK_LIB(dnet_stub, dnet_ntoa, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + fi + AC_CHECK_FUNC(inet_ntoa) + if test $ac_cv_func_inet_ntoa = no; then + AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") + fi + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , + $X_EXTRA_LIBS) + fi + + AC_CHECK_FUNC(remove) + if test $ac_cv_func_remove = no; then + AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + AC_CHECK_FUNC(shmat, , + AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")) + + # more headers that need to be explicitly included on darwin + AC_CHECK_HEADERS(sys/types.h stdint.h) + + # sys/bitypes.h is needed for uint32_t and friends on Tru64 + AC_CHECK_HEADERS(sys/bitypes.h) + + # darwin requires a poll emulation library + AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll") + + # for some image handling on Mac OS X + AC_CHECK_HEADERS(Carbon/Carbon.h) + + # CoreAudio framework + AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [ + AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API]) + FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio" + ]) + + AC_CHECK_RES_INIT + AC_SUBST(LIB_POLL) + AC_SUBST(FRAMEWORK_COREAUDIO) + LIBSOCKET="$X_EXTRA_LIBS" + AC_SUBST(LIBSOCKET) + AC_SUBST(X_EXTRA_LIBS) + AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4 + AC_SUBST(LIBUCB) + + case $host in dnl this *is* LynxOS specific + *-*-lynxos* ) + AC_MSG_CHECKING([LynxOS header file wrappers]) + [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"] + AC_MSG_RESULT(disabled) + AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS + ;; + esac + + KDE_CHECK_TYPES + KDE_CHECK_LIBDL + KDE_CHECK_STRLCPY + KDE_CHECK_PIE_SUPPORT + +# darwin needs this to initialize the environment +AC_CHECK_HEADERS(crt_externs.h) +AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])]) + +AH_VERBATIM(_DARWIN_ENVIRON, +[ +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif +]) + +AH_VERBATIM(_AIX_STRINGS_H_BZERO, +[ +/* + * AIX defines FD_SET in terms of bzero, but fails to include + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif +]) + +AC_CHECK_FUNCS([vsnprintf snprintf]) + +AH_VERBATIM(_TRU64,[ +/* + * On HP-UX, the declaration of vsnprintf() is needed every time ! + */ + +#if !defined(HAVE_VSNPRINTF) || defined(hpux) +#if __STDC__ +#include +#include +#else +#include +#endif +#ifdef __cplusplus +extern "C" +#endif +int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#ifdef __cplusplus +extern "C" +#endif +int snprintf(char *str, size_t n, char const *fmt, ...); +#endif +]) + +]) + +dnl ------------------------------------------------------------------------ +dnl Find the header files and libraries for X-Windows. Extended the +dnl macro AC_PATH_X +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([K_PATH_X], +[ +AC_REQUIRE([KDE_MISC_TESTS])dnl +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_ARG_ENABLE( + embedded, + AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]), + kde_use_qt_emb=$enableval, + kde_use_qt_emb=no +) + +AC_ARG_ENABLE( + qtopia, + AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]), + kde_use_qt_emb_palm=$enableval, + kde_use_qt_emb_palm=no +) + +AC_ARG_ENABLE( + mac, + AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]), + kde_use_qt_mac=$enableval, + kde_use_qt_mac=no +) + +# used to disable x11-specific stuff on special platforms +AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no") + +if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then + +AC_MSG_CHECKING(for X) + +AC_CACHE_VAL(kde_cv_have_x, +[# One or both of the vars are not set, and there is no cached value. +if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then + kde_x_includes=NO +else + kde_x_includes=$x_includes +fi +if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then + kde_x_libraries=NO +else + kde_x_libraries=$x_libraries +fi + +# below we use the standard autoconf calls +ac_x_libraries=$kde_x_libraries +ac_x_includes=$kde_x_includes + +KDE_PATH_X_DIRECT +dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries. +dnl Unfortunately, if compiling with the N32 ABI, this is not the correct +dnl location. The correct location is /usr/lib32 or an undefined value +dnl (the linker is smart enough to pick the correct default library). +dnl Things work just fine if you use just AC_PATH_X_DIRECT. +dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to +dnl /usr/openwin/include, which doesn't work. /usr/include does work, so +dnl x_includes should be left alone. +case "$host" in +mips-sgi-irix6*) + ;; +*-*-solaris*) + ;; +*) + _AC_PATH_X_XMKMF + if test -z "$ac_x_includes"; then + ac_x_includes="." + fi + if test -z "$ac_x_libraries"; then + ac_x_libraries="/usr/lib${kdelibsuff}" + fi +esac +#from now on we use our own again + +# when the user already gave --x-includes, we ignore +# what the standard autoconf macros told us. +if test "$kde_x_includes" = NO; then + kde_x_includes=$ac_x_includes +fi + +# for --x-libraries too +if test "$kde_x_libraries" = NO; then + kde_x_libraries=$ac_x_libraries +fi + +if test "$kde_x_includes" = NO; then + AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) +fi + +if test "$kde_x_libraries" = NO; then + AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!]) +fi + +# Record where we found X for the cache. +kde_cv_have_x="have_x=yes \ + kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries" +])dnl + +eval "$kde_cv_have_x" + +if test "$have_x" != yes; then + AC_MSG_RESULT($have_x) + no_x=yes +else + AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes]) +fi + +if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then + X_INCLUDES="" + x_includes="."; dnl better than nothing :- + else + x_includes=$kde_x_includes + X_INCLUDES="-I$x_includes" +fi + +if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then + X_LDFLAGS="" + x_libraries="/usr/lib"; dnl better than nothing :- + else + x_libraries=$kde_x_libraries + X_LDFLAGS="-L$x_libraries" +fi +all_includes="$X_INCLUDES" +all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS" + +# Check for libraries that X11R6 Xt/Xaw programs need. +ac_save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $X_LDFLAGS" +# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to +# check for ICE first), but we must link in the order -lSM -lICE or +# we get undefined symbols. So assume we have SM if we have ICE. +# These have to be linked with before -lX11, unlike the other +# libraries we check for below, so use a different variable. +# --interran@uluru.Stanford.EDU, kb@cs.umb.edu. +AC_CHECK_LIB(ICE, IceConnectionNumber, + [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS) +LDFLAGS="$ac_save_LDFLAGS" + +LIB_X11='-lX11 $(LIBSOCKET)' + +AC_MSG_CHECKING(for libXext) +AC_CACHE_VAL(kde_cv_have_libXext, +[ +kde_ldflags_safe="$LDFLAGS" +kde_libs_safe="$LIBS" + +LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS" +LIBS="-lXext -lX11 $LIBSOCKET" + +AC_TRY_LINK([ +#include +#ifdef STDC_HEADERS +# include +#endif +], +[ +printf("hello Xext\n"); +], +kde_cv_have_libXext=yes, +kde_cv_have_libXext=no +) + +LDFLAGS=$kde_ldflags_safe +LIBS=$kde_libs_safe +]) + +AC_MSG_RESULT($kde_cv_have_libXext) + +if test "$kde_cv_have_libXext" = "no"; then + AC_MSG_ERROR([We need a working libXext to proceed. Since configure +can't find it itself, we stop here assuming that make wouldn't find +them either.]) +fi + +LIB_XEXT="-lXext" +QTE_NORTTI="" + +elif test "$kde_use_qt_emb" = "yes"; then + dnl We're using QT Embedded + CPPFLAGS=-DQWS + CXXFLAGS="$CXXFLAGS -fno-rtti" + QTE_NORTTI="-fno-rtti -DQWS" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +elif test "$kde_use_qt_mac" = "yes"; then + dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to + dnl be included to get the information) --Sam + CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" + CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +fi +AC_SUBST(X_PRE_LIBS) +AC_SUBST(LIB_X11) +AC_SUBST(LIB_XRENDER) +AC_SUBST(LIBSM) +AC_SUBST(X_INCLUDES) +AC_SUBST(X_LDFLAGS) +AC_SUBST(x_includes) +AC_SUBST(x_libraries) +AC_SUBST(QTE_NORTTI) +AC_SUBST(LIB_XEXT) + +]) + +AC_DEFUN([KDE_PRINT_QT_PROGRAM], +[ +AC_REQUIRE([KDE_USE_QT]) +cat > conftest.$ac_ext < +#include +EOF +if test "$kde_qtver" = "2"; then +cat >> conftest.$ac_ext < +#include +#include +EOF + +if test $kde_qtsubver -gt 0; then +cat >> conftest.$ac_ext <> conftest.$ac_ext < +#include +#include +EOF +fi + +echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext +cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +fi + +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" +export LD_LIBRARY_PATH +LIBRARY_PATH="$ac_LIBRARY_PATH" +export LIBRARY_PATH +AC_LANG_RESTORE +]) + +if test "$kde_cv_qt_direct" = "yes"; then + AC_MSG_RESULT(yes) + $1 +else + AC_MSG_RESULT(no) + $2 +fi +]) + +dnl ------------------------------------------------------------------------ +dnl Try to find the Qt headers and libraries. +dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) +dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_PATH_QT_1_3], +[ +AC_REQUIRE([K_PATH_X]) +AC_REQUIRE([KDE_USE_QT]) +AC_REQUIRE([KDE_CHECK_LIB64]) + +dnl ------------------------------------------------------------------------ +dnl Add configure flag to enable linking to MT version of Qt library. +dnl ------------------------------------------------------------------------ + +AC_ARG_ENABLE( + mt, + AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]), + kde_use_qt_mt=$enableval, + [ + if test $kde_qtver = 3; then + kde_use_qt_mt=yes + else + kde_use_qt_mt=no + fi + ] +) + +USING_QT_MT="" + +dnl ------------------------------------------------------------------------ +dnl If we not get --disable-qt-mt then adjust some vars for the host. +dnl ------------------------------------------------------------------------ + +KDE_MT_LDFLAGS= +KDE_MT_LIBS= +if test "x$kde_use_qt_mt" = "xyes"; then + KDE_CHECK_THREADING + if test "x$kde_use_threading" = "xyes"; then + CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS" + KDE_MT_LDFLAGS="$USE_THREADS" + KDE_MT_LIBS="$LIBPTHREAD" + else + kde_use_qt_mt=no + fi +fi +AC_SUBST(KDE_MT_LDFLAGS) +AC_SUBST(KDE_MT_LIBS) + +kde_qt_was_given=yes + +dnl ------------------------------------------------------------------------ +dnl If we haven't been told how to link to Qt, we work it out for ourselves. +dnl ------------------------------------------------------------------------ +if test -z "$LIBQT_GLOB"; then + if test "x$kde_use_qt_emb" = "xyes"; then + LIBQT_GLOB="libqte.*" + else + LIBQT_GLOB="libqt.*" + fi +fi + +dnl ------------------------------------------------------------ +dnl If we got --enable-embedded then adjust the Qt library name. +dnl ------------------------------------------------------------ +if test "x$kde_use_qt_emb" = "xyes"; then + qtlib="qte" +else + qtlib="qt" +fi + +kde_int_qt="-l$qtlib" + +if test -z "$LIBQPE"; then +dnl ------------------------------------------------------------ +dnl If we got --enable-palmtop then add -lqpe to the link line +dnl ------------------------------------------------------------ + if test "x$kde_use_qt_emb" = "xyes"; then + if test "x$kde_use_qt_emb_palm" = "xyes"; then + LIB_QPE="-lqpe" + else + LIB_QPE="" + fi + else + LIB_QPE="" + fi +fi + +dnl ------------------------------------------------------------------------ +dnl If we got --enable-qt-mt then adjust the Qt library name for the host. +dnl ------------------------------------------------------------------------ + +if test "x$kde_use_qt_mt" = "xyes"; then + LIBQT="-l$qtlib-mt" + kde_int_qt="-l$qtlib-mt" + LIBQT_GLOB="lib$qtlib-mt.*" + USING_QT_MT="using -mt" +else + LIBQT="-l$qtlib" +fi + +if test $kde_qtver != 1; then + + AC_REQUIRE([AC_FIND_PNG]) + AC_REQUIRE([AC_FIND_JPEG]) + LIBQT="$LIBQT $LIBPNG $LIBJPEG" +fi + +if test $kde_qtver = 3; then + AC_REQUIRE([KDE_CHECK_LIBDL]) + LIBQT="$LIBQT $LIBDL" +fi + +AC_MSG_CHECKING([for Qt]) + +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET" +fi +ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO +qt_libraries="" +qt_includes="" +AC_ARG_WITH(qt-dir, + AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]), + [ ac_qt_includes="$withval"/include + ac_qt_libraries="$withval"/lib${kdelibsuff} + ac_qt_bindir="$withval"/bin + ]) + +AC_ARG_WITH(qt-includes, + AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]), + [ + ac_qt_includes="$withval" + ]) + +kde_qt_libs_given=no + +AC_ARG_WITH(qt-libraries, + AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]), + [ ac_qt_libraries="$withval" + kde_qt_libs_given=yes + ]) + +AC_CACHE_VAL(ac_cv_have_qt, +[#try to guess Qt locations + +qt_incdirs="" +for dir in $kde_qt_dirs; do + qt_incdirs="$qt_incdirs $dir/include $dir" +done +qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes" +if test ! "$ac_qt_includes" = "NO"; then + qt_incdirs="$ac_qt_includes $qt_incdirs" +fi + +if test "$kde_qtver" != "1"; then + kde_qt_header=qstyle.h +else + kde_qt_header=qglobal.h +fi + +AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) +ac_qt_includes="$qt_incdir" + +qt_libdirs="" +for dir in $kde_qt_dirs; do + qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir" +done +qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries" +if test ! "$ac_qt_libraries" = "NO"; then + qt_libdir=$ac_qt_libraries +else + qt_libdirs="$ac_qt_libraries $qt_libdirs" + # if the Qt was given, the chance is too big that libqt.* doesn't exist + qt_libdir=NONE + for dir in $qt_libdirs; do + try="ls -1 $dir/${LIBQT_GLOB}" + if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi + done +fi +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIBQT="$LIBQT ${kde_int_qt}_incremental" + break + fi +done + +ac_qt_libraries="$qt_libdir" + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +ac_cxxflags_safe="$CXXFLAGS" +ac_ldflags_safe="$LDFLAGS" +ac_libs_safe="$LIBS" + +CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" +LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" +LIBS="$LIBS $LIBQT $KDE_MT_LIBS" + +KDE_PRINT_QT_PROGRAM + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ac_qt_libraries="NO" +fi +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +AC_LANG_RESTORE +if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then + ac_cv_have_qt="have_qt=no" + ac_qt_notfound="" + missing_qt_mt="" + if test "$ac_qt_includes" = NO; then + if test "$ac_qt_libraries" = NO; then + ac_qt_notfound="(headers and libraries)"; + else + ac_qt_notfound="(headers)"; + fi + else + if test "x$kde_use_qt_mt" = "xyes"; then + missing_qt_mt=" +Make sure that you have compiled Qt with thread support!" + ac_qt_notfound="(library $qtlib-mt)"; + else + ac_qt_notfound="(library $qtlib)"; + fi + fi + + AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! +For more details about this problem, look at the end of config.log.$missing_qt_mt]) +else + have_qt="yes" +fi +]) + +eval "$ac_cv_have_qt" + +if test "$have_qt" != yes; then + AC_MSG_RESULT([$have_qt]); +else + ac_cv_have_qt="have_qt=yes \ + ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" + AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) + + qt_libraries="$ac_qt_libraries" + qt_includes="$ac_qt_includes" +fi + +if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then + KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) +fi + +AC_SUBST(qt_libraries) +AC_SUBST(qt_includes) + +if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then + QT_INCLUDES="" +else + QT_INCLUDES="-I$qt_includes" + all_includes="$QT_INCLUDES $all_includes" +fi + +if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then + QT_LDFLAGS="" +else + QT_LDFLAGS="-L$qt_libraries" + all_libraries="$QT_LDFLAGS $all_libraries" +fi +test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS" + +AC_SUBST(QT_INCLUDES) +AC_SUBST(QT_LDFLAGS) +AC_PATH_QT_MOC_UIC + +KDE_CHECK_QT_JPEG + +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)' +else +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)' +fi +test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS" +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIB_QT="$LIB_QT ${kde_int_qt}_incremental" + break + fi +done + +AC_SUBST(LIB_QT) +AC_SUBST(LIB_QPE) + +AC_SUBST(kde_qtver) +]) + +AC_DEFUN([AC_PATH_QT], +[ +AC_PATH_QT_1_3 +]) + +AC_DEFUN([KDE_CHECK_UIC_PLUGINS], +[ +AC_REQUIRE([AC_PATH_QT_MOC_UIC]) + +if test x$ac_uic_supports_libpath = xyes; then + +AC_MSG_CHECKING([if UIC has KDE plugins available]) +AC_CACHE_VAL(kde_cv_uic_plugins, +[ +cat > actest.ui << EOF + +NewConnectionDialog + + + + testInput + + + + +EOF + + + +kde_cv_uic_plugins=no +kde_line="$UIC_PATH -L $kde_widgetdir" +if test x$ac_uic_supports_nounload = xyes; then + kde_line="$kde_line -nounload" +fi +kde_line="$kde_line -impl actest.h actest.ui > actest.cpp" +if AC_TRY_EVAL(kde_line); then + # if you're trying to debug this check and think it's incorrect, + # better check your installation. The check _is_ correct - your + # installation is not. + if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then + kde_cv_uic_plugins=yes + fi +fi +rm -f actest.ui actest.cpp +]) + +AC_MSG_RESULT([$kde_cv_uic_plugins]) +if test "$kde_cv_uic_plugins" != yes; then + AC_MSG_ERROR([ +you need to install kdelibs first. + +If you did install kdelibs, then the Qt version that is picked up by +this configure is not the same version you used to compile kdelibs. +The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the +_same Qt version_, compiled with the _same compiler_ and the same Qt +configuration settings. +]) +fi +fi +]) + +AC_DEFUN([KDE_CHECK_FINAL], +[ + AC_ARG_ENABLE(final, + AC_HELP_STRING([--enable-final], + [build size optimized apps (experimental - needs lots of memory)]), + kde_use_final=$enableval, kde_use_final=no) + + if test "x$kde_use_final" = "xyes"; then + KDE_USE_FINAL_TRUE="" + KDE_USE_FINAL_FALSE="#" + else + KDE_USE_FINAL_TRUE="#" + KDE_USE_FINAL_FALSE="" + fi + AC_SUBST(KDE_USE_FINAL_TRUE) + AC_SUBST(KDE_USE_FINAL_FALSE) +]) + +AC_DEFUN([KDE_CHECK_CLOSURE], +[ + AC_ARG_ENABLE(closure, + AC_HELP_STRING([--enable-closure],[delay template instantiation]), + kde_use_closure=$enableval, kde_use_closure=no) + + KDE_NO_UNDEFINED="" + if test "x$kde_use_closure" = "xyes"; then + KDE_USE_CLOSURE_TRUE="" + KDE_USE_CLOSURE_FALSE="#" +# CXXFLAGS="$CXXFLAGS $REPO" + else + KDE_USE_CLOSURE_TRUE="#" + KDE_USE_CLOSURE_FALSE="" + KDE_NO_UNDEFINED="" + case $host in + *-*-linux-gnu) + KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined], + [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined], + [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"], + [KDE_NO_UNDEFINED=""])], + [KDE_NO_UNDEFINED=""]) + ;; + esac + fi + AC_SUBST(KDE_USE_CLOSURE_TRUE) + AC_SUBST(KDE_USE_CLOSURE_FALSE) + AC_SUBST(KDE_NO_UNDEFINED) +]) + +dnl Check if the linker supports --enable-new-dtags and --as-needed +AC_DEFUN([KDE_CHECK_NEW_LDFLAGS], +[ + AC_ARG_ENABLE(new_ldflags, + AC_HELP_STRING([--enable-new-ldflags], + [enable the new linker flags]), + kde_use_new_ldflags=$enableval, + kde_use_new_ldflags=no) + + LDFLAGS_AS_NEEDED="" + LDFLAGS_NEW_DTAGS="" + if test "x$kde_use_new_ldflags" = "xyes"; then + LDFLAGS_NEW_DTAGS="" + KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags], + [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],) + + KDE_CHECK_COMPILER_FLAG([Wl,--as-needed], + [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],) + fi + AC_SUBST(LDFLAGS_AS_NEEDED) + AC_SUBST(LDFLAGS_NEW_DTAGS) +]) + +AC_DEFUN([KDE_CHECK_NMCHECK], +[ + AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]), + kde_use_nmcheck=$enableval, kde_use_nmcheck=no) + + if test "$kde_use_nmcheck" = "yes"; then + KDE_USE_NMCHECK_TRUE="" + KDE_USE_NMCHECK_FALSE="#" + else + KDE_USE_NMCHECK_TRUE="#" + KDE_USE_NMCHECK_FALSE="" + fi + AC_SUBST(KDE_USE_NMCHECK_TRUE) + AC_SUBST(KDE_USE_NMCHECK_FALSE) +]) + +AC_DEFUN([KDE_EXPAND_MAKEVAR], [ +savex=$exec_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +tmp=$$2 +while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done +exec_prefix=$savex +]) + +dnl ------------------------------------------------------------------------ +dnl Now, the same with KDE +dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed) +dnl and $(kde_includes) will be the kdehdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_BASE_PATH_KDE], +[ +AC_REQUIRE([KDE_CHECK_STL]) +AC_REQUIRE([AC_PATH_QT])dnl +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_CHECK_RPATH +AC_MSG_CHECKING([for KDE]) + +if test "${prefix}" != NONE; then + kde_includes=${includedir} + KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir) + + kde_libraries=${libdir} + KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir) + +else + ac_kde_includes= + ac_kde_libraries= + kde_libraries="" + kde_includes="" +fi + +AC_CACHE_VAL(ac_cv_have_kde, +[#try to guess kde locations + +if test "$kde_qtver" = 1; then + kde_check_header="ksock.h" + kde_check_lib="libkdecore.la" +else + kde_check_header="ksharedptr.h" + kde_check_lib="libkio.la" +fi + +if test -z "$1"; then + +kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes" +test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs" +kde_incdirs="$ac_kde_includes $kde_incdirs" +AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir) +ac_kde_includes="$kde_incdir" + +if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then + AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE headers installed. This will fail. +So, check this please and use another prefix!]) +fi + +kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}" +test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs" +kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs" +AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir) +ac_kde_libraries="$kde_libdir" + +kde_widgetdir=NO +dnl this might be somewhere else +AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir) + +if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then +AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE libraries installed. This will fail. +So, check this please and use another prefix!]) +fi + +if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then +AC_MSG_ERROR([ +I can't find the designer plugins. These are required and should have been installed +by kdelibs]) +fi + +if test -n "$kde_widgetdir"; then + kde_widgetdir="$kde_widgetdir/kde3/plugins/designer" +fi + + +if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then + ac_cv_have_kde="have_kde=no" +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" +fi + +else dnl test -z $1, e.g. from kdelibs + + ac_cv_have_kde="have_kde=no" + +fi +])dnl + +eval "$ac_cv_have_kde" + +if test "$have_kde" != "yes"; then + if test "${prefix}" = NONE; then + ac_kde_prefix="$ac_default_prefix" + else + ac_kde_prefix="$prefix" + fi + if test "$exec_prefix" = NONE; then + ac_kde_exec_prefix="$ac_kde_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix]) + else + ac_kde_exec_prefix="$exec_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix]) + fi + + kde_libraries="${libdir}" + kde_includes="${includedir}" + +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" + AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes]) + + kde_libraries="$ac_kde_libraries" + kde_includes="$ac_kde_includes" +fi +AC_SUBST(kde_libraries) +AC_SUBST(kde_includes) + +if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then + KDE_INCLUDES="" +else + KDE_INCLUDES="-I$kde_includes" + all_includes="$KDE_INCLUDES $all_includes" +fi + +KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION" + +KDE_LDFLAGS="-L$kde_libraries" +if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then + all_libraries="$KDE_LDFLAGS $all_libraries" +fi + +AC_SUBST(KDE_LDFLAGS) +AC_SUBST(KDE_INCLUDES) + +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +all_libraries="$all_libraries $USER_LDFLAGS" +all_includes="$all_includes $USER_INCLUDES" +AC_SUBST(all_includes) +AC_SUBST(all_libraries) + +if test -z "$1"; then +KDE_CHECK_UIC_PLUGINS +fi + +ac_kde_libraries="$kde_libdir" + +AC_SUBST(AUTODIRS) + + +]) + +AC_DEFUN([KDE_CHECK_EXTRA_LIBS], +[ +AC_MSG_CHECKING(for extra includes) +AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]), + kde_use_extra_includes="$withval", + kde_use_extra_includes=NONE +) +kde_extra_includes= +if test -n "$kde_use_extra_includes" && \ + test "$kde_use_extra_includes" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_includes; do + kde_extra_includes="$kde_extra_includes $dir" + USER_INCLUDES="$USER_INCLUDES -I$dir" + done + IFS=$ac_save_ifs + kde_use_extra_includes="added" +else + kde_use_extra_includes="no" +fi +AC_SUBST(USER_INCLUDES) + +AC_MSG_RESULT($kde_use_extra_includes) + +kde_extra_libs= +AC_MSG_CHECKING(for extra libs) +AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]), + kde_use_extra_libs=$withval, + kde_use_extra_libs=NONE +) +if test -n "$kde_use_extra_libs" && \ + test "$kde_use_extra_libs" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_libs; do + kde_extra_libs="$kde_extra_libs $dir" + KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir" + USER_LDFLAGS="$USER_LDFLAGS -L$dir" + done + IFS=$ac_save_ifs + kde_use_extra_libs="added" +else + kde_use_extra_libs="no" +fi + +AC_SUBST(USER_LDFLAGS) + +AC_MSG_RESULT($kde_use_extra_libs) + +]) + +AC_DEFUN([KDE_1_CHECK_PATH_HEADERS], +[ + AC_MSG_CHECKING([for KDE headers installed]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS +cat > conftest.$ac_ext < +#endif +#include +#include "confdefs.h" +#include + +int main() { + printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data()); + printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data()); + printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data()); + printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data()); + printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data()); + printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data()); + printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data()); + printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data()); + printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data()); + printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data()); + printf("kde_wallpaperdir=\\"%s\\"\n", + KApplication::kde_wallpaperdir().data()); + printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data()); + printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data()); + printf("kde_servicesdir=\\"/tmp/dummy\\"\n"); + printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n"); + printf("kde_moduledir=\\"/tmp/dummy\\"\n"); + printf("kde_styledir=\\"/tmp/dummy\\"\n"); + printf("kde_widgetdir=\\"/tmp/dummy\\"\n"); + printf("xdg_appsdir=\\"/tmp/dummy\\"\n"); + printf("xdg_menudir=\\"/tmp/dummy\\"\n"); + printf("xdg_directorydir=\\"/tmp/dummy\\"\n"); + printf("kde_kcfgdir=\\"/tmp/dummy\\"\n"); + return 0; + } +EOF + + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$all_includes $CPPFLAGS" + if AC_TRY_EVAL(ac_compile); then + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([your system is not able to compile a small KDE application! +Check, if you installed the KDE header files correctly. +For more details about this problem, look at the end of config.log.]) + fi + CPPFLAGS=$ac_save_CPPFLAGS + + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_CHECK_KDEQTADDON], +[ +AC_MSG_CHECKING(for kde-qt-addon) +AC_CACHE_VAL(kde_cv_have_kdeqtaddon, +[ + kde_ldflags_safe="$LDFLAGS" + kde_libs_safe="$LIBS" + kde_cxxflags_safe="$CXXFLAGS" + + LIBS="-lkde-qt-addon $LIBQT $LIBS" + CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes" + LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" + + AC_TRY_LINK([ + #include + ], + [ + QDomDocument doc; + ], + kde_cv_have_kdeqtaddon=yes, + kde_cv_have_kdeqtaddon=no + ) + + LDFLAGS=$kde_ldflags_safe + LIBS=$kde_libs_safe + CXXFLAGS=$kde_cxxflags_safe +]) + +AC_MSG_RESULT($kde_cv_have_kdeqtaddon) + +if test "$kde_cv_have_kdeqtaddon" = "no"; then + AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first. +It is a separate package (and CVS module) named kde-qt-addon.]) +fi +]) + +AC_DEFUN([KDE_CREATE_LIBS_ALIASES], +[ + AC_REQUIRE([KDE_MISC_TESTS]) + AC_REQUIRE([KDE_CHECK_LIBDL]) + AC_REQUIRE([K_PATH_X]) + +if test $kde_qtver = 3; then + case $host in + *cygwin*) lib_kded="-lkdeinit_kded" ;; + *) lib_kded="" ;; + esac + AC_SUBST(LIB_KDED, $lib_kded) + AC_SUBST(LIB_KDECORE, "-lkdecore") + AC_SUBST(LIB_KDEUI, "-lkdeui") + AC_SUBST(LIB_KIO, "-lkio") + AC_SUBST(LIB_KJS, "-lkjs") + AC_SUBST(LIB_SMB, "-lsmb") + AC_SUBST(LIB_KAB, "-lkab") + AC_SUBST(LIB_KABC, "-lkabc") + AC_SUBST(LIB_KHTML, "-lkhtml") + AC_SUBST(LIB_KSPELL, "-lkspell") + AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KDEPRINT, "-lkdeprint") + AC_SUBST(LIB_KUTILS, "-lkutils") + AC_SUBST(LIB_KDEPIM, "-lkdepim") + AC_SUBST(LIB_KIMPROXY, "-lkimproxy") + AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff") + AC_SUBST(LIB_KDNSSD, "-lkdnssd") + AC_SUBST(LIB_KUNITTEST, "-lkunittest") +# these are for backward compatibility + AC_SUBST(LIB_KSYCOCA, "-lkio") + AC_SUBST(LIB_KFILE, "-lkio") +elif test $kde_qtver = 2; then + AC_SUBST(LIB_KDECORE, "-lkdecore") + AC_SUBST(LIB_KDEUI, "-lkdeui") + AC_SUBST(LIB_KIO, "-lkio") + AC_SUBST(LIB_KSYCOCA, "-lksycoca") + AC_SUBST(LIB_SMB, "-lsmb") + AC_SUBST(LIB_KFILE, "-lkfile") + AC_SUBST(LIB_KAB, "-lkab") + AC_SUBST(LIB_KHTML, "-lkhtml") + AC_SUBST(LIB_KSPELL, "-lkspell") + AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KDEPRINT, "-lkdeprint") +else + AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)") + AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)") + AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)") + AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)") + AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)") +fi +]) + +AC_DEFUN([AC_PATH_KDE], +[ + AC_BASE_PATH_KDE + AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]), + [ + if test "$enableval" = "no"; + then ac_use_path_checking="default" + else ac_use_path_checking="" + fi + ], + [ + if test "$kde_qtver" = 1; + then ac_use_path_checking="" + else ac_use_path_checking="default" + fi + ] + ) + + AC_CREATE_KFSSTND($ac_use_path_checking) + + AC_SUBST_KFSSTND + KDE_CREATE_LIBS_ALIASES +]) + +dnl KDE_CHECK_FUNC_EXT(, [headers], [sample-use], [C prototype], [autoheader define], [call if found]) +AC_DEFUN([KDE_CHECK_FUNC_EXT], +[ +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(kde_cv_func_$1, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +save_CXXFLAGS="$CXXFLAGS" +kde_safe_LIBS="$LIBS" +LIBS="$LIBS $X_EXTRA_LIBS" +if test "$GXX" = "yes"; then +CXXFLAGS="$CXXFLAGS -pedantic-errors" +fi +AC_TRY_COMPILE([ +$2 +], +[ +$3 +], +kde_cv_func_$1=yes, +kde_cv_func_$1=no) +CXXFLAGS="$save_CXXFLAGS" +LIBS="$kde_safe_LIBS" +AC_LANG_RESTORE +]) + +AC_MSG_RESULT($kde_cv_func_$1) + +AC_MSG_CHECKING([if $1 needs custom prototype]) +AC_CACHE_VAL(kde_cv_proto_$1, +[ +if test "x$kde_cv_func_$1" = xyes; then + kde_cv_proto_$1=no +else + case "$1" in + setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat) + kde_cv_proto_$1="yes - in libkdefakes" + ;; + *) + kde_cv_proto_$1=unknown + ;; + esac +fi + +if test "x$kde_cv_proto_$1" = xunknown; then + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + kde_safe_libs=$LIBS + LIBS="$LIBS $X_EXTRA_LIBS" + AC_TRY_LINK([ +$2 + +extern "C" $4; +], +[ +$3 +], +[ kde_cv_func_$1=yes + kde_cv_proto_$1=yes ], + [kde_cv_proto_$1="$1 unavailable"] +) +LIBS=$kde_safe_libs +AC_LANG_RESTORE +fi +]) +AC_MSG_RESULT($kde_cv_proto_$1) + +if test "x$kde_cv_func_$1" = xyes; then + AC_DEFINE(HAVE_$5, 1, [Define if you have $1]) + $6 +fi +if test "x$kde_cv_proto_$1" = xno; then + AC_DEFINE(HAVE_$5_PROTO, 1, + [Define if you have the $1 prototype]) +fi + +AH_VERBATIM([_HAVE_$5_PROTO], +[ +#if !defined(HAVE_$5_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +$4; +#ifdef __cplusplus +} +#endif +#endif +]) +]) + +AC_DEFUN([AC_CHECK_SETENV], +[ + KDE_CHECK_FUNC_EXT(setenv, [ +#include +], + [setenv("VAR", "VALUE", 1);], + [int setenv (const char *, const char *, int)], + [SETENV]) +]) + +AC_DEFUN([AC_CHECK_UNSETENV], +[ + KDE_CHECK_FUNC_EXT(unsetenv, [ +#include +], + [unsetenv("VAR");], + [void unsetenv (const char *)], + [UNSETENV]) +]) + +AC_DEFUN([AC_CHECK_GETDOMAINNAME], +[ + KDE_CHECK_FUNC_EXT(getdomainname, [ +#include +#include +#include +], + [ +char buffer[200]; +getdomainname(buffer, 200); +], + [#include + int getdomainname (char *, size_t)], + [GETDOMAINNAME]) +]) + +AC_DEFUN([AC_CHECK_GETHOSTNAME], +[ + KDE_CHECK_FUNC_EXT(gethostname, [ +#include +#include +], + [ +char buffer[200]; +gethostname(buffer, 200); +], + [int gethostname (char *, unsigned int)], + [GETHOSTNAME]) +]) + +AC_DEFUN([AC_CHECK_USLEEP], +[ + KDE_CHECK_FUNC_EXT(usleep, [ +#include +], + [ +usleep(200); +], + [int usleep (unsigned int)], + [USLEEP]) +]) + + +AC_DEFUN([AC_CHECK_RANDOM], +[ + KDE_CHECK_FUNC_EXT(random, [ +#include +], + [ +random(); +], + [long int random(void)], + [RANDOM]) + + KDE_CHECK_FUNC_EXT(srandom, [ +#include +], + [ +srandom(27); +], + [void srandom(unsigned int)], + [SRANDOM]) + +]) + +AC_DEFUN([AC_CHECK_INITGROUPS], +[ + KDE_CHECK_FUNC_EXT(initgroups, [ +#include +#include +#include +], + [ +char buffer[200]; +initgroups(buffer, 27); +], + [int initgroups(const char *, gid_t)], + [INITGROUPS]) +]) + +AC_DEFUN([AC_CHECK_MKSTEMPS], +[ + KDE_CHECK_FUNC_EXT(mkstemps, [ +#include +#include +], + [ +mkstemps("/tmp/aaaXXXXXX", 6); +], + [int mkstemps(char *, int)], + [MKSTEMPS]) +]) + +AC_DEFUN([AC_CHECK_MKSTEMP], +[ + KDE_CHECK_FUNC_EXT(mkstemp, [ +#include +#include +], + [ +mkstemp("/tmp/aaaXXXXXX"); +], + [int mkstemp(char *)], + [MKSTEMP]) +]) + +AC_DEFUN([AC_CHECK_MKDTEMP], +[ + KDE_CHECK_FUNC_EXT(mkdtemp, [ +#include +#include +], + [ +mkdtemp("/tmp/aaaXXXXXX"); +], + [char *mkdtemp(char *)], + [MKDTEMP]) +]) + + +AC_DEFUN([AC_CHECK_RES_INIT], +[ + AC_MSG_CHECKING([if res_init needs -lresolv]) + kde_libs_safe="$LIBS" + LIBS="$LIBS $X_EXTRA_LIBS -lresolv" + AC_TRY_LINK( + [ +#include +#include +#include +#include + ], + [ + res_init(); + ], + [ + LIBRESOLV="-lresolv" + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function]) + ], + [ AC_MSG_RESULT(no) ] + ) + LIBS=$kde_libs_safe + AC_SUBST(LIBRESOLV) + + KDE_CHECK_FUNC_EXT(res_init, + [ +#include +#include +#include +#include + ], + [res_init()], + [int res_init(void)], + [RES_INIT]) +]) + +AC_DEFUN([AC_CHECK_STRLCPY], +[ + KDE_CHECK_FUNC_EXT(strlcpy, [ +#include +], +[ char buf[20]; + strlcpy(buf, "KDE function test", sizeof(buf)); +], + [unsigned long strlcpy(char*, const char*, unsigned long)], + [STRLCPY]) +]) + +AC_DEFUN([AC_CHECK_STRLCAT], +[ + KDE_CHECK_FUNC_EXT(strlcat, [ +#include +], +[ char buf[20]; + buf[0]='\0'; + strlcat(buf, "KDE function test", sizeof(buf)); +], + [unsigned long strlcat(char*, const char*, unsigned long)], + [STRLCAT]) +]) + +AC_DEFUN([AC_CHECK_RES_QUERY], +[ + KDE_CHECK_FUNC_EXT(res_query, [ +#include +#include +#include +#include +#include +], +[ +res_query(NULL, 0, 0, NULL, 0); +], + [int res_query(const char *, int, int, unsigned char *, int)], + [RES_QUERY]) +]) + +AC_DEFUN([AC_CHECK_DN_SKIPNAME], +[ + KDE_CHECK_FUNC_EXT(dn_skipname, [ +#include +#include +#include +#include +], +[ +dn_skipname (NULL, NULL); +], + [int dn_skipname (unsigned char *, unsigned char *)], + [DN_SKIPNAME]) +]) + + +AC_DEFUN([AC_FIND_GIF], + [AC_MSG_CHECKING([for giflib]) +AC_CACHE_VAL(ac_cv_lib_gif, +[ac_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" +else +LIBS="$all_libraries -lgif" +fi +AC_TRY_LINK(dnl +[ +#ifdef __cplusplus +extern "C" { +#endif +int GifLastError(void); +#ifdef __cplusplus +} +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +], + [return GifLastError();], + eval "ac_cv_lib_gif=yes", + eval "ac_cv_lib_gif=no") +LIBS="$ac_save_LIBS" +])dnl +if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif]) +else + AC_MSG_ERROR(You need giflib30. Please install the kdesupport package) +fi +]) + +AC_DEFUN([KDE_FIND_JPEG_HELPER], +[ +AC_MSG_CHECKING([for libjpeg$2]) +AC_CACHE_VAL(ac_cv_lib_jpeg_$1, +[ +ac_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm" +ac_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK( +[ +#ifdef __cplusplus +extern "C" { +#endif +void jpeg_CreateDecompress(); +#ifdef __cplusplus +} +#endif +], +[jpeg_CreateDecompress();], + eval "ac_cv_lib_jpeg_$1=-ljpeg$2", + eval "ac_cv_lib_jpeg_$1=no") +LIBS="$ac_save_LIBS" +CFLAGS="$ac_save_CFLAGS" +]) + +if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then + LIBJPEG="$ac_cv_lib_jpeg_$1" + AC_MSG_RESULT($ac_cv_lib_jpeg_$1) +else + AC_MSG_RESULT(no) + $3 +fi + +]) + +AC_DEFUN([AC_FIND_JPEG], +[ +dnl first look for libraries +KDE_FIND_JPEG_HELPER(6b, 6b, + KDE_FIND_JPEG_HELPER(normal, [], + [ + LIBJPEG= + ] + ) +) + +dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h +dnl requires system dependent includes loaded before it) +jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes" +AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir) +test "x$jpeg_incdir" = xNO && jpeg_incdir= + +dnl if headers _and_ libraries are missing, this is no error, and we +dnl continue with a warning (the user will get no jpeg support in khtml) +dnl if only one is missing, it means a configuration error, but we still +dnl only warn +if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then + AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg]) +else + if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then + AC_MSG_WARN([ +There is an installation error in jpeg support. You seem to have only one +of either the headers _or_ the libraries installed. You may need to either +provide correct --with-extra-... options, or the development package of +libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/ +Disabling JPEG support. +]) + else + AC_MSG_WARN([libjpeg not found. disable JPEG support.]) + fi + jpeg_incdir= + LIBJPEG= +fi + +AC_SUBST(LIBJPEG) +AH_VERBATIM(_AC_CHECK_JPEG, +[/* + * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system + * headers and I'm too lazy to write a configure test as long as only + * unixware is related + */ +#ifdef _UNIXWARE +#define HAVE_BOOLEAN +#endif +]) +]) + +AC_DEFUN([KDE_CHECK_QT_JPEG], +[ +if test -n "$LIBJPEG"; then +AC_MSG_CHECKING([if Qt needs $LIBJPEG]) +AC_CACHE_VAL(kde_cv_qt_jpeg, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS $LIBQT" +LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK( +[#include ], + [ + int argc; + char** argv; + QApplication app(argc, argv);], + eval "kde_cv_qt_jpeg=no", + eval "kde_cv_qt_jpeg=yes") +LIBS="$ac_save_LIBS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_LANG_RESTORE +fi +]) + +if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then + AC_MSG_RESULT(yes) + LIBJPEG_QT='$(LIBJPEG)' +else + AC_MSG_RESULT(no) + LIBJPEG_QT= +fi + +]) + +AC_DEFUN([AC_FIND_ZLIB], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for libz]) +AC_CACHE_VAL(ac_cv_lib_z, +[ +kde_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK(dnl +[ +#include +], +[ + char buf[42]; + gzFile f = (gzFile) 0; + /* this would segfault.. but we only link, don't run */ + (void) gzgets(f, buf, sizeof(buf)); + + return (zlibVersion() == ZLIB_VERSION); +], + eval "ac_cv_lib_z='-lz'", + eval "ac_cv_lib_z=no") +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if test ! "$ac_cv_lib_z" = no; then + AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz]) + LIBZ="$ac_cv_lib_z" + AC_MSG_RESULT($ac_cv_lib_z) +else + AC_MSG_ERROR(not found. + Possibly configure picks up an outdated version + installed by XFree86. Remove it from your system. + + Check your installation and look into config.log) + LIBZ="" +fi +AC_SUBST(LIBZ) +]) + +AC_DEFUN([KDE_TRY_TIFFLIB], +[ +AC_MSG_CHECKING([for libtiff $1]) + +AC_CACHE_VAL(kde_cv_libtiff_$1, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm" +else +LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm" +fi +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl +[ +#include +], + [return (TIFFOpen( "", "r") == 0); ], +[ + kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ" +], [ + kde_cv_libtiff_$1=no +]) + +LIBS="$kde_save_LIBS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE +]) + +if test "$kde_cv_libtiff_$1" = "no"; then + AC_MSG_RESULT(no) + LIBTIFF="" + $3 +else + LIBTIFF="$kde_cv_libtiff_$1" + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff]) + $2 +fi + +]) + +AC_DEFUN([AC_FIND_TIFF], +[ +AC_REQUIRE([K_PATH_X]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +KDE_TRY_TIFFLIB(tiff, [], + KDE_TRY_TIFFLIB(tiff34)) + +AC_SUBST(LIBTIFF) +]) + +AC_DEFUN([KDE_FIND_LIBEXR], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_CACHE_VAL(ac_cv_libexr, +[ + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + AC_MSG_CHECKING([for OpenEXR libraries]) + + if test "$PKG_CONFIG" = "no" ; then + AC_MSG_RESULT(no) + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + if !(`$PKG_CONFIG --exists OpenEXR`) ; then + AC_MSG_RESULT(no) + EXRSTATUS=no + else + if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then + AC_MSG_RESULT(no) + EXRSTATUS=old + else + kde_save_LIBS="$LIBS" + LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + kde_save_CXXFLAGS="$CXXFLAGS" + EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR` + CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS" + + AC_TRY_LINK(dnl + [ + #include + ], + [ + using namespace Imf; + RgbaInputFile file ("dummy"); + return 0; + ], + eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'", + eval "ac_cv_libexr=no" + ) + LIBS="$kde_save_LIBS" + CXXFLAGS="$kde_save_CXXFLAGS" + AC_LANG_RESTORE + ])dnl + if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR]) + LIB_EXR="$ac_cv_libexr" + AC_MSG_RESULT($ac_cv_libexr) + else + AC_MSG_RESULT(no) + LIB_EXR="" + fi + fi + fi + fi + AC_SUBST(LIB_EXR) + AC_SUBST(EXR_FLAGS) +]) + + + +AC_DEFUN([AC_FIND_PNG], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_MSG_CHECKING([for libpng]) +AC_CACHE_VAL(ac_cv_lib_png, +[ +kde_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET" +else +LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm" +fi +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + png_structp png_ptr = png_create_read_struct( /* image ptr */ + PNG_LIBPNG_VER_STRING, 0, 0, 0 ); + return( png_ptr != 0 ); + ], + eval "ac_cv_lib_png='-lpng $LIBZ -lm'", + eval "ac_cv_lib_png=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng]) + LIBPNG="$ac_cv_lib_png" + AC_SUBST(LIBPNG) + AC_MSG_RESULT($ac_cv_lib_png) +else + AC_MSG_RESULT(no) + LIBPNG="" + AC_SUBST(LIBPNG) +fi +]) + + +AC_DEFUN([AC_FIND_JASPER], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_MSG_CHECKING([for jasper]) +AC_CACHE_VAL(ac_cv_jasper, +[ +kde_save_LIBS="$LIBS" +LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + return( jas_init() ); + ], + eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'", + eval "ac_cv_jasper=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper]) + LIB_JASPER="$ac_cv_jasper" + AC_MSG_RESULT($ac_cv_jasper) +else + AC_MSG_RESULT(no) + LIB_JASPER="" +fi +AC_SUBST(LIB_JASPER) +]) + +AC_DEFUN([AC_CHECK_BOOL], +[ + AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool]) +]) + +AC_DEFUN([AC_CHECK_GNU_EXTENSIONS], +[ +AC_MSG_CHECKING(if you need GNU extensions) +AC_CACHE_VAL(ac_cv_gnu_extensions, +[ +cat > conftest.c << EOF +#include + +#ifdef __GNU_LIBRARY__ +yes +#endif +EOF + +if (eval "$ac_cpp conftest.c") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_gnu_extensions=yes +else + ac_cv_gnu_extensions=no +fi +]) + +AC_MSG_RESULT($ac_cv_gnu_extensions) +if test "$ac_cv_gnu_extensions" = "yes"; then + AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions]) +fi +]) + +AC_DEFUN([KDE_CHECK_COMPILER_FLAG], +[ +AC_MSG_CHECKING([whether $CXX supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` +AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) + CXXFLAGS="$save_CXXFLAGS" + AC_LANG_RESTORE +]) +if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + +AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG], +[ +AC_MSG_CHECKING([whether $CC supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` +AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache, +[ + AC_LANG_SAVE + AC_LANG_C + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], []) + CFLAGS="$save_CFLAGS" + AC_LANG_RESTORE +]) +if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + + +dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables +dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) +dnl it's all white-space separated +AC_DEFUN([AC_REMOVE_FORBIDDEN], +[ __val=$$1 + __forbid=" $2 " + if test -n "$__val"; then + __new="" + ac_save_IFS=$IFS + IFS=" " + for i in $__val; do + case "$__forbid" in + *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; + *) # Careful to not add spaces, where there were none, because otherwise + # libtool gets confused, if we change e.g. CXX + if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; + esac + done + IFS=$ac_save_IFS + $1=$__new + fi +]) + + +AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER], +[ + AC_MSG_CHECKING([whether $CC is blacklisted]) + + dnl In theory we have tu run this test against $CC and $CXX + dnl in C and in C++ mode, because its perfectly legal for + dnl the user to mix compiler versions, since C has a defined + dnl ABI. + dnl + dnl For now, we assume the user is not on crack. + + AC_TRY_COMPILE([ +#ifdef __GNUC__ +#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0 +choke me +#endif +#endif +], , + kde_bad_compiler=no, + kde_bad_compiler=yes +) + + AC_MSG_RESULT($kde_bad_compiler) + +if test "$kde_bad_compiler" = "yes"; then + AC_MSG_ERROR([ + +This particular compiler version is blacklisted because it +is known to miscompile KDE. Please use a newer version, or +if that is not yet available, choose an older version. + +Please do not report a bug or bother us reporting this +configure error. We know about it, and we introduced +it by intention to avoid untraceable bugs or crashes in KDE. + +]) +fi + +]) + + +AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH], +[ + AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline], + kde_cv_opt_noinline_match, + [ + kde_cv_opt_noinline_match=irrelevant + dnl if we don't use both -O2 and -fno-inline, this check is moot + if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \ + && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then + + ac_cflags_save="$CFLAGS" + CFLAGS="$CFLAGS -D_USE_GNU" + + AC_TRY_LINK([ + #include +], [ const char *pt, *et; + et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ; +], + kde_cv_opt_noinline_match=yes, + kde_cv_opt_noinline_match=no + ) + + CFLAGS="$ac_cflags_save" + fi + ]) +]) + + +dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given +AC_DEFUN([AC_VALIDIFY_CXXFLAGS], +[dnl +if test "x$kde_use_qt_emb" != "xyes"; then + AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) + AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) +else + AC_REMOVE_FORBIDDEN(CXX, [-rpath]) + AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) +fi +]) + +AC_DEFUN([AC_CHECK_COMPILERS], +[ + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]), + [ + case $enableval in + yes) + kde_use_debug_code="yes" + kde_use_debug_define=no + ;; + full) + kde_use_debug_code="full" + kde_use_debug_define=no + ;; + *) + kde_use_debug_code="no" + kde_use_debug_define=yes + ;; + esac + ], + [kde_use_debug_code="no" + kde_use_debug_define=no + ]) + + dnl Just for configure --help + AC_ARG_ENABLE(dummyoption, + AC_HELP_STRING([--disable-debug], + [disables debug output and debug symbols [default=no]]), + [],[]) + + AC_ARG_ENABLE(strict, + AC_HELP_STRING([--enable-strict], + [compiles with strict compiler options (may not work!)]), + [ + if test $enableval = "no"; then + kde_use_strict_options="no" + else + kde_use_strict_options="yes" + fi + ], [kde_use_strict_options="no"]) + + AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]), + [ + if test $enableval = "no"; then + kde_use_warnings="no" + else + kde_use_warnings="yes" + fi + ], [kde_use_warnings="yes"]) + + dnl enable warnings for debug build + if test "$kde_use_debug_code" != "no"; then + kde_use_warnings=yes + fi + + AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]), + [kde_use_profiling=$enableval], + [kde_use_profiling="no"] + ) + + dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS + CFLAGS=" $CFLAGS" + + AC_PROG_CC + + AC_PROG_CPP + + if test "$GCC" = "yes"; then + if test "$kde_use_debug_code" != "no"; then + if test $kde_use_debug_code = "full"; then + CFLAGS="-g3 -fno-inline $CFLAGS" + else + CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS" + fi + else + CFLAGS="-O2 $CFLAGS" + fi + fi + + if test "$kde_use_debug_define" = "yes"; then + CFLAGS="-DNDEBUG $CFLAGS" + fi + + + case "$host" in + *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";; + *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";; + esac + + if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then + LDFLAGS="" + fi + + CXXFLAGS=" $CXXFLAGS" + + AC_PROG_CXX + + KDE_CHECK_FOR_BAD_COMPILER + + if test "$GXX" = "yes" || test "$CXX" = "KCC"; then + if test "$kde_use_debug_code" != "no"; then + if test "$CXX" = "KCC"; then + CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" + else + if test "$kde_use_debug_code" = "full"; then + CXXFLAGS="-g3 -fno-inline $CXXFLAGS" + else + CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS" + fi + fi + KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"]) + + dnl convenience compiler flags + KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""]) + AC_SUBST(WOVERLOADED_VIRTUAL) + else + if test "$CXX" = "KCC"; then + CXXFLAGS="+K3 $CXXFLAGS" + else + CXXFLAGS="-O2 $CXXFLAGS" + fi + fi + fi + + if test "$kde_use_debug_define" = "yes"; then + CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS" + fi + + if test "$kde_use_profiling" = "yes"; then + KDE_CHECK_COMPILER_FLAG(pg, + [ + CFLAGS="-pg $CFLAGS" + CXXFLAGS="-pg $CXXFLAGS" + ]) + fi + + if test "$kde_use_warnings" = "yes"; then + if test "$GCC" = "yes"; then + CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS" + case $host in + *-*-linux-gnu) + CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" + CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS" + KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"]) + KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"]) + ;; + esac + KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"]) + KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"]) + dnl ### FIXME: revert for KDE 4 + KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"]) + fi + fi + + if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then + CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS" + fi + + AC_ARG_ENABLE(pch, + AC_HELP_STRING([--enable-pch], + [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]), + [ kde_use_pch=$enableval ],[ kde_use_pch=no ]) + + HAVE_GCC_VISIBILITY=0 + AC_SUBST([HAVE_GCC_VISIBILITY]) + + if test "$GXX" = "yes"; then + gcc_no_reorder_blocks=NO + KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES]) + if test $kde_use_debug_code != "no" && \ + test $kde_use_debug_code != "full" && \ + test "YES" = "$gcc_no_reorder_blocks" ; then + CXXFLAGS="$CXXFLAGS -fno-reorder-blocks" + CFLAGS="$CFLAGS -fno-reorder-blocks" + fi + KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"]) + KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"]) + KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"]) + KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= ) + ENABLE_PERMISSIVE_FLAG="-fpermissive" + + if test "$kde_use_pch" = "yes"; then + AC_MSG_CHECKING(whether gcc supports precompiling c header files) + echo >conftest.h + if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then + kde_gcc_supports_pch=yes + AC_MSG_RESULT(yes) + else + kde_gcc_supports_pch=no + AC_MSG_RESULT(no) + fi + if test "$kde_gcc_supports_pch" = "yes"; then + AC_MSG_CHECKING(whether gcc supports precompiling c++ header files) + if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then + kde_gcc_supports_pch=yes + AC_MSG_RESULT(yes) + else + kde_gcc_supports_pch=no + AC_MSG_RESULT(no) + fi + fi + rm -f conftest.h conftest.h.gch + fi + + KDE_CHECK_FOR_OPT_NOINLINE_MATCH + if test "x$kde_cv_opt_noinline_match" = "xno" ; then + CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`" + fi + fi + AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes") + if test "$CXX" = "KCC"; then + dnl unfortunately we currently cannot disable exception support in KCC + dnl because doing so is binary incompatible and Qt by default links with exceptions :-( + dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"]) + dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= ) + + if test "$kde_use_pch" = "yes"; then + dnl TODO: support --pch-dir! + KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"]) + dnl the below works (but the dir must exist), but it's + dnl useless for a whole package. + dnl The are precompiled headers for each source file, so when compiling + dnl from scratch, it doesn't make a difference, and they take up + dnl around ~5Mb _per_ sourcefile. + dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp, + dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"]) + fi + dnl this flag controls inlining. by default KCC inlines in optimisation mode + dnl all implementations that are defined inside the class {} declaration. + dnl because of templates-compatibility with broken gcc compilers, this + dnl can cause excessive inlining. This flag limits it to a sane level + KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"]) + KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"]) + KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"]) + KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"]) + dnl Some source files are shared between multiple executables + dnl (or libraries) and some of those need template instantiations. + dnl In that case KCC needs to compile those sources with + dnl --one_instantiation_per_object. To make it easy for us we compile + dnl _all_ objects with that flag (--one_per is a shorthand). + KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"]) + fi + AC_SUBST(USE_EXCEPTIONS) + dnl obsolete macro - provided to keep things going + USE_RTTI= + AC_SUBST(USE_RTTI) + + case "$host" in + *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;; + *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";; + *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";; + *-*-solaris*) + if test "$GXX" = yes; then + libstdcpp=`$CXX -print-file-name=libstdc++.so` + if test ! -f $libstdcpp; then + AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so]) + fi + fi + ;; + esac + + AC_VALIDIFY_CXXFLAGS + + AC_PROG_CXXCPP + + if test "$GCC" = yes; then + NOOPT_CFLAGS=-O0 + fi + KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0]) + + AC_ARG_ENABLE(coverage, + AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [ + if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then + ac_coverage_compiler="-fprofile-arcs -ftest-coverage" + ac_coverage_linker="-lgcc" + elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then + ac_coverage_compiler="-fprofile-arcs -ftest-coverage" + ac_coverage_linker="" + else + AC_MSG_ERROR([coverage with your compiler is not supported]) + fi + CFLAGS="$CFLAGS $ac_coverage_compiler" + CXXFLAGS="$CXXFLAGS $ac_coverage_compiler" + LDFLAGS="$LDFLAGS $ac_coverage_linker" + ]) + + AC_SUBST(NOOPT_CXXFLAGS) + AC_SUBST(NOOPT_CFLAGS) + AC_SUBST(ENABLE_PERMISSIVE_FLAG) + + KDE_CHECK_NEW_LDFLAGS + KDE_CHECK_FINAL + KDE_CHECK_CLOSURE + KDE_CHECK_NMCHECK + + ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), []) +]) + +AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG], + [ + AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + safe_CXXFLAGS=$CXXFLAGS + safe_LDFLAGS=$LDFLAGS + CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0" + LDFLAGS="$LDFLAGS -shared -fPIC" + + AC_TRY_LINK( + [ + /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */ + #include + int some_function( void ) __attribute__ ((visibility("default"))); + int some_function( void ) + { + std::string s("blafasel"); + return 0; + } + ], [/* elvis is alive */], + kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes) + + CXXFLAGS=$safe_CXXFLAGS + LDFLAGS=$safe_LDFLAGS + AC_LANG_RESTORE + ] + ) + + if test x$kde_cv_val_gcc_visibility_bug = xno; then + CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" + fi + ] +) + +AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY], +[ + AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY]) + + AC_MSG_CHECKING([grepping for visibility push/pop in headers]) + + if test "x$GXX" = "xyes"; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_EGREP_CPP( + [GCC visibility push], + [ #include + ], + [ + AC_MSG_RESULT(yes) + kde_stdc_visibility_patched=yes ], + [ + AC_MSG_RESULT(no) + AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for + visibility support. Disabling -fvisibility=hidden]) + + kde_stdc_visibility_patched=no ]) + + AC_LANG_RESTORE + + kde_have_gcc_visibility=no + KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, + [ + kde_have_gcc_visibility=yes + dnl the whole toolchain is just a mess, gcc is just too buggy + dnl to handle STL with visibility enabled. Lets reconsider + dnl when gcc 4.2 is out or when things get fixed in the compiler. + dnl Contact mueller@kde.org for details. + AC_ARG_ENABLE(gcc-hidden-visibility, + AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]), + [kde_have_gcc_visibility=$enableval], + [kde_have_gcc_visibility=no]) + + AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + safe_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $all_includes" + + AC_TRY_COMPILE( + [ +#include +#if Q_EXPORT - 0 != 0 +/* if this compiles, then Q_EXPORT is undefined */ +/* if Q_EXPORT is nonempty, this will break compilation */ +#endif + ], [/* elvis is alive */], + kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes) + + CXXFLAGS=$safe_CXXFLAGS + AC_LANG_RESTORE + ] + ) + + if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then + CXXFLAGS="$CXXFLAGS -fvisibility=hidden" + KDE_CHECK_VISIBILITY_GCC_BUG + HAVE_GCC_VISIBILITY=1 + AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported]) + fi + ]) + fi +]) + +AC_DEFUN([KDE_ADD_DEPENDENCIES], +[ + [A]M_DEPENDENCIES(CC) + [A]M_DEPENDENCIES(CXX) +]) + +dnl just a wrapper to clean up configure.in +AC_DEFUN([KDE_PROG_LIBTOOL], +[ +AC_REQUIRE([AC_CHECK_COMPILERS]) +AC_REQUIRE([AC_ENABLE_SHARED]) +AC_REQUIRE([AC_ENABLE_STATIC]) + +AC_REQUIRE([AC_LIBTOOL_DLOPEN]) +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_OBJEXT +AC_EXEEXT + +AM_PROG_LIBTOOL +AC_LIBTOOL_CXX + +LIBTOOL_SHELL="/bin/sh ./libtool" +# LIBTOOL="$LIBTOOL --silent" +KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" +AC_SUBST(KDE_PLUGIN) + +# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs. +KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)" +AC_SUBST(KDE_CHECK_PLUGIN) + +# we patch configure quite some so we better keep that consistent for incremental runs +AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure') +]) + +AC_DEFUN([KDE_CHECK_LIB64], +[ + AC_ARG_ENABLE(libsuffix, + AC_HELP_STRING([--enable-libsuffix], + [/lib directory suffix (64,32,none,auto[=default])]), + kdelibsuff=$enableval, kdelibsuff="auto") + + if test "$kdelibsuff" = "auto"; then + +cat > conftest.c << EOF +#include +int main() { + return 0; +} +EOF + kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{ + s,.*/lib\([[^\/]]*\)/.*,\1, + p +}'` + rm -rf conftest.* + fi + + if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then + kdelibsuff= + fi + if test -z "$kdelibsuff"; then + AC_MSG_RESULT([not using lib directory suffix]) + AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories) + else + if test "$libdir" = '${exec_prefix}/lib'; then + libdir="$libdir${kdelibsuff}" + AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms + fi + AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories) + AC_MSG_RESULT([using lib directory suffix $kdelibsuff]) + fi +]) + +AC_DEFUN([KDE_CHECK_TYPES], +[ AC_CHECK_SIZEOF(int, 4)dnl + AC_CHECK_SIZEOF(short)dnl + AC_CHECK_SIZEOF(long, 4)dnl + AC_CHECK_SIZEOF(char *, 4)dnl +])dnl + +dnl Not used - kept for compat only? +AC_DEFUN([KDE_DO_IT_ALL], +[ +AC_CANONICAL_SYSTEM +AC_ARG_PROGRAM +AM_INIT_AUTOMAKE($1, $2) +AM_DISABLE_LIBRARIES +AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) +AC_CHECK_COMPILERS +KDE_PROG_LIBTOOL +AM_KDE_WITH_NLS +AC_PATH_KDE +]) + +AC_DEFUN([AC_CHECK_RPATH], +[ +AC_MSG_CHECKING(for rpath) +AC_ARG_ENABLE(rpath, + AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]), + USE_RPATH=$enableval, USE_RPATH=yes) + +if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then + + KDE_RPATH="-R \$(libdir)" + + if test "$kde_libraries" != "$libdir"; then + KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)" + fi + + if test -n "$qt_libraries"; then + KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)" + fi + dnl $x_libraries is set to /usr/lib in case + if test -n "$X_LDFLAGS"; then + X_RPATH="-R \$(x_libraries)" + KDE_RPATH="$KDE_RPATH $X_RPATH" + fi + if test -n "$KDE_EXTRA_RPATH"; then + KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)" + fi +fi +AC_SUBST(KDE_EXTRA_RPATH) +AC_SUBST(KDE_RPATH) +AC_SUBST(X_RPATH) +AC_MSG_RESULT($USE_RPATH) +]) + +dnl Check for the type of the third argument of getsockname +AC_DEFUN([AC_CHECK_SOCKLEN_T], +[ + AC_MSG_CHECKING(for socklen_t) + AC_CACHE_VAL(kde_cv_socklen_t, + [ + AC_LANG_PUSH(C++) + kde_cv_socklen_t=no + AC_TRY_COMPILE([ + #include + #include + ], + [ + socklen_t len; + getpeername(0,0,&len); + ], + [ + kde_cv_socklen_t=yes + kde_cv_socklen_t_equiv=socklen_t + ]) + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT($kde_cv_socklen_t) + if test $kde_cv_socklen_t = no; then + AC_MSG_CHECKING([for socklen_t equivalent for socket functions]) + AC_CACHE_VAL(kde_cv_socklen_t_equiv, + [ + kde_cv_socklen_t_equiv=int + AC_LANG_PUSH(C++) + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ + #include + #include + ], + [ + $t len; + getpeername(0,0,&len); + ], + [ + kde_cv_socklen_t_equiv="$t" + break + ]) + done + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT($kde_cv_socklen_t_equiv) + fi + AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined]) + AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)]) +]) + +dnl This is a merge of some macros out of the gettext aclocal.m4 +dnl since we don't need anything, I took the things we need +dnl the copyright for them is: +dnl > +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. +dnl > +dnl for this file it is relicensed under LGPL + +AC_DEFUN([AM_KDE_WITH_NLS], + [ + dnl If we use NLS figure out what method + + AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt, + [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then + AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + MSGFMT=$GMSGFMT + AC_SUBST(GMSGFMT) + AC_SUBST(MSGFMT) + + AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + AC_SUBST(XGETTEXT) + + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. + +# serial 1 +# Stephan Kulow: I appended a _KDE against name conflicts + +dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + + +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. + +# serial 1 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES]) + fi + fi]) + +dnl From Jim Meyering. +dnl FIXME: migrate into libit. + +AC_DEFUN([AM_FUNC_OBSTACK], +[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack, + [AC_TRY_LINK([#include "obstack.h"], + [struct obstack *mem;obstack_free(mem,(char *) 0)], + am_cv_func_obstack=yes, + am_cv_func_obstack=no)]) + if test $am_cv_func_obstack = yes; then + AC_DEFINE(HAVE_OBSTACK) + else + LIBOBJS="$LIBOBJS obstack.o" + fi +]) + +dnl From Jim Meyering. Use this if you use the GNU error.[ch]. +dnl FIXME: Migrate into libit + +AC_DEFUN([AM_FUNC_ERROR_AT_LINE], +[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, + [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], + am_cv_lib_error_at_line=yes, + am_cv_lib_error_at_line=no)]) + if test $am_cv_lib_error_at_line = no; then + LIBOBJS="$LIBOBJS error.o" + fi + AC_SUBST(LIBOBJS)dnl +]) + +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. + +# serial 1 +# Stephan Kulow: I put a KDE in it to avoid name conflicts + +AC_DEFUN([AM_KDE_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([AM_KDE_WITH_NLS])dnl + AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + AC_MSG_CHECKING(for stpcpy) + AC_CACHE_VAL(kde_cv_func_stpcpy, + [ + kde_safe_cxxflags=$CXXFLAGS + CXXFLAGS="-Werror" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + ], + [ + char buffer[200]; + stpcpy(buffer, buffer); + ], + kde_cv_func_stpcpy=yes, + kde_cv_func_stpcpy=no) + AC_LANG_RESTORE + CXXFLAGS=$kde_safe_cxxflags + ]) + AC_MSG_RESULT($kde_cv_func_stpcpy) + if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then + AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy]) + fi + + AM_LC_MESSAGES + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + ]) + +AC_DEFUN([AC_HAVE_XPM], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= + test -z "$XPM_INCLUDE" && XPM_INCLUDE= + + AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]), + xpm_test=$withval, xpm_test="yes") + if test "x$xpm_test" = xno; then + ac_cv_have_xpm=no + else + AC_MSG_CHECKING(for XPM) + AC_CACHE_VAL(ac_cv_have_xpm, + [ + ac_save_ldflags="$LDFLAGS" + ac_save_cflags="$CFLAGS" + if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then + LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET" + else + LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET" + fi + CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES" + test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS" + AC_TRY_LINK([#include ],[], + ac_cv_have_xpm="yes",ac_cv_have_xpm="no") + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + ])dnl + + if test "$ac_cv_have_xpm" = no; then + AC_MSG_RESULT(no) + XPM_LDFLAGS="" + XPMINC="" + $2 + else + AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support]) + if test "$XPM_LDFLAGS" = ""; then + XPMLIB='-lXpm $(LIB_X11)' + else + XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)' + fi + if test "$XPM_INCLUDE" = ""; then + XPMINC="" + else + XPMINC="-I$XPM_INCLUDE" + fi + AC_MSG_RESULT(yes) + $1 + fi + fi + AC_SUBST(XPMINC) + AC_SUBST(XPMLIB) +]) + +AC_DEFUN([AC_HAVE_DPMS], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS= + test -z "$DPMS_INCLUDE" && DPMS_INCLUDE= + DPMS_LIB= + + AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]), + dpms_test=$withval, dpms_test="yes") + if test "x$dpms_test" = xno; then + ac_cv_have_dpms=no + else + AC_MSG_CHECKING(for DPMS) + dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms. + dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms". + AC_CACHE_VAL(ac_cv_have_dpms, + [ + if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then + AC_MSG_RESULT(no) + ac_cv_have_dpms="no" + else + ac_save_ldflags="$LDFLAGS" + ac_save_cflags="$CFLAGS" + ac_save_libs="$LIBS" + LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries" + LIBS="-lX11 -lXext $LIBSOCKET" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AC_TRY_LINK([ + #include + #include + #include + #include + int foo_test_dpms() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], + ac_cv_have_dpms="yes", [ + LIBS="-lXdpms $LIBS" + AC_TRY_LINK([ + #include + #include + #include + #include + int foo_test_dpms() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], + [ + ac_cv_have_dpms="-lXdpms" + ],ac_cv_have_dpms="no") + ]) + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + LIBS="$ac_save_libs" + fi + ])dnl + + if test "$ac_cv_have_dpms" = no; then + AC_MSG_RESULT(no) + DPMS_LDFLAGS="" + DPMSINC="" + $2 + else + AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support]) + if test "$ac_cv_have_dpms" = "-lXdpms"; then + DPMS_LIB="-lXdpms" + fi + if test "$DPMS_LDFLAGS" = ""; then + DPMSLIB="$DPMS_LIB "'$(LIB_X11)' + else + DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)' + fi + if test "$DPMS_INCLUDE" = ""; then + DPMSINC="" + else + DPMSINC="-I$DPMS_INCLUDE" + fi + AC_MSG_RESULT(yes) + $1 + fi + fi + ac_save_cflags="$CFLAGS" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO, + [Define if you have the DPMSCapable prototype in ]) + AC_CHECK_DECL(DPMSCapable, + AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),, + [#include + #include ]) + AH_TEMPLATE(HAVE_DPMSINFO_PROTO, + [Define if you have the DPMSInfo prototype in ]) + AC_CHECK_DECL(DPMSInfo, + AC_DEFINE(HAVE_DPMSINFO_PROTO),, + [#include + #include ]) + CFLAGS="$ac_save_cflags" + AC_SUBST(DPMSINC) + AC_SUBST(DPMSLIB) +]) + +AC_DEFUN([AC_HAVE_GL], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$GL_LDFLAGS" && GL_LDFLAGS= + test -z "$GL_INCLUDE" && GL_INCLUDE= + + AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]), + gl_test=$withval, gl_test="yes") + if test "x$kde_use_qt_emb" = "xyes"; then + # GL and Qt Embedded is a no-go for now. + ac_cv_have_gl=no + elif test "x$gl_test" = xno; then + ac_cv_have_gl=no + else + AC_MSG_CHECKING(for GL) + AC_CACHE_VAL(ac_cv_have_gl, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_ldflags=$LDFLAGS + ac_save_cxxflags=$CXXFLAGS + ac_save_libs=$LIBS + LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries" + LIBS="$LIBS -lGL -lGLU" + test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11" + LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET" + CXXFLAGS="$CFLAGS $X_INCLUDES" + test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" + AC_TRY_LINK([#include +#include +], [], + ac_cv_have_gl="yes", ac_cv_have_gl="no") + AC_LANG_RESTORE + LDFLAGS=$ac_save_ldflags + CXXFLAGS=$ac_save_cxxflags + LIBS=$ac_save_libs + ])dnl + + if test "$ac_cv_have_gl" = "no"; then + AC_MSG_RESULT(no) + GL_LDFLAGS="" + GLINC="" + $2 + else + AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)]) + if test "$GL_LDFLAGS" = ""; then + GLLIB='-lGLU -lGL $(LIB_X11)' + else + GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)' + fi + if test "$GL_INCLUDE" = ""; then + GLINC="" + else + GLINC="-I$GL_INCLUDE" + fi + AC_MSG_RESULT($ac_cv_have_gl) + $1 + fi + fi + AC_SUBST(GLINC) + AC_SUBST(GLLIB) +]) + + + dnl shadow password and PAM magic - maintained by ossi@kde.org + +AC_DEFUN([KDE_PAM], [ + AC_REQUIRE([KDE_CHECK_LIBDL]) + + want_pam= + AC_ARG_WITH(pam, + AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]), + [ if test "x$withval" = "xyes"; then + want_pam=yes + pam_service=kde + elif test "x$withval" = "xno"; then + want_pam=no + else + want_pam=yes + pam_service=$withval + fi + ], [ pam_service=kde ]) + + use_pam= + PAMLIBS= + if test "x$want_pam" != xno; then + AC_CHECK_LIB(pam, pam_start, [ + AC_CHECK_HEADER(security/pam_appl.h, + [ pam_header=security/pam_appl.h ], + [ AC_CHECK_HEADER(pam/pam_appl.h, + [ pam_header=pam/pam_appl.h ], + [ + AC_MSG_WARN([PAM detected, but no headers found! +Make sure you have the necessary development packages installed.]) + ] + ) + ] + ) + ], , $LIBDL) + if test -z "$pam_header"; then + if test "x$want_pam" = xyes; then + AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!]) + fi + else + AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)]) + PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL" + use_pam=yes + + dnl darwin claims to be something special + if test "$pam_header" = "pam/pam_appl.h"; then + AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/]) + fi + + dnl test whether struct pam_message is const (Linux) or not (Sun) + AC_MSG_CHECKING(for const pam_message) + AC_EGREP_HEADER([struct pam_message], $pam_header, + [ AC_EGREP_HEADER([const struct pam_message], $pam_header, + [AC_MSG_RESULT([const: Linux-type PAM])], + [AC_MSG_RESULT([nonconst: Sun-type PAM]) + AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])] + )], + [AC_MSG_RESULT([not found - assume const, Linux-type PAM])]) + fi + fi + + AC_SUBST(PAMLIBS) +]) + +dnl DEF_PAM_SERVICE(arg name, full name, define name) +AC_DEFUN([DEF_PAM_SERVICE], [ + AC_ARG_WITH($1-pam, + AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]), + [ if test "x$use_pam" = xyes; then + $3_PAM_SERVICE=$withval + else + AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected. +You may want to enforce it by using --with-pam.]) + fi + ], + [ if test "x$use_pam" = xyes; then + $3_PAM_SERVICE="$pam_service" + fi + ]) + if test -n "$$3_PAM_SERVICE"; then + AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE]) + AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2]) + fi + AC_SUBST($3_PAM_SERVICE) +]) + +AC_DEFUN([KDE_SHADOWPASSWD], [ + AC_REQUIRE([KDE_PAM]) + + AC_CHECK_LIB(shadow, getspent, + [ LIBSHADOW="-lshadow" + ac_use_shadow=yes + ], + [ dnl for UnixWare + AC_CHECK_LIB(gen, getspent, + [ LIBGEN="-lgen" + ac_use_shadow=yes + ], + [ AC_CHECK_FUNC(getspent, + [ ac_use_shadow=yes ], + [ ac_use_shadow=no ]) + ]) + ]) + AC_SUBST(LIBSHADOW) + AC_SUBST(LIBGEN) + + AC_MSG_CHECKING([for shadow passwords]) + + AC_ARG_WITH(shadow, + AC_HELP_STRING([--with-shadow],[If you want shadow password support]), + [ if test "x$withval" != "xno"; then + use_shadow=yes + else + use_shadow=no + fi + ], [ + use_shadow="$ac_use_shadow" + ]) + + if test "x$use_shadow" = xyes; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords]) + else + AC_MSG_RESULT(no) + LIBSHADOW= + LIBGEN= + fi + + dnl finally make the relevant binaries setuid root, if we have shadow passwds. + dnl this still applies, if we could use it indirectly through pam. + if test "x$use_shadow" = xyes || + ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then + case $host in + *-*-freebsd* | *-*-netbsd* | *-*-openbsd*) + SETUIDFLAGS="-m 4755 -o root";; + *) + SETUIDFLAGS="-m 4755";; + esac + fi + AC_SUBST(SETUIDFLAGS) + +]) + +AC_DEFUN([KDE_PASSWDLIBS], [ + AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT + AC_REQUIRE([KDE_PAM]) + AC_REQUIRE([KDE_SHADOWPASSWD]) + + if test "x$use_pam" = "xyes"; then + PASSWDLIBS="$PAMLIBS" + else + PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN" + fi + + dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but + dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires + dnl root to read, so kcheckpass needs to be root (even when using pam, since pam + dnl may need to read /etc/master.passwd). + case $host in + *-*-freebsd*) + SETUIDFLAGS="-m 4755 -o root" + ;; + *) + ;; + esac + + AC_SUBST(PASSWDLIBS) +]) + +AC_DEFUN([KDE_CHECK_LIBDL], +[ +AC_CHECK_LIB(dl, dlopen, [ +LIBDL="-ldl" +ac_cv_have_dlfcn=yes +]) + +AC_CHECK_LIB(dld, shl_unload, [ +LIBDL="-ldld" +ac_cv_have_shload=yes +]) + +AC_SUBST(LIBDL) +]) + +AC_DEFUN([KDE_CHECK_DLOPEN], +[ +KDE_CHECK_LIBDL +AC_CHECK_HEADERS(dlfcn.h dl.h) +if test "$ac_cv_header_dlfcn_h" = "no"; then + ac_cv_have_dlfcn=no +fi + +if test "$ac_cv_header_dl_h" = "no"; then + ac_cv_have_shload=no +fi + +dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE +dnl (MM) +AC_ARG_ENABLE(dlopen, +AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]), +enable_dlopen=$enableval, +enable_dlopen=yes) + +# override the user's opinion, if we know it better ;) +if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then + enable_dlopen=no +fi + +if test "$ac_cv_have_dlfcn" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn]) +fi + +if test "$ac_cv_have_shload" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload]) +fi + +if test "$enable_dlopen" = no ; then + test -n "$1" && eval $1 +else + test -n "$2" && eval $2 +fi + +]) + +AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING], +[ +KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no) +KDE_PROG_LIBTOOL +AC_MSG_CHECKING([dynamic loading]) +eval "`egrep '^build_libtool_libs=' libtool`" +if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then + dynamic_loading=yes + AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING) +else + dynamic_loading=no +fi +AC_MSG_RESULT($dynamic_loading) +if test "$dynamic_loading" = "yes"; then + $1 +else + $2 +fi +]) + +AC_DEFUN([KDE_ADD_INCLUDES], +[ +if test -z "$1"; then + test_include="Pix.h" +else + test_include="$1" +fi + +AC_MSG_CHECKING([for libg++ ($test_include)]) + +AC_CACHE_VAL(kde_cv_libgpp_includes, +[ +kde_cv_libgpp_includes=no + + for ac_dir in \ + \ + /usr/include/g++ \ + /usr/include \ + /usr/unsupported/include \ + /opt/include \ + $extra_include \ + ; \ + do + if test -r "$ac_dir/$test_include"; then + kde_cv_libgpp_includes=$ac_dir + break + fi + done +]) + +AC_MSG_RESULT($kde_cv_libgpp_includes) +if test "$kde_cv_libgpp_includes" != "no"; then + all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES" +fi +]) +]) + +AC_DEFUN([KDE_CHECK_LIBPTHREAD], +[ + dnl This code is here specifically to handle the + dnl various flavors of threading library on FreeBSD + dnl 4-, 5-, and 6-, and the (weird) rules around it. + dnl There may be an environment PTHREAD_LIBS that + dnl specifies what to use; otherwise, search for it. + dnl -pthread is special cased and unsets LIBPTHREAD + dnl below if found. + LIBPTHREAD="" + + if test -n "$PTHREAD_LIBS"; then + if test "x$PTHREAD_LIBS" = "x-pthread" ; then + LIBPTHREAD="PTHREAD" + else + PTHREAD_LIBS_save="$PTHREAD_LIBS" + PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'` + AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS]) + KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [ + LIBPTHREAD="$PTHREAD_LIBS_save"]) + PTHREAD_LIBS="$PTHREAD_LIBS_save" + fi + fi + + dnl Is this test really needed, in the face of the Tru64 test below? + if test -z "$LIBPTHREAD"; then + AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"]) + fi + + dnl This is a special Tru64 check, see BR 76171 issue #18. + if test -z "$LIBPTHREAD" ; then + AC_MSG_CHECKING([for pthread_create in -lpthread]) + kde_safe_libs=$LIBS + LIBS="$LIBS -lpthread" + AC_TRY_LINK([#include ],[(void)pthread_create(0,0,0,0);],[ + AC_MSG_RESULT(yes) + LIBPTHREAD="-lpthread"],[ + AC_MSG_RESULT(no)]) + LIBS=$kde_safe_libs + fi + + dnl Un-special-case for FreeBSD. + if test "x$LIBPTHREAD" = "xPTHREAD" ; then + LIBPTHREAD="" + fi + + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([KDE_CHECK_PTHREAD_OPTION], +[ + USE_THREADS="" + if test -z "$LIBPTHREAD"; then + KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"]) + fi + + AH_VERBATIM(__svr_define, [ +#if defined(__SVR4) && !defined(__svr4__) +#define __svr4__ 1 +#endif +]) + case $host_os in + solaris*) + KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) + CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" + ;; + freebsd*) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS" + ;; + aix*) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + LIBPTHREAD="$LIBPTHREAD -lc_r" + ;; + linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" + if test "$CXX" = "KCC"; then + CXXFLAGS="$CXXFLAGS --thread_safe" + NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe" + fi + ;; + *) + ;; + esac + AC_SUBST(USE_THREADS) + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([KDE_CHECK_THREADING], +[ + AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) + AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION]) + dnl default is yes if libpthread is found and no if no libpthread is available + if test -z "$LIBPTHREAD"; then + if test -z "$USE_THREADS"; then + kde_check_threading_default=no + else + kde_check_threading_default=yes + fi + else + kde_check_threading_default=yes + fi + AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]), + kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default) + if test "x$kde_use_threading" = "xyes"; then + AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) + fi +]) + +AC_DEFUN([KDE_TRY_LINK_PYTHON], +[ +if test "$kde_python_link_found" = no; then + +if test "$1" = normal; then + AC_MSG_CHECKING(if a Python application links) +else + AC_MSG_CHECKING(if Python depends on $2) +fi + +AC_CACHE_VAL(kde_cv_try_link_python_$1, +[ +kde_save_cflags="$CFLAGS" +CFLAGS="$CFLAGS $PYTHONINC" +kde_save_libs="$LIBS" +LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET" +kde_save_ldflags="$LDFLAGS" +LDFLAGS="$LDFLAGS $PYTHONLIB" + +AC_TRY_LINK( +[ +#include +],[ + PySys_SetArgv(1, 0); +], + [kde_cv_try_link_python_$1=yes], + [kde_cv_try_link_python_$1=no] +) +CFLAGS="$kde_save_cflags" +LIBS="$kde_save_libs" +LDFLAGS="$kde_save_ldflags" +]) + +if test "$kde_cv_try_link_python_$1" = "yes"; then + AC_MSG_RESULT(yes) + kde_python_link_found=yes + if test ! "$1" = normal; then + LIBPYTHON="$LIBPYTHON $2" + fi + $3 +else + AC_MSG_RESULT(no) + $4 +fi + +fi + +]) + +AC_DEFUN([KDE_CHECK_PYTHON_DIR], +[ +AC_MSG_CHECKING([for Python directory]) + +AC_CACHE_VAL(kde_cv_pythondir, +[ + if test -z "$PYTHONDIR"; then + kde_cv_pythondir=/usr/local + else + kde_cv_pythondir="$PYTHONDIR" + fi +]) + +AC_ARG_WITH(pythondir, +AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]), +[ + ac_python_dir=$withval +], ac_python_dir=$kde_cv_pythondir +) + +AC_MSG_RESULT($ac_python_dir) +]) + +AC_DEFUN([KDE_CHECK_PYTHON_INTERN], +[ +AC_REQUIRE([KDE_CHECK_LIBDL]) +AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) +AC_REQUIRE([KDE_CHECK_PYTHON_DIR]) + +if test -z "$1"; then + version="1.5" +else + version="$1" +fi + +AC_MSG_CHECKING([for Python$version]) + +python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes" +AC_FIND_FILE(Python.h, $python_incdirs, python_incdir) +if test ! -r $python_incdir/Python.h; then + AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir) + python_incdir=$python_incdir/python$version + if test ! -r $python_incdir/Python.h; then + python_incdir=no + fi +fi + +PYTHONINC=-I$python_incdir + +python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs" +AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir) +if test ! -r $python_libdir/libpython$version.so; then + AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir) + if test ! -r $python_libdir/libpython$version.a; then + AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir) + python_libdir=$python_libdir/python$version/config + if test ! -r $python_libdir/libpython$version.a; then + python_libdir=no + fi + fi +fi + +PYTHONLIB=-L$python_libdir +kde_orig_LIBPYTHON=$LIBPYTHON +if test -z "$LIBPYTHON"; then + LIBPYTHON=-lpython$version +fi + +AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir) +python_moddir=$python_moddir/python$version +if test ! -r $python_moddir/copy.py; then + python_moddir=no +fi + +PYTHONMODDIR=$python_moddir + +AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir) + +if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then + LIBPYTHON=$kde_orig_LIBPYTHON + test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB="" + test "x$PYTHONINC" = "x-Ino" && PYTHONINC="" + $2 +else + dnl Note: this test is very weak + kde_python_link_found=no + KDE_TRY_LINK_PYTHON(normal) + KDE_TRY_LINK_PYTHON(m, -lm) + KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD) + KDE_TRY_LINK_PYTHON(tcl, -ltcl) + KDE_TRY_LINK_PYTHON(db2, -ldb2) + KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil]) + KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil]) + KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm]) + KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [], + [AC_MSG_WARN([it seems, Python depends on another library. + Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this + and contact the authors to let them know about this problem]) + ]) + + LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET" + AC_SUBST(PYTHONINC) + AC_SUBST(PYTHONLIB) + AC_SUBST(LIBPYTHON) + AC_SUBST(PYTHONMODDIR) + AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python]) +fi + +]) + + +AC_DEFUN([KDE_CHECK_PYTHON], +[ + KDE_CHECK_PYTHON_INTERN("2.5", + [KDE_CHECK_PYTHON_INTERN("2.4", + [KDE_CHECK_PYTHON_INTERN("2.3", + [KDE_CHECK_PYTHON_INTERN("2.2", + [KDE_CHECK_PYTHON_INTERN("2.1", + [KDE_CHECK_PYTHON_INTERN("2.0", + [KDE_CHECK_PYTHON_INTERN($1, $2) ]) + ]) + ]) + ]) + ]) + ]) +]) + +AC_DEFUN([KDE_CHECK_STL], +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`" + + AC_MSG_CHECKING([if C++ programs can be compiled]) + AC_CACHE_VAL(kde_cv_stl_works, + [ + AC_TRY_COMPILE([ +#include +using namespace std; +],[ + string astring="Hallo Welt."; + astring.erase(0, 6); // now astring is "Welt" + return 0; +], kde_cv_stl_works=yes, + kde_cv_stl_works=no) +]) + + AC_MSG_RESULT($kde_cv_stl_works) + + if test "$kde_cv_stl_works" = "yes"; then + # back compatible + AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI]) + else + AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs. +Check config.log for details - if you're using a Linux distribution you might miss +a package named similar to libstdc++-dev.]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + +AC_DEFUN([AC_FIND_QIMGIO], + [AC_REQUIRE([AC_FIND_JPEG]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for qimgio]) +AC_CACHE_VAL(ac_cv_lib_qimgio, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_save_LIBS="$LIBS" +ac_save_CXXFLAGS="$CXXFLAGS" +LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT" +CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" +AC_TRY_RUN(dnl +[ +#include +#include +int main() { + QString t = "hallo"; + t.fill('t'); + qInitImageIO(); +} +], + ac_cv_lib_qimgio=yes, + ac_cv_lib_qimgio=no, + ac_cv_lib_qimgio=no) +LIBS="$ac_save_LIBS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_LANG_RESTORE +])dnl +if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then + LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG" + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available]) + AC_SUBST(LIBQIMGIO) +else + AC_MSG_RESULT(not found) +fi +]) + +AC_DEFUN([AM_DISABLE_LIBRARIES], +[ + AC_PROVIDE([AM_ENABLE_STATIC]) + AC_PROVIDE([AM_ENABLE_SHARED]) + enable_static=no + enable_shared=yes +]) + + +AC_DEFUN([AC_CHECK_UTMP_FILE], +[ + AC_MSG_CHECKING([for utmp file]) + + AC_CACHE_VAL(kde_cv_utmp_file, + [ + kde_cv_utmp_file=no + + for ac_file in \ + \ + /var/run/utmp \ + /var/adm/utmp \ + /etc/utmp \ + ; \ + do + if test -r "$ac_file"; then + kde_cv_utmp_file=$ac_file + break + fi + done + ]) + + if test "$kde_cv_utmp_file" != "no"; then + AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries]) + $1 + AC_MSG_RESULT($kde_cv_utmp_file) + else + $2 + AC_MSG_RESULT([non found]) + fi +]) + + +AC_DEFUN([KDE_CREATE_SUBDIRSLIST], +[ + +DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin" +TOPSUBDIRS="" + +if test ! -s $srcdir/subdirs; then + dnl Note: Makefile.common creates subdirs, so this is just a fallback + files=`cd $srcdir && ls -1` + dirs=`for i in $files; do if test -d $i; then echo $i; fi; done` + for i in $dirs; do + echo $i >> $srcdir/subdirs + done +fi + +ac_topsubdirs= +if test -s $srcdir/inst-apps; then + ac_topsubdirs="`cat $srcdir/inst-apps`" +elif test -s $srcdir/subdirs; then + ac_topsubdirs="`cat $srcdir/subdirs`" +fi + +for i in $ac_topsubdirs; do + AC_MSG_CHECKING([if $i should be compiled]) + if test -d $srcdir/$i; then + install_it="yes" + for j in $DO_NOT_COMPILE; do + if test $i = $j; then + install_it="no" + fi + done + else + install_it="no" + fi + AC_MSG_RESULT($install_it) + vari=`echo $i | sed -e 's,[[-+.@]],_,g'` + if test $install_it = "yes"; then + TOPSUBDIRS="$TOPSUBDIRS $i" + eval "$vari""_SUBDIR_included=yes" + else + eval "$vari""_SUBDIR_included=no" + fi +done + +AC_SUBST(TOPSUBDIRS) +]) + +AC_DEFUN([KDE_CHECK_NAMESPACES], +[ +AC_MSG_CHECKING(whether C++ compiler supports namespaces) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([ +], +[ +namespace Foo { + extern int i; + namespace Bar { + extern int i; + } +} + +int Foo::i = 0; +int Foo::Bar::i = 1; +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_NAMESPACES) +], [ +AC_MSG_RESULT(no) +]) +AC_LANG_RESTORE +]) + +dnl ------------------------------------------------------------------------ +dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_CHECK_S_ISSOCK], +[ +AC_MSG_CHECKING(for S_ISSOCK) +AC_CACHE_VAL(ac_cv_have_s_issock, +[ +AC_TRY_LINK( +[ +#include +], +[ +struct stat buff; +int b = S_ISSOCK( buff.st_mode ); +], +ac_cv_have_s_issock=yes, +ac_cv_have_s_issock=no) +]) +AC_MSG_RESULT($ac_cv_have_s_issock) +if test "$ac_cv_have_s_issock" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.]) +fi + +AH_VERBATIM(_ISSOCK, +[ +#ifndef HAVE_S_ISSOCK +#define HAVE_S_ISSOCK +#define S_ISSOCK(mode) (1==0) +#endif +]) + +]) + +dnl ------------------------------------------------------------------------ +dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_CHECK_KDEMAXPATHLEN], +[ +AC_MSG_CHECKING(for MAXPATHLEN) +AC_CACHE_VAL(ac_cv_maxpathlen, +[ +cat > conftest.$ac_ext < +#endif +#include +#include +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +KDE_HELLO MAXPATHLEN + +EOF + +ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out" + +if AC_TRY_EVAL(ac_try) && test -s conftest.out; then + ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out` +else + ac_cv_maxpathlen=1024 +fi + +rm conftest.* + +]) +AC_MSG_RESULT($ac_cv_maxpathlen) +AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] ) +]) + +AC_DEFUN([KDE_CHECK_HEADER], +[ + kde_safe_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $all_includes" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_CHECK_HEADER([$1], [$2], [$3], [$4]) + AC_LANG_RESTORE + CPPFLAGS=$kde_safe_cppflags +]) + +AC_DEFUN([KDE_CHECK_HEADERS], +[ + AH_CHECK_HEADERS([$1]) + AC_LANG_SAVE + kde_safe_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $all_includes" + AC_LANG_CPLUSPLUS + AC_CHECK_HEADERS([$1], [$2], [$3], [$4]) + CPPFLAGS=$kde_safe_cppflags + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_FAST_CONFIGURE], +[ + dnl makes configure fast (needs perl) + AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]), + with_fast_perl=$enableval, with_fast_perl=yes) +]) + +AC_DEFUN([KDE_CONF_FILES], +[ + val= + if test -f $srcdir/configure.files ; then + val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files` + fi + CONF_FILES= + if test -n "$val" ; then + for i in $val ; do + CONF_FILES="$CONF_FILES $i" + done + fi + AC_SUBST(CONF_FILES) +])dnl + +dnl This sets the prefix, for arts and kdelibs +dnl Do NOT use in any other module. +dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde +AC_DEFUN([KDE_SET_PREFIX_CORE], +[ + unset CDPATH + dnl make $KDEDIR the default for the installation + AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) + + if test "x$prefix" = "xNONE"; then + prefix=$ac_default_prefix + ac_configure_args="$ac_configure_args --prefix=$prefix" + fi + # And delete superfluous '/' to make compares easier + prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + + kde_libs_prefix='$(prefix)' + kde_libs_htmldir='$(kde_htmldir)' + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) + KDE_FAST_CONFIGURE + KDE_CONF_FILES +]) + + +AC_DEFUN([KDE_SET_PREFIX], +[ + unset CDPATH + dnl We can't give real code to that macro, only a value. + dnl It only matters for --help, since we set the prefix in this function anyway. + AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix}) + + KDE_SET_DEFAULT_BINDIRS + if test "x$prefix" = "xNONE"; then + dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend) + else + dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH + kde_save_PATH="$PATH" + PATH="$exec_prefix/bin:$prefix/bin:$PATH" + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend) + PATH="$kde_save_PATH" + fi + + kde_libs_prefix=`$KDECONFIG --prefix` + if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then + AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs. + This means it has been moved since you installed it. + This won't work. Please recompile kdelibs for the new prefix. + ]) + fi + kde_libs_htmldir=`$KDECONFIG --install html --expandvars` + + AC_MSG_CHECKING([where to install]) + if test "x$prefix" = "xNONE"; then + prefix=$kde_libs_prefix + AC_MSG_RESULT([$prefix (as returned by kde-config)]) + else + dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different + given_prefix=$prefix + AC_MSG_RESULT([$prefix (as requested)]) + fi + + # And delete superfluous '/' to make compares easier + prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + + AC_SUBST(KDECONFIG) + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) + + KDE_FAST_CONFIGURE + KDE_CONF_FILES +]) + +pushdef([AC_PROG_INSTALL], +[ + dnl our own version, testing for a -p flag + popdef([AC_PROG_INSTALL]) + dnl as AC_PROG_INSTALL works as it works we first have + dnl to save if the user didn't specify INSTALL, as the + dnl autoconf one overwrites INSTALL and we have no chance to find + dnl out afterwards + test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL + test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM + test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT + AC_PROG_INSTALL + + if test -z "$kde_save_INSTALL_given" ; then + # OK, user hasn't given any INSTALL, autoconf found one for us + # now we test, if it supports the -p flag + AC_MSG_CHECKING(for -p flag to install) + rm -f confinst.$$.* > /dev/null 2>&1 + echo "Testtest" > confinst.$$.orig + ac_res=no + if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then + if test -f confinst.$$.new ; then + # OK, -p seems to do no harm to install + INSTALL="${INSTALL} -p" + ac_res=yes + fi + fi + rm -f confinst.$$.* + AC_MSG_RESULT($ac_res) + fi + dnl the following tries to resolve some signs and wonders coming up + dnl with different autoconf/automake versions + dnl e.g.: + dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s + dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS) + dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s + dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has + dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the + dnl install-@DIR@PROGRAMS targets to explicitly use that flag + dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as + dnl INSTALL_SCRIPT, which breaks with automake <= 1.4 + dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure + dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from + dnl automake (due to broken Makefile.am or whatever) to install programs, + dnl and so does not see the -s flag in automake > 1.4 + dnl to clean up that mess we: + dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG + dnl which cleans KDE's program with automake > 1.4; + dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems + dnl with automake<=1.4 + dnl note that dues to this sometimes two '-s' flags are used (if KDE + dnl properly uses install-@DIR@PROGRAMS, but I don't care + dnl + dnl And to all this comes, that I even can't write in comments variable + dnl names used by automake, because it is so stupid to think I wanted to + dnl _use_ them, therefor I have written A_M_... instead of AM_ + dnl hmm, I wanted to say something ... ahh yes: Arghhh. + + if test -z "$kde_save_INSTALL_PROGRAM_given" ; then + INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)' + fi + if test -z "$kde_save_INSTALL_SCRIPT_given" ; then + INSTALL_SCRIPT='${INSTALL}' + fi +])dnl + +AC_DEFUN([KDE_LANG_CPLUSPLUS], +[AC_LANG_CPLUSPLUS +ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' +pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS]) +]) + +pushdef([AC_LANG_CPLUSPLUS], +[popdef([AC_LANG_CPLUSPLUS]) +KDE_LANG_CPLUSPLUS +]) + +AC_DEFUN([KDE_CHECK_LONG_LONG], +[ +AC_MSG_CHECKING(for long long) +AC_CACHE_VAL(kde_cv_c_long_long, +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_LINK([], [ + long long foo = 0; + foo = foo+1; + ], + kde_cv_c_long_long=yes, kde_cv_c_long_long=no) + AC_LANG_RESTORE +]) +AC_MSG_RESULT($kde_cv_c_long_long) +if test "$kde_cv_c_long_long" = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype]) +fi +]) + +AC_DEFUN([KDE_CHECK_LIB], +[ + kde_save_LDFLAGS="$LDFLAGS" + dnl AC_CHECK_LIB modifies LIBS, so save it here + kde_save_LIBS="$LIBS" + LDFLAGS="$LDFLAGS $all_libraries" + case $host_os in + aix*) LDFLAGS="-brtl $LDFLAGS" + test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS" + ;; + esac + AC_CHECK_LIB($1, $2, $3, $4, $5) + LDFLAGS="$kde_save_LDFLAGS" + LIBS="$kde_save_LIBS" +]) + +AC_DEFUN([KDE_JAVA_PREFIX], +[ + dir=`dirname "$1"` + base=`basename "$1"` + list=`ls -1 $dir 2> /dev/null` + for entry in $list; do + if test -d $dir/$entry/bin; then + case $entry in + $base) + javadirs="$javadirs $dir/$entry/bin" + ;; + esac + elif test -d $dir/$entry/jre/bin; then + case $entry in + $base) + javadirs="$javadirs $dir/$entry/jre/bin" + ;; + esac + fi + done +]) + +dnl KDE_CHEC_JAVA_DIR(onlyjre) +AC_DEFUN([KDE_CHECK_JAVA_DIR], +[ + +AC_ARG_WITH(java, +AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]), +[ ac_java_dir=$withval +], ac_java_dir="" +) + +AC_MSG_CHECKING([for Java]) + +dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH +if test "x$ac_java_dir" = "xno"; then + kde_java_bindir=no + kde_java_includedir=no + kde_java_libjvmdir=no + kde_java_libgcjdir=no + kde_java_libhpidir=no +else + if test "x$ac_java_dir" = "x"; then + + + dnl No option set -> collect list of candidate paths + if test -n "$JAVA_HOME"; then + KDE_JAVA_PREFIX($JAVA_HOME) + fi + KDE_JAVA_PREFIX(/usr/j2se) + KDE_JAVA_PREFIX(/usr/lib/j2se) + KDE_JAVA_PREFIX(/usr/j*dk*) + KDE_JAVA_PREFIX(/usr/lib/j*dk*) + KDE_JAVA_PREFIX(/opt/j*sdk*) + KDE_JAVA_PREFIX(/usr/lib/java*) + KDE_JAVA_PREFIX(/usr/java*) + KDE_JAVA_PREFIX(/usr/java/j*dk*) + KDE_JAVA_PREFIX(/usr/java/j*re*) + KDE_JAVA_PREFIX(/usr/lib/SunJava2*) + KDE_JAVA_PREFIX(/usr/lib/SunJava*) + KDE_JAVA_PREFIX(/usr/lib/IBMJava2*) + KDE_JAVA_PREFIX(/usr/lib/IBMJava*) + KDE_JAVA_PREFIX(/opt/java*) + + kde_cv_path="NONE" + kde_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + if test -d "$dir"; then + javadirs="$javadirs $dir" + fi + done + IFS=$kde_save_IFS + jredirs= + + dnl Now javadirs contains a list of paths that exist, all ending with bin/ + for dir in $javadirs; do + dnl Check for the java executable + if test -x "$dir/java"; then + dnl And also check for a libjvm.so somewhere under there + dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big. + if test "$dir" != "/usr/bin"; then + libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + if test ! -f $libjvmdir/libjvm.so; then continue; fi + jredirs="$jredirs $dir" + fi + fi + done + + dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found + JAVAC= + JAVA= + kde_java_bindir=no + for dir in $jredirs; do + JAVA="$dir/java" + kde_java_bindir=$dir + if test -x "$dir/javac"; then + JAVAC="$dir/javac" + break + fi + done + + if test -n "$JAVAC"; then + dnl this substitution might not work - well, we test for jni.h below + kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'` + else + kde_java_includedir=no + fi + else + dnl config option set + kde_java_bindir=$ac_java_dir/bin + if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then + kde_java_includedir=no + else + kde_java_includedir=$ac_java_dir/include + fi + fi +fi + +dnl At this point kde_java_bindir and kde_java_includedir are either set or "no" +if test "x$kde_java_bindir" != "xno"; then + + dnl Look for libjvm.so + kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + dnl Look for libgcj.so + kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1` + dnl Look for libhpi.so and avoid green threads + kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1` + + dnl Now check everything's fine under there + dnl the include dir is our flag for having the JDK + if test -d "$kde_java_includedir"; then + if test ! -x "$kde_java_bindir/javac"; then + AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.]) + fi + if test ! -x "$kde_java_bindir/javah"; then + AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + if test ! -x "$kde_java_bindir/jar"; then + AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + if test ! -r "$kde_java_includedir/jni.h"; then + AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.]) + fi + + jni_includes="-I$kde_java_includedir" + dnl Strange thing, jni.h requires jni_md.h which is under genunix here.. + dnl and under linux here.. + + dnl not needed for gcj + + if test "x$kde_java_libgcjdir" = "x"; then + test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux" + test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris" + test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix" + fi + + else + JAVAC= + jni_includes= + fi + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libjvmdir/libjvm.so"; then + AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.]) + fi + else + if test ! -r "$kde_java_libgcjdir/libgcj.so"; then + AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.]) + fi + fi + + if test ! -x "$kde_java_bindir/java"; then + AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + + dnl not needed for gcj compile + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libhpidir/libhpi.so"; then + AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.]) + fi + fi + + if test -n "$jni_includes"; then + dnl Check for JNI version + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_cxxflags_safe="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $all_includes $jni_includes" + + AC_TRY_COMPILE([ + #include + ], + [ + #ifndef JNI_VERSION_1_2 + Syntax Error + #endif + ],[ kde_jni_works=yes ], + [ kde_jni_works=no ]) + + if test $kde_jni_works = no; then + AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h. + You need to have Java Development Kit (JDK) version 1.2. + + Use --with-java to specify another location. + Use --without-java to configure without java support. + Or download a newer JDK and try again. + See e.g. http://java.sun.com/products/jdk/1.2 ]) + fi + + CXXFLAGS="$ac_cxxflags_safe" + AC_LANG_RESTORE + + dnl All tests ok, inform and subst the variables + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + if test "x$kde_java_libgcjdir" = "x"; then + JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi" + else + JVMLIBS="-L$kde_java_libgcjdir -lgcj" + fi + AC_MSG_RESULT([java JDK in $kde_java_bindir]) + + else + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([java JRE in $kde_java_bindir]) + fi +elif test -d "/Library/Java/Home"; then + kde_java_bindir="/Library/Java/Home/bin" + jni_includes="-I/Library/Java/Home/include" + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + JVMLIBS="-Wl,-framework,JavaVM" + + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([Apple Java Framework]) +else + AC_MSG_RESULT([none found]) +fi + +AC_SUBST(JAVAC) +AC_SUBST(JAVAH) +AC_SUBST(JAR) +AC_SUBST(JVMLIBS) +AC_SUBST(jni_includes) + +# for backward compat +kde_cv_java_includedir=$kde_java_includedir +kde_cv_java_bindir=$kde_java_bindir +]) + +dnl this is a redefinition of autoconf 2.5x's AC_FOREACH. +dnl When the argument list becomes big, as in KDE for AC_OUTPUT in +dnl big packages, m4_foreach is dog-slow. So use our own version of +dnl it. (matz@kde.org) +m4_define([mm_foreach], +[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])]) +m4_define([mm_car], [[$1]]) +m4_define([mm_car2], [[$@]]) +m4_define([_mm_foreach], +[m4_if(m4_quote($2), [], [], + [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1], + mm_car2(m4_shift($2)), + [$3])])]) +m4_define([AC_FOREACH], +[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) + +AC_DEFUN([KDE_NEED_FLEX], +[ +kde_libs_safe=$LIBS +LIBS="$LIBS $USER_LDFLAGS" +AM_PROG_LEX +LIBS=$kde_libs_safe +if test -z "$LEXLIB"; then + AC_MSG_ERROR([You need to have flex installed.]) +fi +AC_SUBST(LEXLIB) +]) + +AC_DEFUN([AC_PATH_QTOPIA], +[ + dnl TODO: use AC_CACHE_VAL + + if test -z "$1"; then + qtopia_minver_maj=1 + qtopia_minver_min=5 + qtopia_minver_pat=0 + else + qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"` + qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"` + qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"` + fi + + qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat" + qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat" + + AC_REQUIRE([AC_PATH_QT]) + + AC_MSG_CHECKING([for Qtopia]) + + LIB_QTOPIA="-lqpe" + AC_SUBST(LIB_QTOPIA) + + kde_qtopia_dirs="$QPEDIR /opt/Qtopia" + + ac_qtopia_incdir=NO + + AC_ARG_WITH(qtopia-dir, + AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]), + [ ac_qtopia_incdir="$withval"/include] ) + + qtopia_incdirs="" + for dir in $kde_qtopia_dirs; do + qtopia_incdirs="$qtopia_incdirs $dir/include" + done + + if test ! "$ac_qtopia_incdir" = "NO"; then + qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs" + fi + + qtopia_incdir="" + AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir) + ac_qtopia_incdir="$qtopia_incdir" + + if test -z "$qtopia_incdir"; then + AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.]) + fi + + qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`; + qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`; + qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`; + + qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat" + qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat" + if test "$qtopia_ver" -lt "$qtopia_minver"; then + AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr +is required.]) + fi + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + ac_cxxflags_safe="$CXXFLAGS" + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes" + LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" + LIBS="$LIBS $LIB_QTOPIA $LIBQT" + + cat > conftest.$ac_ext < +#include + +int main( int argc, char **argv ) +{ + QPEApplication app( argc, argv ); + return 0; +} +EOF + + if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* + else + rm -f conftest* + AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at +the end of config.log]) + fi + + CXXFLAGS="$ac_cxxflags_safe" + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + AC_LANG_RESTORE + + QTOPIA_INCLUDES="-I$qtopia_incdir" + AC_SUBST(QTOPIA_INCLUDES) + + AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir]) +]) + + +AC_DEFUN([KDE_INIT_DOXYGEN], +[ +AC_MSG_CHECKING([for Qt docs]) +kde_qtdir= +if test "${with_qt_dir+set}" = set; then + kde_qtdir="$with_qt_dir" +fi + +AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) +AC_MSG_RESULT($QTDOCDIR) + +AC_SUBST(QTDOCDIR) + +KDE_FIND_PATH(dot, DOT, [], []) +if test -n "$DOT"; then + KDE_HAVE_DOT="YES" +else + KDE_HAVE_DOT="NO" +fi +AC_SUBST(KDE_HAVE_DOT) +KDE_FIND_PATH(doxygen, DOXYGEN, [], []) +AC_SUBST(DOXYGEN) + +DOXYGEN_PROJECT_NAME="$1" +DOXYGEN_PROJECT_NUMBER="$2" +AC_SUBST(DOXYGEN_PROJECT_NAME) +AC_SUBST(DOXYGEN_PROJECT_NUMBER) + +KDE_HAS_DOXYGEN=no +if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then + KDE_HAS_DOXYGEN=yes +fi +AC_SUBST(KDE_HAS_DOXYGEN) + +]) + + +AC_DEFUN([AC_FIND_BZIP2], +[ +AC_MSG_CHECKING([for bzDecompress in libbz2]) +AC_CACHE_VAL(ac_cv_lib_bzip2, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET" +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK(dnl +[ +#define BZ_NO_STDIO +#include +], + [ bz_stream s; (void) bzDecompress(&s); ], + eval "ac_cv_lib_bzip2='-lbz2'", + eval "ac_cv_lib_bzip2=no") +LIBS="$kde_save_LIBS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE +])dnl +AC_MSG_RESULT($ac_cv_lib_bzip2) + +if test ! "$ac_cv_lib_bzip2" = no; then + BZIP2DIR=bzip2 + + LIBBZ2="$ac_cv_lib_bzip2" + AC_SUBST(LIBBZ2) + +else + + cxx_shared_flag= + ld_shared_flag= + KDE_CHECK_COMPILER_FLAG(shared, [ + ld_shared_flag="-shared" + ]) + KDE_CHECK_COMPILER_FLAG(fPIC, [ + cxx_shared_flag="-fPIC" + ]) + + AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2]) + AC_CACHE_VAL(ac_cv_lib_bzip2_prefix, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + kde_save_LIBS="$LIBS" + LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET" + kde_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES" + + AC_TRY_LINK(dnl + [ + #define BZ_NO_STDIO + #include + ], + [ bz_stream s; (void) BZ2_bzDecompress(&s); ], + eval "ac_cv_lib_bzip2_prefix='-lbz2'", + eval "ac_cv_lib_bzip2_prefix=no") + LIBS="$kde_save_LIBS" + CXXFLAGS="$kde_save_CXXFLAGS" + AC_LANG_RESTORE + ])dnl + + AC_MSG_RESULT($ac_cv_lib_bzip2_prefix) + + if test ! "$ac_cv_lib_bzip2_prefix" = no; then + BZIP2DIR=bzip2 + + LIBBZ2="$ac_cv_lib_bzip2_prefix" + AC_SUBST(LIBBZ2) + + AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix]) + dnl else, we just ignore this + fi + +fi +AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR") +]) + +dnl ------------------------------------------------------------------------ +dnl Try to find the SSL headers and libraries. +dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed) +dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([KDE_CHECK_SSL], +[ +LIBSSL="-lssl -lcrypto" +AC_REQUIRE([KDE_CHECK_LIB64]) + +ac_ssl_includes=NO ac_ssl_libraries=NO +ssl_libraries="" +ssl_includes="" +AC_ARG_WITH(ssl-dir, + AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]), + [ ac_ssl_includes="$withval"/include + ac_ssl_libraries="$withval"/lib$kdelibsuff + ]) + +want_ssl=yes +AC_ARG_WITH(ssl, + AC_HELP_STRING([--without-ssl],[disable SSL checks]), + [want_ssl=$withval]) + +if test $want_ssl = yes; then + +AC_MSG_CHECKING(for OpenSSL) + +AC_CACHE_VAL(ac_cv_have_ssl, +[#try to guess OpenSSL locations + + ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes" + ssl_incdirs="$ac_ssl_includes $ssl_incdirs" + AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir) + ac_ssl_includes="$ssl_incdir" + + ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs" + if test ! "$ac_ssl_libraries" = "NO"; then + ssl_libdirs="$ac_ssl_libraries $ssl_libdirs" + fi + + test=NONE + ssl_libdir=NONE + for dir in $ssl_libdirs; do + try="ls -1 $dir/libssl*" + if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi + done + + ac_ssl_libraries="$ssl_libdir" + + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries" + LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref" + + AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();, + ac_ssl_rsaref="yes" + , + ac_ssl_rsaref="no" + ) + + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then + have_ssl=no + else + have_ssl=yes; + fi + + ]) + + eval "$ac_cv_have_ssl" + + AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes]) + + AC_MSG_CHECKING([whether OpenSSL uses rsaref]) + AC_MSG_RESULT($ac_ssl_rsaref) + + AC_MSG_CHECKING([for easter eggs]) + AC_MSG_RESULT([none found]) + +else + have_ssl=no +fi + +if test "$have_ssl" = yes; then + AC_MSG_CHECKING(for OpenSSL version) + dnl Check for SSL version + AC_CACHE_VAL(ac_cv_ssl_version, + [ + + cat >conftest.$ac_ext < +#include + int main() { + +#ifndef OPENSSL_VERSION_NUMBER + printf("ssl_version=\\"error\\"\n"); +#else + if (OPENSSL_VERSION_NUMBER < 0x00906000) + printf("ssl_version=\\"old\\"\n"); + else + printf("ssl_version=\\"ok\\"\n"); +#endif + return (0); + } +EOF + + ac_save_CPPFLAGS=$CPPFLAGS + if test "$ac_ssl_includes" != "/usr/include"; then + CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes" + fi + + if AC_TRY_EVAL(ac_link); then + + if eval `./conftest 2>&5`; then + if test $ssl_version = error; then + AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !]) + else + if test $ssl_version = old; then + AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.]) + have_ssl=no + fi + fi + ac_cv_ssl_version="ssl_version=$ssl_version" + else + AC_MSG_ERROR([Your system couldn't run a small SSL test program. + Check config.log, and if you can't figure it out, send a mail to + David Faure , attaching your config.log]) + fi + + else + AC_MSG_ERROR([Your system couldn't link a small SSL test program. + Check config.log, and if you can't figure it out, send a mail to + David Faure , attaching your config.log]) + fi + CPPFLAGS=$ac_save_CPPFLAGS + + ]) + + eval "$ac_cv_ssl_version" + AC_MSG_RESULT($ssl_version) +fi + +if test "$have_ssl" != yes; then + LIBSSL=""; +else + AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL]) + ac_cv_have_ssl="have_ssl=yes \ + ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref" + + + ssl_libraries="$ac_ssl_libraries" + ssl_includes="$ac_ssl_includes" + + if test "$ac_ssl_rsaref" = yes; then + LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" + fi + + if test $ssl_version = "old"; then + AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6]) + fi +fi + +SSL_INCLUDES= + +if test "$ssl_includes" = "/usr/include"; then + if test -f /usr/kerberos/include/krb5.h; then + SSL_INCLUDES="-I/usr/kerberos/include" + fi +elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then + SSL_INCLUDES="-I$ssl_includes" +fi + +if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then + SSL_LDFLAGS="" +else + SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries" +fi + +AC_SUBST(SSL_INCLUDES) +AC_SUBST(SSL_LDFLAGS) +AC_SUBST(LIBSSL) +]) + +AC_DEFUN([KDE_CHECK_STRLCPY], +[ + AC_REQUIRE([AC_CHECK_STRLCAT]) + AC_REQUIRE([AC_CHECK_STRLCPY]) + AC_CHECK_SIZEOF(size_t) + AC_CHECK_SIZEOF(unsigned long) + + AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long]) + AC_TRY_COMPILE(,[ + #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG + choke me + #endif + ],AC_MSG_RESULT([yes]),[ + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + Apparently on your system our assumption sizeof size_t == sizeof unsigned long + does not apply. Please mail kde-devel@kde.org with a description of your system! + ]) + ]) +]) + +AC_DEFUN([KDE_CHECK_BINUTILS], +[ + AC_MSG_CHECKING([if ld supports unversioned version maps]) + + kde_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + echo "{ local: extern \"C++\" { foo }; };" > conftest.map + AC_TRY_LINK([int foo;], +[ +#ifdef __INTEL_COMPILER +icc apparently does not support libtools version-info and version-script +at the same time. Dunno where the bug is, but until somebody figured out, +better disable the optional version scripts. +#endif + + foo = 42; +], kde_supports_versionmaps=yes, kde_supports_versionmaps=no) + LDFLAGS="$kde_save_LDFLAGS" + rm -f conftest.map + AM_CONDITIONAL(include_VERSION_SCRIPT, + [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"]) + + AC_MSG_RESULT($kde_supports_versionmaps) +]) + +AC_DEFUN([AM_PROG_OBJC],[ +AC_CHECK_PROGS(OBJC, gcc, gcc) +test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH]) +if test "x${OBJCFLAGS-unset}" = xunset; then + OBJCFLAGS="-g -O2" +fi +AC_SUBST(OBJCFLAGS) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)]) +]) + +AC_DEFUN([KDE_CHECK_PERL], +[ + KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [ + AC_MSG_ERROR([No Perl found in your $PATH. +We need perl to generate some code.]) + ]) + AC_SUBST(PERL) +]) + +AC_DEFUN([KDE_CHECK_LARGEFILE], +[ +AC_SYS_LARGEFILE +if test "$ac_cv_sys_file_offset_bits" != no; then + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" +fi + +if test "x$ac_cv_sys_large_files" != "xno"; then + CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1" +fi + +]) + +dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in) +dnl which allows to search for libs that get installed into the KDE prefix. +dnl +dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not) +dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page +dnl also defines KSTUFF_PKG_ERRORS on error +AC_DEFUN([KDE_PKG_CHECK_MODULES], [ + + PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH" + if test "$prefix" != "$kde_libs_prefix"; then + PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH" + fi + export PKG_CONFIG_PATH + PKG_CHECK_MODULES([$1],[$2],[$3],[$4]) +]) + + +dnl Check for PIE support in the compiler and linker +AC_DEFUN([KDE_CHECK_PIE_SUPPORT], +[ + AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + safe_CXXFLAGS=$CXXFLAGS + safe_LDFLAGS=$LDFLAGS + CXXFLAGS="$CXXFLAGS -fPIE" + LDFLAGS="$LDFLAGS -pie" + + AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no]) + + CXXFLAGS=$safe_CXXFLAGS + LDFLAGS=$safe_LDFLAGS + AC_LANG_RESTORE + ]) + + AC_MSG_CHECKING(if enabling -pie/fPIE support) + + AC_ARG_ENABLE(pie, + AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]), + [kde_has_pie_support=$enableval], + [kde_has_pie_support=detect]) + + if test "$kde_has_pie_support" = "detect"; then + kde_has_pie_support=$kde_cv_val_pie_support + fi + + AC_MSG_RESULT([$kde_has_pie_support]) + + KDE_USE_FPIE="" + KDE_USE_PIE="" + + AC_SUBST([KDE_USE_FPIE]) + AC_SUBST([KDE_USE_PIE]) + + if test "$kde_has_pie_support" = "yes"; then + KDE_USE_FPIE="-fPIE" + KDE_USE_PIE="-pie" + fi +]) +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## 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. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LINUX_64_MODE="32" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + LINUX_64_MODE="64" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + libsuff= + if test "x$LINUX_64_MODE" = x64; then + # Some platforms are per default 64-bit, so there's no /lib64 + if test -d /lib64; then + libsuff=64 + fi + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* ) + lt_cv_deplibs_check_method=pass_all ;; + # the debian people say, arm and glibc 2.3.1 works for them with pass_all + arm* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup' + ;; + esac + fi + ;; + esac + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # KDE requires run time linking. Make it the default. + aix_use_runtimelinking=yes + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='-qmkshrobj ${wl}-G' + else + shared_flag='-qmkshrobj' + fi + fi + fi + + # Let the compiler handle the export list. + _LT_AC_TAGVAR(always_export_symbols, $1)=no + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGISTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + + # KDE requires run time linking. Make it the default. + aix_use_runtimelinking=yes + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='-qmkshrobj ${wl}-G' + else + shared_flag='-qmkshrobj' + fi + fi + fi + + # Let the compiler handle the export list. + _LT_AC_TAGVAR(always_export_symbols, $1)=no + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=no + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup' + ;; + esac + fi + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + +dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +dnl also defines GSTUFF_PKG_ERRORS on error +AC_DEFUN([PKG_CHECK_MODULES], [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) + fi +]) + + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..986ff00 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,881 @@ +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 13 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..d884d43 --- /dev/null +++ b/config.h.in @@ -0,0 +1,240 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_CARBON_CARBON_H + +/* Define if you have the CoreAudio API */ +#undef HAVE_COREAUDIO + +/* Define to 1 if you have the header file. */ +#undef HAVE_CRT_EXTERNS_H + +/* Defines if your system has the crypt function */ +#undef HAVE_CRYPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* define if the Konqueror plugin is compiled */ +#undef HAVE_KONQPLUGIN + +/* Define if you have libjpeg */ +#undef HAVE_LIBJPEG + +/* Define if you have libpng */ +#undef HAVE_LIBPNG + +/* Define if you have a working libpthread (will enable threaded code) */ +#undef HAVE_LIBPTHREAD + +/* Define if you have libz */ +#undef HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if your system needs _NSGetEnviron to set up the environment */ +#undef HAVE_NSGETENVIRON + +/* Define if you have res_init */ +#undef HAVE_RES_INIT + +/* Define if you have the res_init prototype */ +#undef HAVE_RES_INIT_PROTO + +/* Define if you have a STL implementation by SGI */ +#undef HAVE_SGI_STL + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have strlcat */ +#undef HAVE_STRLCAT + +/* Define if you have the strlcat prototype */ +#undef HAVE_STRLCAT_PROTO + +/* Define if you have strlcpy */ +#undef HAVE_STRLCPY + +/* Define if you have the strlcpy prototype */ +#undef HAVE_STRLCPY_PROTO + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BITYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Suffix for lib directories */ +#undef KDELIBSUFF + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `char *', as computed by sizeof. */ +#undef SIZEOF_CHAR_P + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Defined if compiling without arts */ +#undef WITHOUT_ARTS + +/* + * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system + * headers and I'm too lazy to write a configure test as long as only + * unixware is related + */ +#ifdef _UNIXWARE +#define HAVE_BOOLEAN +#endif + + + +/* + * AIX defines FD_SET in terms of bzero, but fails to include + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif + + + +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif + + + +#if !defined(HAVE_RES_INIT_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +int res_init(void); +#ifdef __cplusplus +} +#endif +#endif + + + +#if !defined(HAVE_STRLCAT_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +unsigned long strlcat(char*, const char*, unsigned long); +#ifdef __cplusplus +} +#endif +#endif + + + +#if !defined(HAVE_STRLCPY_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +unsigned long strlcpy(char*, const char*, unsigned long); +#ifdef __cplusplus +} +#endif +#endif + + + +/* + * On HP-UX, the declaration of vsnprintf() is needed every time ! + */ + +#if !defined(HAVE_VSNPRINTF) || defined(hpux) +#if __STDC__ +#include +#include +#else +#include +#endif +#ifdef __cplusplus +extern "C" +#endif +int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#ifdef __cplusplus +extern "C" +#endif +int snprintf(char *str, size_t n, char const *fmt, ...); +#endif + + + +#if defined(__SVR4) && !defined(__svr4__) +#define __svr4__ 1 +#endif + + +/* type to use in place of socklen_t if not defined */ +#undef kde_socklen_t + +/* type to use in place of socklen_t if not defined (deprecated, use + kde_socklen_t) */ +#undef ksize_t diff --git a/configure.files b/configure.files new file mode 100644 index 0000000..030bce8 --- /dev/null +++ b/configure.files @@ -0,0 +1,2 @@ +./admin/configure.in.min +configure.in.in diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..32d6675 --- /dev/null +++ b/configure.in @@ -0,0 +1,161 @@ +dnl ======================================================= +dnl FILE: ./admin/configure.in.min +dnl ======================================================= + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301, USA. + +# Original Author was Kalle@kde.org +# I lifted it in some mater. (Stephan Kulow) +# I used much code from Janos Farkas + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(acinclude.m4) dnl a source file from your sub dir + +dnl This is so we can use kde-common +AC_CONFIG_AUX_DIR(admin) + +dnl This ksh/zsh feature conflicts with `cd blah ; pwd` +unset CDPATH + +dnl Checking host/target/build systems, for make, install etc. +AC_CANONICAL_SYSTEM +dnl Perform program name transformation +AC_ARG_PROGRAM + +dnl Automake doc recommends to do this only here. (Janos) +AM_INIT_AUTOMAKE(smb4k, 0.9.4) dnl searches for some needed programs + +KDE_SET_PREFIX + +dnl generate the config header +AM_CONFIG_HEADER(config.h) dnl at the distribution this done + +dnl Checks for programs. +AC_CHECK_COMPILERS +AC_ENABLE_SHARED(yes) +AC_ENABLE_STATIC(no) +KDE_PROG_LIBTOOL + +dnl for NLS support. Call them in this order! +dnl WITH_NLS is for the po files +AM_KDE_WITH_NLS + +KDE_USE_QT(3.3.0) +AC_PATH_KDE +dnl ======================================================= +dnl FILE: configure.in.in +dnl ======================================================= + +#MIN_CONFIG(3.3.0) +#AM_KDE_MIN_VERSION(3.3.0) + +dnl PACKAGE set before + + +dnl=========================================================================dnl +dnl Konqueror plugin dnl +dnl=========================================================================dnl + +AC_ARG_WITH( + [konqplugin], + [AS_HELP_STRING([--with-konqplugin=ARG], + [build with Konqueror plugin (default ARG=yes)])], + [], + [with_konqplugin=yes]) + +if test x$with_konqplugin = xyes; then + KDE_CHECK_HEADER( + [konqsidebarplugin.h], + [AC_DEFINE(HAVE_KONQPLUGIN,1, + [define if the Konqueror plugin is compiled])], + [AC_MSG_ERROR([ +*** +*** Cannot build Konqueror plugin. Install the development files for KDE base +*** or pass the '--with-konqplugin=no' option to the configure script. +***])], + [] + ) +else + DO_NOT_COMPILE="$DO_NOT_COMPILE plugin" +fi + +AM_CONDITIONAL([compile_konqplugin], [test x$with_konqplugin = xyes]) +KDE_CREATE_SUBDIRSLIST +AC_CONFIG_FILES([ Makefile ]) +AC_CONFIG_FILES([ doc/Makefile ]) +AC_CONFIG_FILES([ doc/en/Makefile ]) +AC_CONFIG_FILES([ plugin/Makefile ]) +AC_CONFIG_FILES([ po/Makefile ]) +AC_CONFIG_FILES([ smb4k/Makefile ]) +AC_CONFIG_FILES([ smb4k/browser/Makefile ]) +AC_CONFIG_FILES([ smb4k/configdlg/Makefile ]) +AC_CONFIG_FILES([ smb4k/core/Makefile ]) +AC_CONFIG_FILES([ smb4k/dialogs/Makefile ]) +AC_CONFIG_FILES([ smb4k/icons/Makefile ]) +AC_CONFIG_FILES([ smb4k/iconview/Makefile ]) +AC_CONFIG_FILES([ smb4k/listview/Makefile ]) +AC_CONFIG_FILES([ smb4k/searchdlg/Makefile ]) +AC_CONFIG_FILES([ utilities/Makefile ]) +AC_OUTPUT +# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure +if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then + # And if so, warn when they don't match + if test "$kde_libs_prefix" != "$given_prefix"; then + # And if kde doesn't know about the prefix yet + echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null + if test $? -ne 0; then + echo "" + echo "Warning: you chose to install this package in $given_prefix," + echo "but KDE was found in $kde_libs_prefix." + echo "For this to work, you will need to tell KDE about the new prefix, by ensuring" + echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix" + echo "Then restart KDE." + echo "" + fi + fi +fi + +if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then + echo "" + echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility" + echo "was not included. Therefore, GCC symbol visibility support remains disabled." + echo "" + echo "For better performance, consider including the Qt visibility supporting patch" + echo "located at:" + echo "" + echo "http://bugs.kde.org/show_bug.cgi?id=109386" + echo "" + echo "and recompile all of Qt and KDE. Note, this is entirely optional and" + echo "everything will continue to work just fine without it." + echo "" +fi + +if test "$all_tests" = "bad"; then + if test ! "$cache_file" = "/dev/null"; then + echo "" + echo "Please remove the file $cache_file after changing your setup" + echo "so that configure will find the changes next time." + echo "" + fi +else + echo "" + echo "Good - your configure finished. Start make now" + echo "" +fi diff --git a/configure.in.in b/configure.in.in new file mode 100644 index 0000000..cf59121 --- /dev/null +++ b/configure.in.in @@ -0,0 +1,34 @@ +#MIN_CONFIG(3.3.0) +#AM_KDE_MIN_VERSION(3.3.0) + +AM_INIT_AUTOMAKE(smb4k,0.9.4) + + +dnl=========================================================================dnl +dnl Konqueror plugin dnl +dnl=========================================================================dnl + +AC_ARG_WITH( + [konqplugin], + [AS_HELP_STRING([--with-konqplugin=ARG], + [build with Konqueror plugin (default ARG=yes)])], + [], + [with_konqplugin=yes]) + +if test x$with_konqplugin = xyes; then + KDE_CHECK_HEADER( + [konqsidebarplugin.h], + [AC_DEFINE(HAVE_KONQPLUGIN,1, + [define if the Konqueror plugin is compiled])], + [AC_MSG_ERROR([ +*** +*** Cannot build Konqueror plugin. Install the development files for KDE base +*** or pass the '--with-konqplugin=no' option to the configure script. +***])], + [] + ) +else + DO_NOT_COMPILE="$DO_NOT_COMPILE plugin" +fi + +AM_CONDITIONAL([compile_konqplugin], [test x$with_konqplugin = xyes]) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..ba7ae35 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = en +KDE_DOCS = AUTO diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am new file mode 100644 index 0000000..14227c2 --- /dev/null +++ b/doc/en/Makefile.am @@ -0,0 +1,2 @@ +KDE_LANG = en +KDE_DOCS = smb4k diff --git a/doc/en/action_abort.png b/doc/en/action_abort.png new file mode 100644 index 0000000..a9a41ef Binary files /dev/null and b/doc/en/action_abort.png differ diff --git a/doc/en/action_authentication.png b/doc/en/action_authentication.png new file mode 100644 index 0000000..a1fe263 Binary files /dev/null and b/doc/en/action_authentication.png differ diff --git a/doc/en/action_configuration.png b/doc/en/action_configuration.png new file mode 100644 index 0000000..e8aa7ee Binary files /dev/null and b/doc/en/action_configuration.png differ diff --git a/doc/en/action_custom.png b/doc/en/action_custom.png new file mode 100644 index 0000000..ceff357 Binary files /dev/null and b/doc/en/action_custom.png differ diff --git a/doc/en/action_force_unmount.png b/doc/en/action_force_unmount.png new file mode 100644 index 0000000..df0de2d Binary files /dev/null and b/doc/en/action_force_unmount.png differ diff --git a/doc/en/action_konqueror.png b/doc/en/action_konqueror.png new file mode 100644 index 0000000..5553828 Binary files /dev/null and b/doc/en/action_konqueror.png differ diff --git a/doc/en/action_konsole.png b/doc/en/action_konsole.png new file mode 100644 index 0000000..b1429c5 Binary files /dev/null and b/doc/en/action_konsole.png differ diff --git a/doc/en/action_manual_mount.png b/doc/en/action_manual_mount.png new file mode 100644 index 0000000..95a57cf Binary files /dev/null and b/doc/en/action_manual_mount.png differ diff --git a/doc/en/action_mount.png b/doc/en/action_mount.png new file mode 100644 index 0000000..4b67714 Binary files /dev/null and b/doc/en/action_mount.png differ diff --git a/doc/en/action_preview.png b/doc/en/action_preview.png new file mode 100644 index 0000000..3c71316 Binary files /dev/null and b/doc/en/action_preview.png differ diff --git a/doc/en/action_print.png b/doc/en/action_print.png new file mode 100644 index 0000000..3b0eefc Binary files /dev/null and b/doc/en/action_print.png differ diff --git a/doc/en/action_quit.png b/doc/en/action_quit.png new file mode 100644 index 0000000..7404a10 Binary files /dev/null and b/doc/en/action_quit.png differ diff --git a/doc/en/action_rescan.png b/doc/en/action_rescan.png new file mode 100644 index 0000000..4a5096a Binary files /dev/null and b/doc/en/action_rescan.png differ diff --git a/doc/en/action_shares_views.png b/doc/en/action_shares_views.png new file mode 100644 index 0000000..7181313 Binary files /dev/null and b/doc/en/action_shares_views.png differ diff --git a/doc/en/action_synchronize.png b/doc/en/action_synchronize.png new file mode 100644 index 0000000..6271153 Binary files /dev/null and b/doc/en/action_synchronize.png differ diff --git a/doc/en/action_unmount.png b/doc/en/action_unmount.png new file mode 100644 index 0000000..df0de2d Binary files /dev/null and b/doc/en/action_unmount.png differ diff --git a/doc/en/action_unmount_all.png b/doc/en/action_unmount_all.png new file mode 100644 index 0000000..bdeaf14 Binary files /dev/null and b/doc/en/action_unmount_all.png differ diff --git a/doc/en/configuration_authentication.png b/doc/en/configuration_authentication.png new file mode 100644 index 0000000..da193b3 Binary files /dev/null and b/doc/en/configuration_authentication.png differ diff --git a/doc/en/configuration_network.png b/doc/en/configuration_network.png new file mode 100644 index 0000000..2814def Binary files /dev/null and b/doc/en/configuration_network.png differ diff --git a/doc/en/configuration_samba.png b/doc/en/configuration_samba.png new file mode 100644 index 0000000..64f1ed6 Binary files /dev/null and b/doc/en/configuration_samba.png differ diff --git a/doc/en/configuration_shares.png b/doc/en/configuration_shares.png new file mode 100644 index 0000000..ab67b1b Binary files /dev/null and b/doc/en/configuration_shares.png differ diff --git a/doc/en/configuration_superuser.png b/doc/en/configuration_superuser.png new file mode 100644 index 0000000..041d534 Binary files /dev/null and b/doc/en/configuration_superuser.png differ diff --git a/doc/en/configuration_synchronization.png b/doc/en/configuration_synchronization.png new file mode 100644 index 0000000..1e67aaa Binary files /dev/null and b/doc/en/configuration_synchronization.png differ diff --git a/doc/en/configuration_user_interface.png b/doc/en/configuration_user_interface.png new file mode 100644 index 0000000..985c834 Binary files /dev/null and b/doc/en/configuration_user_interface.png differ diff --git a/doc/en/dialog_authentication.png b/doc/en/dialog_authentication.png new file mode 100644 index 0000000..f1b0d7b Binary files /dev/null and b/doc/en/dialog_authentication.png differ diff --git a/doc/en/dialog_bookmark_editor.png b/doc/en/dialog_bookmark_editor.png new file mode 100644 index 0000000..9baaca9 Binary files /dev/null and b/doc/en/dialog_bookmark_editor.png differ diff --git a/doc/en/dialog_config_file_removal.png b/doc/en/dialog_config_file_removal.png new file mode 100644 index 0000000..ec00a58 Binary files /dev/null and b/doc/en/dialog_config_file_removal.png differ diff --git a/doc/en/dialog_custom_options.png b/doc/en/dialog_custom_options.png new file mode 100644 index 0000000..5d08d06 Binary files /dev/null and b/doc/en/dialog_custom_options.png differ diff --git a/doc/en/dialog_manual_mount.png b/doc/en/dialog_manual_mount.png new file mode 100644 index 0000000..f3bea97 Binary files /dev/null and b/doc/en/dialog_manual_mount.png differ diff --git a/doc/en/dialog_preview.png b/doc/en/dialog_preview.png new file mode 100644 index 0000000..d33b0a7 Binary files /dev/null and b/doc/en/dialog_preview.png differ diff --git a/doc/en/dialog_print_file.png b/doc/en/dialog_print_file.png new file mode 100644 index 0000000..1c698fe Binary files /dev/null and b/doc/en/dialog_print_file.png differ diff --git a/doc/en/dialog_question_force_unmounting.png b/doc/en/dialog_question_force_unmounting.png new file mode 100644 index 0000000..79d3b3e Binary files /dev/null and b/doc/en/dialog_question_force_unmounting.png differ diff --git a/doc/en/dialog_search.png b/doc/en/dialog_search.png new file mode 100644 index 0000000..e0cf137 Binary files /dev/null and b/doc/en/dialog_search.png differ diff --git a/doc/en/dialog_synchronization_input.png b/doc/en/dialog_synchronization_input.png new file mode 100644 index 0000000..73d7434 Binary files /dev/null and b/doc/en/dialog_synchronization_input.png differ diff --git a/doc/en/dialog_synchronization_progress.png b/doc/en/dialog_synchronization_progress.png new file mode 100644 index 0000000..71ed511 Binary files /dev/null and b/doc/en/dialog_synchronization_progress.png differ diff --git a/doc/en/error_programs_missing.png b/doc/en/error_programs_missing.png new file mode 100644 index 0000000..b4fc5d1 Binary files /dev/null and b/doc/en/error_programs_missing.png differ diff --git a/doc/en/index.docbook b/doc/en/index.docbook new file mode 100644 index 0000000..d29f63d --- /dev/null +++ b/doc/en/index.docbook @@ -0,0 +1,5299 @@ + +Smb4K"> + + + + +]> + + + + +The &smb4k; Handbook + + + +Alexander + +Reinholdt + +
+dustpuppy AT users.berlios.de +
+
+
+
+ + + + +2005-2007 +Alexander Reinholdt + + +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. + +This program is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied warranty +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public +License along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +2008-01-17 +1.2.1 + + +&smb4k; is an advanced network neighborhood browser and a front end to the programs of the Samba software suite. + + + +KDE +Smb4K +Samba + +
+ + + + + +Introduction + +This handbook describes &smb4k; 0.9.x and to some extent earlier versions. + +&smb4k; is an advanced network neighborhood browser and a front end to the programs of the Samba software suite. It provides many handy features that ease your life in a mostly Windows-dominated network environment: + + +Scanning for (active) workgroups, hosts, and shares +Mounting and unmounting of shares, including unmounting all shares at once +Support of the CIFS and SMBFS file system for mounting +Access to the files of a mounted share with either &konqueror; or &konsole; +Auto-detection of external mounts and unmounts +Remounting of previously used shares on program start-up +Miscellaneous infos about the remote network items and the mounted shares +Network search +WINS server support +Preview of shares +Selectable look-up and search methods +Default login +Ability to execute mount and umount SUID root (using super or sudo) +Special handling of homes shares +Ability to bookmark favorite shares +System tray widget +Support of advanced Samba options +Support of printer shares +Konqueror plugin +KWallet support +Synchronization of a remote share with a local copy and vice versa +Ability to define custom options for each and every share or server + + +If you encounter problems or bugs while using &smb4k;, please read the Trouble Shooting section of this handbook first. If you cannot find your problem described there, please ask for help on our Smb4K-general mailing list or go to our bug tracker and report it. + + + + + +Using &smb4k; + + +Running &smb4k; + +After the installation, you can run &smb4k; either from the K menu or from the command prompt by typing +$ smb4k & +&smb4k; does not take any arguments, except those that are known to all &kde; programs. + +During start-up, &smb4k; checks for all programs that are mandatorily needed to run the application. If some of them are missing or if the PATH environment variable is not set properly, &smb4k; shows an error message and exits. + + +Error dialog listing the missing programs + + + + + +Error dialog that lists the missing programs + + + + +You have to install the listed programs or add their location to the PATH environment variable in your shell's configuration file (for the bash1 shell it is the ~/.bashrc file) in order to be able to run the application. +If all programs have been found, the main window and the system tray widget will be shown and you can start working with &smb4k;. +Note: It is recommended that you configure Samba before using &smb4k;. The swat8 utility can be used for this purpose. It is part of the Samba software suite and provides an easy-to-use web interface. See its manual page for documentation. + +Starting with version 0.9.0, &smb4k; uses the KConfig XT configuration system. All previously defined settings are obsolete. To assure a clean transition the old configuration file $HOME/.kde/share/config/smb4krc will be removed the first time you start the new version of &smb4k;. A message box will warn you before the file is actually removed: + + +Warning message box + + + + + +The warning message box + + + + +If you plan to revert to a version < 0.9.0, you should cancel the removal and backup the old configuration file. + + + + +Overview +In the default configuration, the main window of &smb4k; looks like shown in the figure below: It is devided into two sections, the tab widget (3) on the left hand side, that contains the network browser and the search dialog, and the shares view (4) on the right hand side. Above them the menu bar (1) and tool bars (2) are located. Below them you find the status bar (5). + + +Screenshot of the main window + + + + + +The main window + + + + +The menu bar and tool bars contain all actions that are needed to interact with the network and the mounted shares. They are listed below. Please have a look at the sections dicussing the popup menus of the network browser and the shares view for additional information and some important warnings. +Menu items in the main window: + + + + + + + + +Rescan action + + + + + +Start a rescan of the entire network neighborhood. This action is enabled by default and will be disabled if a network scan is running. Please note that its behavior is slightly different from the one of the rescan action found in the popup menu of the network browser. + + + + + + + + +Abort action + + + + + +Stop any action performed by the network browser. This button is disabled by default and will only be enabled if a network scan is running or a share is being mounted. + + + + + + + + +Manual mount action + + + + + +Open the dialog for mounting shares manually. This feature may be needed if &smb4k; could not find a server from which you want to mount a certain shared resource. + + + + + + + + +Authentication action + + + + + +Open the authentication dialog for the selected server or share. The button is disabled if a workgroup or no item is selected. + + + + + + + + +Custom options action + + + + + +Open the Custom Options dialog for a selected server or share. The button is disabled if a workgroup or no item is selected. + + + + + + + + +Preview action + + + + + +Open the preview dialog. It is only enabled if a share is selected. Printer shares cannot be previewed. + + + + + + + + +Print file action + + + + + +Open the print dialog. It is only enabled if a printer share is selected. + + + + + + + + +Mount action + + + + + +Mount the selected share. By default and if a workgroup or server is selected, the button is disabled. + + + + + + + + +Unmount action + + + + + +Unmount the share that is selected in the shares view. Please note that the ability to unmount shares is by default restricted to the ones that are owned by you. You can change this behavior by changing the settings in the configuration dialog. If no share is selected in the shares view, this button is disabled. + + + + + + + + +Force unmount action + + + + + +Force the unmounting of a share. This feature is disable by default and you have to enable it in the configuration dialog. Since you can also force the unmounting of shares owned by other users, you have to be EXTREMELY CAUTIOUS when using it. + + + + + + + + +Unmount all action + + + + + +Unmount all shares at once. The restrictions noted above also apply here. If you do not have any shares mounted, this button is disabled. + + + + + + + + +Synchronize action + + + + + +Initiate the synchronization of the contents of a selected share. + + + + + + + + +Konsole action + + + + + +Open the contents of the selected share in &konsole;. + + + + + + + + +Konqueror action + + + + + +Open the contents of the selected share in &konqueror;. + + + + + + + + +Shares views action + + + + + +Choose which shares view you want to use. An icon view and a list view are available. + + + + + + + + +Configure Smb4K action + + + + + +Open the configuration dialog. + + + + + + + + +Quit action + + + + + +Quit &smb4k;. + + + +These actions also appear in the popup menus of either the network browser or the shares view. + +The status bar gives some information about the current status of &smb4k;. If the application is processing a user request (e.g. mounting a share), a descriptive message is displayed in the leftmost section and the progress bar next to the version information shows a busy indicator. + +The main window is highly configurable. You can hide/show the network browser and the search dialog by toggling the menu entries under SettingsDock Widgets. Both widgets can also be dragged around with the mouse and docked to one of the corners of the main window. You can even detach them from the main window. The status bar and the tool bars can be hidden/shown by toggling the menu entry SettingsHide Statusbar and the ones under SettingsToolbars, respectively. + + + + + +The Network Browser + +The interaction with the network neighborhood is done with the network browser. By default, it is located in the tab widget on the right hand side of the main window (see '3' in this figure). It contains all network items — i.e. workgroups, servers, and shares — &smb4k; was able to find. They are organized in a network tree, and you can navigate through it by clicking the [+] next to the item name or by executing the item itself. + + +Browsing +&smb4k; automatically scans the network neighborhood for active workgroups and domains on start-up and presents them in the network browser. Opening a workgroup item shows the servers belonging to it. If you want to access the shares of one of the servers, you have to open the desired server. +There are four methods to retrieve the browse list: The default one is to scan the network neighborhood for all available master browsers. The second and third method directly query a master browser to get the browse list. The difference is that the former is a dynamic one, where the current master browser of your workgroup or domain is looked up and used, and the latter is a static one, where a fixed name or IP address is used. It is recommended that you choose the dynamic method. However, there might be circumstances that make it necessary to use a static name or IP address. The last method searches for all registered IP addresses within a given broadcast area. This might come in handy on poorly performing network neighborhoods. + +Note: Under normal circumstances you shouldn't have any trouble browsing the network neighborhood. In case you experience problems, please read the Trouble Shooting section before thinking about reporting a bug. It lists some common problems and their solutions. + + + +Popup Menu +Although you can interact with the network using keyboard shortcuts, in most cases it is more convenient to use the mouse. By right clicking you can open a popup menu. It contains all actions that are available in the network browser. Depending on the position where you clicked (on a network item or on the viewport), some of them may be disabled. The figure below shows the popup menu opened on a remote share. + +Screenshot of the popup menu of the network browser + + + + + +The popup menu of the network browser + + + +The title of the popup menu is set to the name of the network item or displays Network if you clicked on the viewport. + +The following menu entries (actions) are available: + + + + + + + +&Ctrl; R + + +Scan Network|Workgroup|Computer + + + + +Scan the whole network neighborhood, a workgroup/domain, or a server. For your convenience, new network items will be added and obsolete ones removed without closing the network tree. + + + + + + + +&Ctrl; A + + +Abort + + + +Abort any running process that is network related. The entry is only enabled if &smb4k; is busy. Please note that this Abort action has a limited functionality compared to the one found in the menu and tool bar that aborts all running processes at once. + + + + + + + +&Ctrl; O + + +Mount Manually + + + +The mount dialog is opened. You can enter the name, IP address, and workgroup/domain of a share you want to mount manually. This feature comes in handy if the server where the share is located could not be found automatically. + + + + + + + +&Ctrl; T + + +Authentication + + + +The authentication dialog is opened. You can provide the login and password for the selected server or share. If no item or a workgroup is selected, this menu entry is disabled. + + + + + + + +&Ctrl; C + + +Custom Options + + + +The Custom Options dialog is opened. You can set several custom options for the selected server or remote share. If no item or a workgroup is selected, this menu entry is disabled. + + + + + + + +&Ctrl; B + + +Add Bookmark + + + +Add a bookmark. This menu entry is only available if a remote share is selected. + + + + + + + +&Ctrl; V + + +Preview + + + +Preview the contents of the selected remote share. + + + + + + + +&Ctrl; P + + +Print File + + + +Print a file on a remote printer. This menu item is only available if you selected a printer share. + + + + + + + +&Ctrl; M + + +Mount + + + +Mount the selected remote share. This menu entry is disabled if you click anything different than a share with type "Disk" or "IPC". + + + + + + +Tooltips +For each network item a tooltip is provided that contains various information like the name of the workgroup and master browser, the name and IP address of the host, the name of the share, etc. If a tooltip is requested for a server, it is queried for additional information about the operating system and the server (e.g. Samba). +The tooltips can be disabled in the configuration dialog. + + + +Mounting a Share +There are three options available to mount a remote share: + + +Execute the icon representing the remote share in the network browser. (Depending on your KDE settings, this is done by either single or double clicking the icon.) + + +Select the remote share and click the Mount menu entry. Alternatively, you can press the &Ctrl; M keyboard shortcut. + +If &smb4k; was not able to find the server where the share is located, you can press the &Ctrl; OMount Manually menu entry and a mount dialog will open: + +Screenshot of the "Mount Manually" dialog + + + + + +The "Mount Manually" dialog + + + +Here you must enter the share name in the form +//SERVER/SHARE +(This is also correct for FreeBSD users!). The OK button will be enabled and you can press it to mount the share. It is advisable, however, to enter the IP address and the workgroup of the server as well. If you want to add the share to the bookmarks at the same time, tick the Add this share to the bookmarks check box. + + +Often a share is password protected. In this case, an authentication dialog will appear and you have to enter the correct login and password. &smb4k; will proceed mounting the share unless a wrong user name or password was provided. In that case, the authentication dialog will reappear. If the mount process was successful, the share will appear in the shares view. +Please note, that &smb4k; mounts the shares with the CIFS file system by default. If you need to use the old SMBFS file system, you can change the setting in the configuration dialog. +If mounting fails, an error dialog will be shown with the error message that was returned either by smbmount8 or mount.cifs8. See the Trouble Shooting section for some of the most common errors and their possible solutions. + + + +Printing Files on Remote Printers +To print a file on a remote printer, open the print dialog by clicking the printer icon or choosing the &Ctrl; PPrint File menu item. + +Screenshot of the print dialog + + + + + +The print dialog + + + +In the Printer section various information about the printer is shown. Under File you have to provide the name of the file you want to print. The number of copies can be defined under Options >>. Press Print... to start the print process. The dialog will stay open until the print process ended. +&smb4k; currently supports PDF, Postscript, image, DVI, and text files. While the first three formats will directly be sent to the printer, the latter two need conversion. If you installed the programs dvips1 and enscript1, the DVI and text files will automatically be converted to Postscript before they are printed. +If you try to print a file with an unsupported mimetype or if the appropriate conversion program is missing, an error message box will appear telling you the mimetype is not supported. In this case you have to convert the file manually to Postscript or PDF or install the needed conversion program. + + + +Previewing Shares +&smb4k; provides the ability to preview remote shares. If you click the &Ctrl; VPreview menu entry, the contents of the selected remote share will be opened in a preview dialog. + +Screenshot of the preview dialog + + + + + +The preview dialog + + + +The preview dialog acts like a simple file manager. You can navigate through the contents of the remote share by clicking the directory icons in the list view, the Up, Back, and Forward button. The current location is displayed in the combo box on the right hand side. The Reload button reloads the contents of the current directory. + By default, the preview dialog only shows directories and files that are not hidden. You can change this behavior in the configuration dialog. File transfers or the like are not possible. + + + +Providing Authentication Information +Many servers or remote shares are password protected. In that case, a password dialog appears asking you for the user name and password. The same happens, if you click the &Ctrl; TAuthentication menu entry. + +Screenshot of the authentication dialog + + + + + +The authentication dialog + + + +If the authentication dialog opens due to a failed attempt to access a server or share, you will be presented with the reason for the failure. Otherwise, you will only be asked to provide the authentication data for the selected network item. +You have to enter the user name in the respective field. The password, however, may be left blank. Clicking the OK button will commit the data. Depending on your choice in the configuration dialog, the login and password will be stored permanently, temporarily or not all. In the latter case you will have to provide them every time they are needed. + + + +Defining Custom Options +If you need to define special options for a single server or share that are different from the global ones that are set in the configuration dialog, you can do this with the Custom Options dialog. It is opened by clicking the &Ctrl; CCustom Options menu entry. + +Screenshot of the custom options dialog for a share + + + + + +The custom options dialog + + + +Depending on your selection, the dialog will contain different entries. With servers the port, the protocol hint for the 'net' command, and the use of Kerberos can be set whereas with shares the port, the file system, the user ID, the group ID, the write access, and the use of Kerberos can be defined (see figure above). For detailed information on the individual settings, please see here. +The Default button is enabled if the entries in the dialog deviate from the default options you defined in the configuration dialog. By clicking it, you can reset the settings in the dialog to the default. The OK button is enabled if you changed the settings in the dialog. Clicking it will commit the settings and close the dialog. +Note: Under FreeBSD, the dialog contains less entries than when you run a different operating system, because several of the options are not supported. + + + +Adding Bookmarks +A bookmark is added by selecting a remote share (only these can be bookmarked) and pressing the &Ctrl; B keyboard shortcut or selecting the Add Bookmark menu item. It will then be accessible through the Bookmarks menu. See the section Handling Bookmarks for more details. +The bookmarks can be used to mount remote shares. + + + + + + +The Search Dialog +The Search Dialog is contained in the tab widget on the left hand side of the main window and can be opened by either clicking the tab or by pressing the &Ctrl; 2 keyboard shortcut. It consists of the combo box where you can enter the server you are looking for, the Search, Clear, and Add button, and the list view where the results of the search are displayed. + + +Screenshot of the search dialog + + + + + +The search dialog + + + + +To search for a host, you enter its NetBIOS name or IP address (see restrictions below), and press the Search button. If the server could be found, it appears with its workgroup and optionally its IP address in the list view. In the case the server is already in the network browser, the icon is in addition equipped with a checkmark. If the search failed, an error message will be displayed in the list view. +A server that is not already in the network browser can be added to it by clicking the Add button. It will then appear in its workgroup or domain. To remove the search results, click the Clear button. +&smb4k; is using nmblookup1 by default for searching. It is very reliable and should work well under most circumstances. Special configurations of the network neighborhood, however, make it sometimes necessary to use smbclient1 to look up servers. You can switch programs in the configuration dialog. Read the The Network Tab section to find out more. +Restrictions: smbclient1 cannot handle IP addresses correctly. Thus, if you are using this search method, you are restricted to the NetBIOS name. If you try to use an IP address, you will get an error message. + + + + + +The Shares View +In the shares view, you can interact with the mounted shares on your system. + + +Different Views +&smb4k; comes with two alternative views: the icon view (1) and the list view (2). + + +Screenshot of the shares icon view + + + + + +The shares icon view + + + + +The default view is the traditional icon view where the shares are displayed as icons along with their name or mount point. In the list view all shares are displayed with their name or mount point, the file system and the remote disk usage. More information can be included by adjusting the settings. + +You can switch between the two views by either selecting an entry from the Shares View menu or by changing the settings in the configuration dialog. +By default, you will only see your own mounts in the shares view. However, you can tell &smb4k; to show all mounts by altering the respective settings. + + + +Popup Menu +The popup menu includes all actions that can be performed on a mounted share. It can be opened by clicking the right mouse button. + +Screenshot of the popup menu of the shares view + + + + + +The popup menu of the shares view + + + +The actions accessible through the popup menu are: + + + + + + +&Ctrl; U + + +Unmount + + + +Unmount the selected share. By default, the ability to unmount a share is restricted to the ones that are owned by you. This behavior may be altered in the configuration dialog. +Warning: Please be EXTREMELY CAUTIOUS if you decide to enable the ability to unmount shares owned by other users! + + + + + + + +&Ctrl; F + + +Force Unmounting + + + +Perform a lazy unmount on a share. This menu item is only available under Linux and should only be used if a share became inaccessible and could not be unmounted by the Unmount action. To take advantage of it, you have to enable the respective option in the configuration dialog first. +Before a share is actually unmounted, a dialog will appear asking you to confirm the action: + +Screenshot of the dialog asking for confirmation if you want to force the unmounting of a share + + + + + +The dialog asking for confirmation if you want to force the unmounting of a share + + + +If you click the Yes button, the unmount will be carried out. The dialog can be disabled by checking the Do not ask again check box. The unmount will then be performed immediately and without confirmation. +Warning: Think twice before using this option! + + + + + + + +&Ctrl; N + + +Unmount All + + + +Unmount all mounted shares at once. By default, only your own shares will be unmounted. But you can enable the ability to unmount all shares that are mounted on the system in the configuration dialog. +Warning: Please be EXTREMELY CAUTIOUS if you decide to enable the ability to unmount shares owned by other users! + + + + + + + +&Ctrl; Y + + +Synchronize + + + +Start the synchronization of a share with a local copy or vice versa. This menu entry is only enabled if you installed the program rsync1. + + + + + + + +&Ctrl; L + + +Open with Konsole + + + +Open the base directory of a share in &konsole;. This menu item is useful if you need to run shell scripts, etc. + + + + + + + +&Ctrl; K + + +Open with Konqueror + + + +Open the contents of a share in Konqueror. + + + + + + +Tooltips +The tooltips provide information about the share name, the mount point, the login (CIFS file system) or the user and group (SMBFS file system), the file system, the disk usage, and the free disk space. If the share is inaccessible, this will be indicated in the tooltip. +Tooltips are enabled by default. You can deactivate them in the configuration dialog. + + + +Inaccessible Shares +&smb4k; checks all mounted CIFS and SMBFS shares whether they are still accessible. If an inaccessible share is encountered, it will be marked with a modified icon and you won't be able to open or synchronize it anymore. Unmounting will still be possible. +Note: The program may freeze for a short period and will recover afterwards. With the CIFS file system, the freeze will only take a few seconds even with many shares that went offline at once. If you are using SMBFS, this might take up to a few minutes. + + + +Icons +The shares views know three different icons that may be presented to the user: + +Screenshot of three different icons + + + + + +Three different icons + + + +The icon marked 'A' tells the user that this share is not accessible. &smb4k; won't allow you to open it or to do synchronization with it. You will only be able to unmount it. +All shares that look like 'B' are owned by another user. They are only shown if you adjusted the settings to display them. In the default configuration, you are not allowed to unmount these shares, but you can change this behavior. +Finally, the icon marked 'C' indicates that the share is online, accessible, and owned by you. You may perform all available actions on it. + + + +Drag-and-Drop +&smb4k; supports drag-and-drop in the shares views since version 0.8.0. However, these features are turned off by default, because they have some issues (see below). You can enable drag-and-drop support in the configuration dialog. + +Enabled drag support +You can drag a share icon from within the shares view onto the desktop or into another application (e.g. &konqueror;) and drop it there. You will then maybe get a popup menu asking you whether you want to copy, link or move the contents of the share. This is a KDE feature and cannot be switched off. Never choose to move the data, because this will move it from the remote share to your hard drive! Also linking is not a good idea, because after unmounting the mount point will be gone. It is, thus, strongly recommended to always choose to copy the data. Please note, that the popup menu can be avoided if you hold down the CTRL key while you are dragging and dropping the item. + + +Enabled drop support +You can drag files or directories from outside of &smb4k; over a share icon and drop them there. There are no pitfalls that you need to be aware of. However, the data you dropped will always only be copied and never moved. So if you want the data to be removed from your hard drive after the transfer, you have to delete it manually. + + + + +Unmounting Shares +A share may be unmounted by either clicking the &Ctrl; UUnmount menu item or by pressing its keyboard shortcut. In most cases, this will work smoothly and without problems. However, if you try to unmount a foreign share (i.e. one that is owned by another user) or one that went offline, unmounting can fail. In the latter case, you should consider to force the unmounting by clicking the &Ctrl; FForce Unmounting menu entry (only available under Linux). If it is not enabled, you can switch this feature on in the configuration dialog. A lazy unmount will then be performed and the share will definitely get unmounted. +All shares can be unmounted at once by clicking the &Ctrl; NUnmount All menu item. Depending on your settings, this action will also unmount foreign and offline shares. +Note: The mounting of shares is described here. + + + +Sychronization +The &Ctrl;YSynchronize menu item will open the synchronization dialog. It will offer you the mount point of the share as source and the rsync prefix as destination. In most cases, you may at least want to edit the destination to point to the right location. If you want to update the data on the share, you can also swap the destination with the source by clicking the Swap Paths button. + +Screenshot of the synchronization dialog (input) + + + + + +URL requester for sync'ing + + + +Clicking the Synchronize button starts the synchronization. The input widgets as well as the Swap Paths and Synchronize buttons are disabled now. The progress of the synchronization can be observed in the dialog: + +Screenshot of the synchronization dialog (progress) + + + + + +Progress dialog + + + +Besides the name of the file that is currently trensferred, the progress of the current transfer, the overall progress, the number of copied files and the transfer rate are displayed. The total number of files that is shown with the Files transferred entry corresponds to the number of files present on the share and not to the total number of files that will be transferred. +The synchronization can the canceled at any time by clicking the Cancel button. + + + +Opening a Share +&smb4k; provides two possibilities to open a mounted share: + +Open a share with &konsole; +You can open the mounted share in &konsole; by selecting the &Ctrl;LOpen with Konsole menu entry. This is useful if you need to run shell scripts on the share or similar. + +Open a share with &konqueror; +You can open the share in &konqueror; by clicking the share icon or selecting the &Ctrl;KOpen with Konqueror menu item. + + +Note: If a share is marked as inaccessible, it cannot be opened. + + + + + + +Handling Bookmarks +You can add a bookmark to your favorite shares by selecting it in the network browser and clicking the &Ctrl;BAdd Bookmark menu item. Alternatively, you can use the keyboard shortcut. + + +Bookmarks Menu +The bookmarks can be accessed and managed through the Bookmarks menu: + +Screenshot of the bookmark popup menu + + + + + +Bookmark popup menu + + + +In the Bookmarks menu there are two static items available: + + + + + + +&Ctrl; E + + +Edit Bookmarks + + + +Open the bookmark editor. This action is diabled if there are no bookmarks. + + + + + + + +&Ctrl; B + + +Add Bookmark + + + +Add a bookmark. A share in the network browser has to be selected to enable this action. + + + +The other entries are shares you already bookmarked. They are listed alphabetically and may either appear with their name or with a label that can be defined in the bookmark editor. By clicking a bookmark the respective share is mounted. If it is (already) mounted, the menu item is disabled. + + + +Bookmark Editor +The bookmarks may be edited or removed via the bookmark editor. It can be opened by clicking the &Ctrl;EEdit Bookmarks menu item. + +Screenshot of the bookmark editor + + + + + +Bookmark editor + + + +The IP Address and Label sections are editable (Double click the field you want change and you will enter the editor mode.) Since the IP addresses will be adjusted automatically in case they changed, you might never need to edit them. With the label you can give each bookmark a custom description. It will be used in the Bookmarks menu instead of the share name in the case the feature is enabled in the configuration dialog. +To remove one share or all shares at once, right click in the editor window to bring up a small popup menu that contains the Remove and the Remove All actions. The Remove action will only be enabled if you clicked on a bookmark. +The changes can be committed by clicking the OK button. + + + + + + +The System Tray Widget + + +Location +By default, &smb4k; starts embedded into the system tray: + +Screenshot of the system tray icon + + + + + +System tray icon + + + +The big advantage of running &smb4k; embedded is that you can close (minimize) the main window while the application keeps running in the system tray. So, you can clear up your desktop and use it for your daily work. However, if you prefer to run &smb4k; unembedded, you can change the setting in the configuration dialog. Please note, that in this case you quit &smb4k; when you close the main window. + + + +Usage +By left clicking on the icon the main window can be hidden or shown. A right click will bring up a popup menu that contains several menu items that allow you to work with the mounted shares, manage or mount your bookmarks and to configure &smb4k; without the need to open the main window. + + + +Menus and Menu Items + +Screenshot of the popup menu of the system tray icon + + + + + +System tray icon's popup menu + + + + +The following menus and menu items are available: + + + + +Mounted Shares + + + +This menu lists all mounted shares and some actions that can be performed on them: + + + + + +Unmount All + + + +Unmount all shares at once. Depending on your settings &smb4k; attempts to unmount either only those shares that are owned by you or all that are listed. + + + + +For each mounted share you can open a submenu that contains the following entries: + + + + +Unmount + + + +Unmount the share. + + + + + +Force Unmounting + + + +Force the unmounting of the share (Linux only). For further information read here and here. + + + + + +Synchronize + + + +Synchronize the mounted share with a local copy or vice versa. For further information read here and here. + + + + + +Open with &konsole; + + + +Open the base directory of the share in &konsole;. + + + + + +Open with &konqueror; + + + +Open the contents of the share in &konqueror;. + + + + + + + + + +Bookmarks + + + +The Bookmarks menu contains a list of your bookmarks and the following bookmark releated action(s): + + + + +Edit Bookmarks + + + +Open the bookmark editor. + + + +Executing one of the bookmarks mounts the respective remote share. It will appear in the Mounted Shares menu as well as in the shares view of the main window. + + + + + + +Mount Manually + + + +Open the dialog for "manual" mounts. + + + + + +Configure &smb4k;... + + + +Open the configuration dialog. See here for a full list of available settings. + + + + + +Minimize | Restore + + + +Hide (minimize) or show (restore) the main window. Which text is shown depends on the state of the main window. If it is hidden, the user sees the Restore entry and Minimize otherwise. + + + + + + + +&Ctrl; Q + + +Quit + + + +Quit the application. + + + + + + + + + + +The &konqueror; Plugin +&smb4k; comes with a plugin which brings the application's key features to &konqueror;. It is standalone, so you do not have to start &smb4k; to be able to use it. + +After installation, the plugin can be added by clicking the configuration button on the side bar of &konqueror;'s navigation panel and choosing Add NewSamba Browser. An additional button with &smb4k;'s icon will appear. If the configuration button is not shown, you can also right click on the side bar to open the popup menu. + +Screenshot of Konqueror's navigation panel + + + + + +Konqueror's navigation panel + + + + +The network browser is opened by clicking the &smb4k; symbol in the navigation panel. It is equipped with an extra toolbar, that is not present in the main application, and a modified version of the popup menu. + +Screenshot of the Konqueror plugin + + + + + +Konqueror plugin + + + +You can navigate through the network tree by either clicking the + or the network item itself. Remote shares can be mounted by choosing &Ctrl; MMount from the popup menu or by clicking the share. The mount point of the share will be opened in the file view after mounting. If you need to define custom options for certain servers or shares, you can use the Custom Options dialog for that (see here for more information). + +A share can be unmounted by selecting it in the network browser and choosing the &Ctrl; UUnmount menu item. An Unmount All feature is not present in the &konqueror; plugin. + +The shares will stay mounted even after you closed &konqueror; unless you choose the option Unmount all shares of user USER on exit (where USER is your user name) from the configuration dialog. In this case, your shares will be unmounted if you close &konqueror;. + +Just like the main application, the plugin comes with the ability to remount recently used shares. If you enable the corresponding setting in the configuration dialog and start &konqueror; with the plugin open, these shares will be mounted and the last one will be opened in the file view. + +The popup menu of the &konqueror; plugin contains the following menu entries: + + + + + + +&Ctrl; R + + +Scan Network|Workgroup|Computer + + + + +Scan the whole network neighborhood, a workgroup/domain, or a server. For your convenience, new network items will be added and obsolete ones removed without closing the network tree. + + + + + + + +&Ctrl; A + + +Abort + + + +Abort any running process that is network related. The entry is only enabled if &smb4k; is busy. + + + + + + + +&Ctrl; O + + +Mount Manually + + + +The mount dialog is opened. You can enter the name, IP address, and workgroup/domain of a share you want to mount manually. This feature comes in handy if the server where the share is located could not be found automatically. + + + + + + + +&Ctrl; T + + +Authentication + + + +The authentication dialog is opened. You can provide the login and password for the selected server or share. If no item or a workgroup is selected, this menu entry is disabled. + + + + + + + +&Ctrl; C + + +Custom Options + + + +The Custom Options dialog is opened. You can set several custom options for the selected server or remote share. If no item or a workgroup is selected, this menu entry is disabled. + + + + + + + +&Ctrl; B + + +Add Bookmark + + + +Add a bookmark. This menu entry is only available if a remote share is selected. + + + + + + + +&Ctrl; V + + +Preview + + + +Preview the contents of the selected remote share. + + + + + + + +&Ctrl; P + + +Print File + + + +Print a file on a remote printer. This menu item is only available if you selected a printer share. + + + + + + + +&Ctrl; M | U + + +Mount | Unmount + + + +The functionality of this menu item depends on the state of the share you selected: + +If a mounted share is selected, you can unmount it. The item shows &Ctrl; UUnmount. +If a share is selected that is not mounted, you can mount it. The item shows &Ctrl; MMount. + +This menu entry is disabled if you click anything different than a share with type "Disk" or "IPC". + + + + +The small tool bar at the top of the plugin window contains a button to reload the network tree, to open the search dialog, and to open the configuration dialog, respectively. + +In case you want to remove the plugin from &konqueror;, you just need to right click on the Samba Browser button and choose Remove from the menu. + + + + + + +Configuring &smb4k; + +This section describes the settings that are available to configure &smb4k;. To open the configuration dialog, you have to click the Configure &smb4k;... menu item. + + + + +User Interface + +With the options located here you can change the appearance and behavior of several dialogs and widgets. Please note that if you want to change the appearance of the main window you will find addtional options under Settings in the menu bar. + + +Screenshot of the "Appearance" configuration tab + + + + + +The "Appearance" configuration tab + + + + + +Main Window & System Tray : Shares View + + + + +Show mounted shares in an icon view + + + + +An icon view will be used in the main window to show the mounted shares. + + +Default: selected + + + + + + +Show mounted shares in a list view + + + + +A list view will be used in the main window to show the mounted shares. + + +Default: not selected + + + + + + + +Main Window & System Tray : Bookmarks + + + + +Show custom bookmark label if available + + + + +The custom description (label) of the bookmark is shown. It can be defined in the bookmark editor. + + +Default: selected + + + + + + + +Main Window & System Tray : System Tray + + + + +Embed application into the system tray + + + + +Embed &smb4k; into the system tray. The system tray widget includes several common actions, so you do not need to open the main window for many tasks. For further information read the System Tray Widget section. + + +Default: selected + + + + + + + +Network Browser : Remote Shares + + + + +Show printer shares + + + + +Printer shares are shown. + + +Default: selected + + + + + + +Show hidden shares + + + + +All hidden shares except those of type ADMIN$ and IPC$ are shown in the network browser. + + +Default: selected + + + + + + +Show IPC$ shares + + + + +Hidden IPC$ shares are shown. This option can only be chosen if you also ticked the Show hidden shares check box. + + +Default: not selected + + + + + + +Show ADMIN$ shares + + + + +Hidden ADMIN$ shares are shown. This option can only be chosen if you also ticked the Show hidden shares check box. + + +Default: not selected + + + + + + + +Network Browser : Columns + + + + +Show type + + + + +The type of the shares is shown (i. e. Disk, Printer, or IPC). + + +Default: selected + + + + + + +Show IP address + + + + +The IP address of a remote host is shown. + + +Default: selected + + + + + + +Show comment + + + + +The comment of a remote host or share is shown. + + +Default: selected + + + + + + + +Network Browser : Tooltips + + + + +Show tooltip with information about a network item + + + + +A tooltip will be shown if you move the mouse pointer over an item in the network browser. It contains information about the underlying network item such as the workgroup or domain name, host name, comment, type, etc. + + +Default: selected + + + + + + + +Shares View : Mounted Shares + + + + +Show mount point instead of share name + + + + +The mount point is shown instead of the share name. + + +Default: not selected + + + + + + +Show all shares that are mounted on the system + + + + +All mounts that are using either the SMBFS or CIFS file system are shown. By default, only the shares owned by you are displayed. + + +Default: not selected + + + + + + + +Shares View : Drag and Drop + + + + +Allow dropping of files and directories onto shares + + + + +You can drag files and directories from the desktop or the filemanager and drop them onto a share icon. A file transfer will start if you have write permissions to the mounted share. By default this option is switched off and the shares view does not allow drop events. + + +Default: not selected + + + + + + +Allow dragging of shares + + + +The share icons can be dragged and dropped outside of &smb4k;. This feature is switched off by default, because there are a few issues connected with it. It is recommended that you read the Drag-and-Drop section before enabling this feature. + +Default: not selected + + + + + + + +Shares View : Tooltips + + + + +Show tooltip with information about a share + + + + +A tooltip will be shown if you move the mouse pointer over an item in the shares view. It contains information about the underlying item such as the share name, mount point, owner and group, CIFS login, disk usage, etc. + + +Default: selected + + + + + + + +Shares View : List View + + + + +Show owner and group (SMBFS only) + + + + +Show the owner's UID and GID in the list view. An entry will only be shown if the share was mounted with the SMBFS file system. The column will be empty otherwise. + + +Default: not selected + + + + + + +Show login (CIFS only) + + + + +Show the login name that was used for mounting. An entry will only be shown if the share was mounted with the CIFS file system. The column will be empty otherwise. + + +Default: not selected + + + + + + +Show file system + + + + +Show the file system that is used by the share. + + +Default: selected + + + + + + +Show free disk space + + + + +Show the free disk space that is available on the share. + + +Default: not selected + + + + + + +Show used disk space + + + + +Show the disk space that is in use on the share. + + +Default: not selected + + + + + + +Show total disk space + + + + +Show the total disk space that the share offers. + + +Default: not selected + + + + + + +Show disk usage + + + + +Show a graphical indicator that displays the disk usage. + + +Default: selected + + + + + + + +Preview Dialog : Hidden Files and Directories + + + + +Preview hidden files and directories + + + + +Show all files and directories including the hidden ones when opening a share's contents in the preview dialog. By default, this feature is deselected. + + +Default: not selected + + + + + + + + + + +Network + +The options in the Network configuration tab can be used to change the lookup method for the browse list and the program for network searches. If you want to adjust the behavior of the Samba programs nmblookup1, net8, or smbclient1, see the Samba section. + + +Screenshot of the "Network" configuration tab + + + + + +The "Network" configuration tab + + + + + +Browse List + + + + +Scan the network neighborhood for available workgroups and domains + + + + +&smb4k; will search for all available master browsers on the network by using nmblookup1. This is the default method and it is very reliable in finding all workgroups and domains of your network neighborhood. However, it suffers a few shortcomings like poor unicode support (e.g. umlauts are replaced by dots). + + +Default: selected + + + + + + +Query the current workgroup master browser + + + + +The current master browser of your workgroup or domain is looked up and queried for the browse list. If some of the workgroup names of your network neighborhood contain umlauts or other special characters, you might want to try this method, since unicode is supported. However, sometimes outdated workgroup master browsers might be returned. + + +Default: not selected + + + + + + +Query this master browser + + + + +The master browser entered in the text box will be queried to retrieve the browse list. It can be specified by using either its NetBIOS name or its IP address. This option might be of use if you have an uncommonly configured network neighborhood. + + +Default: not selected + + + + + + +Scan broadcast areas + + + + +&smb4k; will scan for and return all IP addresses that are registered within the given broadcast area(s). Please note that this is not a "real" IP address scan, because that would take ages. The broadcast areas have to be given in a comma-separated list and in the form x.y.z.255: +192.168.1.255, 192.168.2.255, 10.0.0.255 +The IP address/mask pair (192.168.1.1/24) does not work. + + +Default: not selected + + + + + + + +Network Search + + + + +Use nmblookup (recommended) + + + + +The search for remote hosts will be performed using nmblookup1. This method returns reliably the hostname, workgroup and IP address. However, it might fail under very rare circumstances. In those cases, you should try using the option below. + + +Default: selected + + + + + + +Use smbclient + + + + +The search for remote hosts will be performed using smbclient1. This method is less powerful than the one above. In particular, it is not able to handle IP addresses and you can only use the NetBIOS name to search for a host. + + +Default: not selected + + + + + + + + + + +Shares + +These options determine where &smb4k; will mount the remote shares and how it behaves on start-up and exit regarding mounted or recently used shares. If you want to configure the actual mounting of shares (use of SMBFS or CIFS file system, etc.), please see the Samba section. + + +Screenshot of the "Shares" configuration tab + + + + + +The "Shares" configuration tab + + + + + +Directories + + + + + +Mount prefix + + + + +This is the base directory (mount prefix, $PREFIX) where &smb4k; will mount the remote shares. It can be altered by using the URL requester (Click the button with the folder icon.) or by directly entering it into the text box. Path variables like $HOME are recognized. + + +Default: $HOME/smb4k/ + + + + + + +Force generated subdirectories to be lower case + + + + +All subdirectories that are created by &smb4k; below the mount prefix will be lower case. + + +Default: not selected + + + + + + + +Mounting and Unmounting + + + + + +Unmount all shares of user USER on exit + + + + +All of your shares will be unmounted on program exit (USER is replaced by your user name). + + +Default: not selected + + + + + + +Remount recently used shares on program start + + + + +All shares that were mounted at the time &smb4k; was shut down will be remounted on program restart. This option affects only the shares that were mounted by you. + + +Default: not selected + + + + + + +Allow the unmounting of shares that are owned by other users + + + + +This option will allow you to unmount shares that were mounted by other users. In combination with the options you can define under Super User, it is guaranteed that you will be able to unmount them. +USE WITH EXTREME CAUTION! + +Default: not selected + + + + + + + +Checks + + + + +Interval between checks + + + +&smb4k; periodically checks for newly mounted and inaccessable shares with an interval that can be defined here. Under normal circumstances, you do not need to change it. But if the server you connected to suffers from high load, you should increase the interval to ease it's situation. The effect on your system's load is generally rather small unless you set the interval below 1000 ms (not recommended). +Default: 2500 ms + + + + + + + + + + +Authentication + +Here you can change the settings affecting the authentication. + + +Screenshot of the "Authentication" configuration tab + + + + + +The "Authentication" configuration tab + + + + + +Password Storage + + + + +Save the authentication data in a wallet + + + + +The login names and passwords are stored in a subfolder named "Smb4K" of the current network wallet (default: "kdewallet"). The advantage of this method is, that the authentication data is stored permanently and encrypted on your hard drive. You only have to provide it once and the next time it is needed, &smb4k; will read it from the wallet. If you uncheck this option, the authentication data will either be stored temporarily or not at all (see below). + + +Default: selected + + + + + + +If no wallet is used, remember authentication data during run time + + + + +If you do not want &smb4k; to store the authentication data in a wallet, you can decide whether it should be stored temporarily or not. If you uncheck this check box, &smb4k; will immediately forget the authentication data you provided and you will have to enter it everytime it is needed. This option has no effect if you chose to store the passwords in a wallet (see above). + + +Default: selected + + + + + + + +Default Login + + + + +Use default login + + + + +The default login is used by default to authenticate to a host. If you enable this feature, the text boxes for the user name and the password will become available. You have to fill in at least the user name. Empty passwords are supported. + + +Default: not selected + + + + + + + + + + +Samba + +Here you can directly influence the command line arguments that are passed to the Samba programs and also manage the custom settings you defined for single shares. Please note, that the settings will have no effect outside &smb4k; and that no changes will be applied to the smb.conf configuration file. For further information, please refer to the manual pages of the Samba software suite. + + +Screenshot of the "Samba" configuration tab + + + + + +The "Samba" configuration tab + + + + + +General : General Options + + + + + +NetBIOS name + + + + +Set the NetBIOS name of your computer. The text box should already be filled with the information found in the smb.conf configuration file or with the hostname of your computer. Under normal circumstances there is no need to change anything here. + + +Default: NetBIOS name defined in smb.conf or the hostname + + + + + + +Domain + + + + +Set the name of the domain/workgroup your computer is in. The text box should already be filled with the information found in the smb.conf configuration file. Under normal circumstances there is no need to change anything here. + + +Default: domain name defined in smb.conf + + + + + + +Socket options + + + + +Set the TCP socket opitions. Please refer to the smb.conf5 manual page to learn more. + + +Default: socket options defined in smb.conf + + + + + + +NetBIOS scope + + + + +Set the NetBIOS scope. It is recommended that you read the smb.conf5 manual page before entering anything here. + + +Default: NetBIOS scope defined in smb.conf + + + + + + +Remote SMB port + + + + +Sets the remote SMB port number. Unless you are using a firewall (see also here and here), you do not need to change anything here. This setting overwrites the smb ports = ... option defined in the smb.conf file. + + +Default: 139 + + + + + + + +General : Authentication + + + + +Try to authenticate with Kerberos + + + + +Use Kerberos for authentication in an Active Directory environment. + + +Default: not selected + + + + + + +Authenticate as machine account + + + + +Make queries to the remote server using the machine account of the local server. + + +Default: not selected + + + + + + + +mount : File System +Choose the file system you want to use for mounting. The default is the CIFS file system that normally works with most of the servers on your network neighborhood. However, it cannot handle servers that are running Windows Me or older yet. So, if the vast majority of the servers are running one of those operating systems, you should consider to choose the SMBFS file system. If you do not have mount.cifs8 and umount.cifs8 installed, &smb4k; will automatically switch to the SMBFS file system. +To change the file system only for a few servers, use the Custom Options dialog. +Note: Under FreeBSD there is only the SMBFS file system available. +Default: CIFS + + + +mount : Permissions + + + + +File mask + + + + +Sets the permissions that are applied to files. The value is given in octal and has to have 4 digits. To learn more about the file mask (fmask), you should read the mount8 and umask2 manual pages. + + +Default: 0755 + + + + + + +Directory mask + + + + +Sets the permissions that are applied to directories. The value is given in octal and has to have 4 digits. To learn more about the directory mask (dmask), you should read the mount8 and umask2 manual pages. + + +Default: 0755 + + + + + + +Write access + + + + +Here you can determine if the shares should be mounted read-write or read-only. This option is independent of the file mask and the directory mask settings above. + + +Default: read-write + + + + + + + +mount : Charset and Codepage + + + + +Client charset + + + +Sets the charset used by the client side (i.e. your computer) + +SMBFS: for codepage to charset translations (NLS). +CIFS: to convert local path names to and from Unicode. If the server does not support Unicode, this parameter is ignored. + + + +Default: default + + + + + + +Server codepage + + + + +Sets the codepage the server uses. This option is only available with the SMBFS file system. + + +Default: default + + + + + + + +mount : User and Group + + + + +User ID + + + + +Sets the owner of the files and directories in the file system. By default, your UID will be used. If you are using the CIFS file system, this parameter is ignored if the target server supports the CIFS Unix extensions. + + +Default: your UID + + + + + + +Group ID + + + + +Sets the group that owns the files and directories in the file system. By default, your GID will be used. If you are using the CIFS file system, this parameter is ignored if the target server supports the CIFS Unix extensions. + + +Default: your GID + + + + + + + +mount : Advanced CIFS Options +(This widget is not available under FreeBSD.) +Most of the options you can define here require Linux kernel 2.6.15 or later to work. + + + + +Do permission checks + + + + +The client side checks if you have the correct UID and GID to manipulate files and directories on the share. This is in addition to the normal ACL check on the target machine done by the server software. You might want to switch this feature off, if the server(s) support the CIFS Unix extensions and you are, hence, not allowed to access the share. + + +Default: selected + + + + + + +Attempt to set UID and GID + + + + +If the CIFS Unix extensions are negotiated with the server the client side will attempt to set the effective uid and gid of the local process on newly created files, directories, and devices. If this feature is turned off, the default UID and GID defined for the share will be used. It is recommended that you read the manual page of mount.cifs8 before you change this setting. + + +Default: not selected + + + + + + +Use server inode numbers + + + + +Use inode numbers (unique persistent file identifiers) returned by the server instead of automatically generating temporary inode numbers on the client side. This parameter has no effect if the server does not support returning inode numbers or similar. It is recommended that you read the manual page of mount.cifs8 before you change this setting. + + +Default: not selected + + + + + + +Do not cache inode data + + + + +Do not do inode data caching on files opened on the share. In some cases this can provide better performance than the default behavior which caches reads and writes. + + +Default: not selected + + + + + + +Translate reserved characters + + + + +Translate six of the seven reserved characters (not backslash, but including the colon, question mark, pipe, asterik, greater than and less than characters) to the remap range (above 0xF000), which also allows the client side to recognize files created with such characters by Windows’s POSIX emulation. This can also be useful when mounting to most versions of Samba. This has no effect if the server does not support Unicode. + + +Default: not selected + + + + + + +Do not use locking + + + + +Do not use locking. Do not start lockd. + + +Default: not selected + + + + + + +Additional options + + + + +Define additional options for use with mount.cifs8. They have to be provided in a comma-separated list and should not include any options that were already defined in the configuration dialog because this could lead to unwanted side effects. The list is appended AS IS to the options. To find out about the arguments that can be used read the manual page of mount.cifs8. + + +Default: none + + + + + + + +mount : Advanced SMBFS Options +(This widget is not available under FreeBSD.) + + + + +Use unicode when communicating with the server + + + + +Sets if unicode should be used when communicating with the server. This option is only available with the SMBFS file system. + + +Default: not selected + + + + + + +Use large file system support + + + + +Switch on large file system support (LFS). You should enable this check box, if you want to store large files that are bigger than 2 GB on a SMBFS file system (with CIFS you do not have this limitation). This option is only available with the SMBFS file system. + + +Default: not selected + + + + + + +Caching time of directory listings + + + + +Sets how long a directory listing is cached in milliseconds. A higher value means that changes on the server take longer to be notified but it can give better performance on large directories, especially over long distances. This option is only available with the SMBFS file system. + + +Default: 1000 ms + + + + + + + +net : Protocol Hint + +With the settings in this box you can give &smb4k; a hint, which protocol should be used with the net8 command. Since for some actions not all protocols are available, your choice might be ignored for certain tasks. + + + + +Automatic detection + + + + +The protocol will be determined automatically by the net8 command on run time. This is the default and in most cases you do not need to change it. However, sometimes connection problems occur because the net8 program has problems negotiating the right protocol. In almost all cases this can be fixed by setting the protocol hint to the RAP protocol. + +Note: If only a few and not all servers are affected, you should consider to use the Custom Options dialog to set the protocol hint and leave this option untouched. + +Default: selected + + + + + + +RPC: Modern operating systems + + + + +The RPC protocol is used by the modern Windows variants (2000/XP/2003) and by Samba. + + +Default: not selected + + + + + + +RAP: Older operating systems + + + + +The RAP protocol is used by older Windows systems (95/98/Me). Its disadvantage is, that it does not support long share names. However, &smb4k; uses it as fallback. + + +Default: not selected + + + + + + +ADS: Active Directory environment (LDAP/Kerberos) + + + + +&smb4k; will try to use the ADS protocol if appropriate. Please note, that no command has been implemented yet that uses the ADS protocol, so this setting will have no effect for now. + + +Default: not selected + + + + + + + +smbclient : Miscellaneous + + + + +Resolve order + + + + +Determine what naming services and in what order are used to resolve host names to IP addresses. The option takes a space-separated string of different name resolution options. The options are: "lmhost", "host", "wins" and "bcast". For further information see the manual page of smbclient1. + + +Default: options defined in smb.conf + + + + + + +Buffer size + + + + +Change the transmit/send buffer size when getting or putting a file from/to a remote server. + + +Default: 65520 + + + + + + +Signing state + + + + +Set the client signing state. + + +Default: none + + + + + + + +nmblookup : Miscellaneous + + + + +Broadcast address + + + + +Send a query to the given broadcast address. Without this option the default behavior of nmblookup is to send the query to the broadcast address of the network interfaces as either auto-detected or defined in the interfaces = ... parameter of the smb.conf file. + + +Default: options defined in smb.conf + + + + + + +Try and bind to UDP port 137 to send and receive UDP datagrams + + + + +The reason for this option is a bug in Window 95 where it ignores the source port of the requesting packet and only replies to UDP port 137. Under normal circumstances, you do not need to tick this check box. If you experience problems while scanning the network and you want to enable this option, read the manual page of nmblookup1 before. + + +Default: not selected + + + + + + + +Custom +All servers and shares for which you defined custom options are listed here. The options can be changed by selecting an item and modifying the settings with the input widgets. A single entry can be removed by clicking the Remove button. The Remove All button removes all entries at once. + + + + + + +Synchronization + +This configuration page contains options that influence the behavior of the rsync1 command that is used to synchronize remote shares with local copies or vice versa. It is only available, if rsync1 is installed on your system. It is recommend, that you read the manual page before you use the synchronization feature the first time. However, save settings are pre-defined. You will do no harm, if you start right away. + + +Screenshot of the "Synchronization" configuration tab + + + + + +The "Synchronization" configuration tab + + + + + +Copying : Default Destination + + + + +Rsync prefix + + + +This is the directory where rsync1 stores the transferred data by default. If you want to synchronize several shares, you should define different directories in the synchronization dialog. + +Default: $HOME/smb4k_sync/ + + + + + + + +Copying : General + + + + +Archive mode + + + +Option: /, same as (no ) +Switch the archive mode on. This is a quick way of saying you want recursion and want to preserve almost everything. Note that does not preserve hardlinks, because finding multiply-linked files is expensive. You must separately specify . + +Default: selected + + + + + + +Recurse into directories + + + +Option: / +Recurse into subdirectories. + +Default: selected + + + + + + +Skip files that are newer in target directory + + + +Option: / +This forces rsync1 to skip any files that exist on the destination and have a modification time that is newer than the one of the source file. (If an existing destination file has a modification time equal to the source file's, it will be updated if the sizes are different.) + +Default: selected + + + + + + +Update destination files in place + + + +Option: +This causes rsync1 not to create a new copy of the file and then move it into place. Instead rsync1 will overwrite the existing file, meaning that the rsync algorithm can't accomplish the full amount of network reduction it might be able to otherwise. One exception to this is if you combine the option with , since rsync1 is smart enough to use the backup file as the basis file for the transfer. +For further information you ought to read the manual page. + +Default: not selected + + + + + + +Use relative path names + + + +Option: / +Use relative path names. This means that the full path names specified on the command line are sent to the server rather than just the last parts of the file names. + +Default: not selected + + + + + + +Don't send implied directories + + + +Option: +This option affects the default behavior of the option. When it is specified, the attributes of the implied directories from the source names are not included in the transfer. This means that the corresponding path elements on the destination system are left unchanged if they exist, and any missing implied directories are created with default attributes. This even allows these implied path elements to have big differences, such as being a symlink to a directory on one side of the transfer, and a real directory on the other side. +For further information you ought to read the manual page. + +Default: not selected + + + + + + +Transfer directories without recursing + + + +Option: / +Tell the sending side to include any directories that are encountered. Unlike , a directory's contents is not copied unless the directory name specified is "." or ends with a trailing slash (e.g. ".", "dir/.", "dir/", etc.). Without this option or the option, rsync1 will skip all directories it encounters (and output a message to that effect for each one). If you specify both and , takes precedence. + +Default: not selected + + + + + + +Compress data during transfer + + + +Option: / +Compress file data during the transfer. + +Default: not selected + + + + + + + +Copying : Links + + + + +Preserve symlinks + + + +Option: / +Copy symlinks as symlinks. + +Default: selected + + + + + + +Transform symlinks + + + +Option: / +When symlinks are encountered, the item that they point to is copied, rather than the symlink. + +Default: not selected + + + + + + +Only transform unsafe symlinks + + + +Option: +Only transform "unsafe" symlinks. This means if a symlink is encountered that is pointing outside the copied tree, the referenced item is transferred rather than the symlink itself. + +Default: not selected + + + + + + +Ignore unsafe symlinks + + + +Option: +This tells rsync1 to ignore any symbolic links which point outside the copied tree. All absolute symlinks are also ignored. Using this option in conjunction with may give unexpected results. + +Default: not selected + + + + + + +Preserve hard links + + + +Option: / +This tells rsync1 to look for hard-linked files in the transfer and link together the corresponding files on the receiving side. Without this option, hard-linked files in the transfer are treated as though they were separate files. +Note that rsync1 can only detect hard links if both parts of the link are in the list of files being sent. + +Default: not selected + + + + + + +Keep directory symlinks + + + +Option: / +This option causes the receiving side to treat a symlink to a directory as though it were a real directory, but only if it matches a real directory from the sender. Without this option, the receiver's symlink would be deleted and replaced with a real directory. + +Default: not selected + + + + + + + +Copying : File Permissions, etc. + + + + +Preserve permissions + + + +Option: / +This option causes the receiving side to set the destination permissions to be the same as the source permissions. + +Default: selected + + + + + + +Preserve group + + + +Option: / +This option causes rsync1 to set the group of the destination file to be the same as the on of th source file. If the receiving program is not running as the super-user (or with the option), only groups that the receiver is a member of will be preserved. + +Default: selected + + + + + + +Preserve owner + + + +Option: / +This option causes rsync1 to set the owner of the destination file to be the same as the source file. By default, the preservation is done by name, but may fall back to using the ID number in some circumstances (see the option for a full discussion). This option has no effect if the receiving rsync1 is not run as the super user and is not specified. + +Default: selected + + + + + + +Preserve device and special files + + + +Option: / +This option causes rsync1 to transfer character and block device files as well as special files (such as named sockets and fifos) to the remote system. This option has no no effect if the receiving side is not run as the super user and is not specified. + +Default: selected + + + + + + +Preserve times + + + +Option: / +This tells rsync1 to transfer modification times along with the files and update them on the remote system. + +Default: selected + + + + + + +Omit directories when preserving times + + + +Option: / +This tells rsync1 to omit directories when it is preserving modifiction times (see ). + +Default: not selected + + + + + + + +File Deletion & Transfer : File Deletion + + + + +Remove synchronized source files + + + +Option: +This tells rsync1 to remove from the sending side the files (meaning non-directories) that are a part of the transfer and have been successfully duplicated on the receiving side. + +Default: not selected + + + + + + +Delete extraneous files + + + +Option: +This tells rsync1 to delete extraneous files from the receiving side (ones that aren't on the sending side), but only for the directories that are being synchronized. You must have asked rsync1 to send the whole directory (e.g. "dir" or "dir/") without using a wildcard for the directory's contents (e.g. "dir/*") since the wildcard is expanded by the shell and rsync1 thus gets a request to transfer individual files, not the files' parent directory. Files that are excluded from transfer are also excluded from being deleted unless you use the option or mark the rules as only matching on the sending side. + +Default: not selected + + + + + + +Delete files before transfer + + + +Option: +Request that the file deletions on the receiving side be done before the transfer starts. This is the default if or is specified without one of the options. + +Default: not selected + + + + + + +Delete files after transfer + + + +Option: +Request that the file deletions on the receiving side be done after the transfer has completed. + +Default: not selected + + + + + + +Delete files during transfer + + + +Option: +Request that the file deletions on the receiving side be done incrementally as the transfer happens. This is a faster method than choosing the before- or after-transfer algorithm, but it is only supported beginning with rsync1 version 2.6.4. + +Default: not selected + + + + + + +Also delete excluded files + + + +Option: +In addition to deleting the files on the receiving side that are not on the sending side, this tells rsync1 to also delete any files on the receiving side that are excluded (see ). + +Default: not selected + + + + + + +Delete even if I/O errors occur + + + +Option: +Tells to go ahead and delete files even when there are I/O errors. + +Default: not selected + + + + + + +Force deletion of non-void directories + + + +Option: +This option tells rsync1 to delete a non-empty directory when it is to be replaced by a non-directory. This is only relevant if deletions are not active (see ). + +Default: not selected + + + + + + + +File Deletion & Transfer : Restrictions + + + + +Don't delete more than this many files + + + +Option: +This tells rsync1 not to delete more than NUM files or directories (NUM must be non-zero). This is useful when mirroring very large trees to prevent disasters. + +Default: not selected; NUM: 0 + + + + + + + +File Deletion & Transfer : File Transfer + + + + +Don't transfer any file smaller than + + + +Option: +This tells rsync1 to avoid transferring any file that is smaller than the specified SIZE, which can help in not transferring small, junk files. + +Default: not selected; NUM: 0 kB + + + + + + +Don't transfer any file larger than + + + +Option: +This tells rsync1 to avoid transferring any file that is larger than the specified SIZE. + +Default: not selected; NUM: 0 kB + + + + + + +Keep partially transferred files + + + +Option: +By default, rsync1 will delete any partially transferred file if the transfer is interrupted. In some circumstances it is more desirable to keep partially transferred files. Using the option tells rsync1 to keep the partial file which should make a subsequent transfer of the rest of the file much faster. + +Default: not selected + + + + + + +Put a partially transferred file into + + + +Option: +A better way to keep partial files than the option is to specify a directory DIR that will be used to hold the partial data (instead of writing it out to the destination file). On the next transfer, rsync1 will use a file found in this directory as data to speed up the resumption of the transfer and then delete it after it has served its purpose. Before you tick this option, you should read the manual page. + +Default: not selected; DIR: $HOME + + + + + + + +Filtering : General + + + + +Auto-ignore files in the same way CVS does + + + +Option: / +This is a useful shorthand for excluding a broad range of files that you often don't want to transfer between systems. It uses the same algorithm that CVS uses to determine if a file should be ignored. + +Default: not selected + + + + + + +Exclude files matching this pattern + + + +Option: +This option is a simplified form of the option that defaults to an exclude rule and does not allow the full rule-parsing syntax of normal filter rules. + +Default: not selected; PATTERN: empty + + + + + + +Read exclude exclude patterns from + + + +Option: +This option is related to the option, but it specifies a FILE that contains exclude patterns (one per line). Blank lines in the file and lines starting with ';' or '#' are ignored. You have to choose an existing file to make this option work. + +Default: not selected; FILE: $HOME/exclude.txt + + + + + + +Don't exclude files matching this pattern + + + +Option: +This option is a simplified form of the option that defaults to an include rule and does not allow the full rule-parsing syntax of normal filter rules. + +Default: not selected; PATTERN: empty + + + + + + +Read include patterns from + + + +Option: +This option is related to the option, but it specifies a FILE that contains include patterns (one per line). Blank lines in the file and lines starting with ';' or '#' are ignored. You have to choose an existing file to make this option work. + +Default: not selected; FILE: $HOME/include.txt + + + + + + + +Filtering : Filter Rules + + + + +[Filter rules text box] + + + +Option: / +You can define one or more filter rules here. Each rule has to be prefixed with the or option string, because the contents of the text box will be passed to the rsync1 command AS IS. +This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. This is most useful in combination with a recursive transfer. +You may use as many options as you like to build up the list of files to exclude. +See the FILTER RULES section of the manual page for detailed information on this option. + +Default: empty + + + + + + +Use --filter='dir-merge /.rsync-filter' filter rule + + + +Option: +This option tells rsync1 to look for per-directory .rsync-filter files that have been sprinkled through the hierarchy and use their rules to filter the files in the transfer. +See the FILTER RULES section of the manual page for detailed information on how this option works. + +Default: not selected + + + + + + +Use --filter='exclude .rsync-filter' filter rule + + + +Option: +This option filters out the .rsync-filter files themselves from the transfer. +See the FILTER RULES section of the manual page for detailed information on how this option works. + +Default: not selected + + + + + + + +Advanced : General + + + + +Handle sparse files efficiently + + + +Option: / +Try to handle sparse files efficiently so they take up less space on the destination. Conflicts with because it's not possible to overwrite data in a sparse fashion. +Note: Don't use this option when the destination is a Solaris "tmpfs" file system. It doesn't seem to handle seeks over null regions correctly and ends up corrupting the files. + +Default: not selected + + + + + + +Copy files whole (no rsync algorithm) + + + +Option: / +With this option the incremental rsync1 algorithm is not used and the whole file is sent as-is instead. The transfer may be faster if this option is used when the bandwidth between the source and destination machines is higher than the bandwidth to disk (especially when the "disk" is actually a networked file system). This is the default when both the source and destination are specified as local paths. + +Default: not selected + + + + + + +Don't cross file system boundaries + + + +Option: / +This tells rsync1 to avoid crossing a file system boundary when recursing. This does not limit the user's ability to specify items to copy from multiple file systems, just rsync1's recursion through the hierarchy of each directory that the user specified, and also the analogous recursion on the receiving side during deletion. Also keep in mind that rsync1 treats a "bind" mount to the same device as being on the same file system. + +Default: not selected + + + + + + +Only update files that already exist + + + +Option: / +This tells rsync1 to skip updating files that do not exist yet on the destination. If this option is combined with the option, no files will be updated (which can be useful if all you want to do is to delete missing files). + +Default: not selected + + + + + + +Ignore files that already exist + + + +Option: +This tells rsync1 to skip updating files that already exist on the destination. See also . + +Default: not selected + + + + + + +Delay updates until the end of transfer + + + +Option: +This option puts the temporary file from each updated file into a holding directory until the end of the transfer, at which time all the files are renamed into place in rapid succession. +It is strongly recommended that you read the manual page before using this option. + +Default: not selected + + + + + + + +Advanced : Backup + + + + +Make backups + + + +Option: / +With this option, preexisting destination files are renamed as each file is transferred or deleted. You can control where the backup file goes and what (if any) suffix gets appended using the and options. +Note that if you don't specify , (1) the option will be implied, and (2) if is also in effect (without ), rsync1 will add a "protect" filter-rule for the backup suffix to the end of all your existing excludes (e.g. ). This will prevent previously backed-up files from being deleted. Note that if you are supplying your own filter rules, you may need to manually insert your own exclude/protect rule somewhere higher up in the list so that it has a high enough priority to be effective (e.g., if your rules specify a trailing inclusion/exclusion of '*', the auto-added rule would never be reached). + +Default: not selected + + + + + + +Backup suffix + + + +Option: +This option allows you to override the default backup suffix used with the option. The default suffix is a ~ if no was specified, otherwise it is an empty string. +This option is only available if you ticked the Make backups option above. + +Default: not selected; SUFFIX: ~ + + + + + + +Backup directory + + + +Option: +In combination with the option, this tells rsync to store all backups in the specified directory. This is very useful for incremental backups. You can additionally specify a backup suffix using the option (otherwise the files backed up in the specified directory will keep their original filenames). +This option is only available if you ticked the Make backups option above. + +Default: not selected; DIR: $HOME + + + + + + + +Advanced : Checksums + + + + +Force fixed checksum block size + + + +Option: / +This forces the block size used in the rsync algorithm to a fixed value. It is normally selected based on the size of each file being updated. See the technical report for details. + +Default: not selected; SIZE: 0 + + + + + + +Set block/file checksum seed + + + +Option: +Set the MD4 checksum seed to the integer NUM. This 4 byte checksum seed is included in each block and file MD4 checksum calculation. By default the checksum seed is generated by the server and defaults to the current time(). This option is used to set a specific checksum seed, which is useful for applications that want repeatable block and file checksums, or in the case where the user wants a more random checksum seed. Note that setting NUM to 0 causes rsync to use the default of time() for checksum seed. + +Default: not selected; NUM: 0 + + + + + + +Skip files based on checksum + + + +Option: / +This forces the sender to checksum every regular file using a 128-bit MD4 checksum. It does this during the initial file system scan as it builds the list of all available files. The receiver then checksums its version of each file (if it exists and it has the same size as its sender-side counterpart) in order to decide which files need to be updated: files with either a changed size or a changed checksum are selected for transfer. Since this whole-file checksumming of all files on both sides of the connection occurs in addition to the automatic checksum verifications that occur during a file's transfer, this option can be quite slow. + +Default: not selected + + + + + + + + + + +Super User +The options listed here are used for a normal user to gain limited super user privileges. You will only be able to apply the necessary changes to the involved system files, if you know the root password. In many cases you do not need super user privileges, because your Linux distribution already supports user mounts. +An alternative way to enable mounting is to set the SUID root bit to mount.cifs8, umount.cifs8, smbmnt8 and smbumount8. The procedure is described in the Trouble Shooting chapter. + +If neither super1 nor sudo8 is installed on your system, this configuration page is disabled. + + +Screenshot of the "Super User" configuration tab + + + + + +The "Super User" configuration tab + + + + + +Programs + + + + +sudo + + + + +Use the program sudo8 to gain super user privileges. + + +Default: not selected + + + + + + +super + + + + +Use the program super1 to gain super user privileges. + + +Default: selected + + + + +If you have only one of the programs installed, &smb4k; will automatically choose the one that is present on your system. + + + +Actions + + + + +Use super user privileges to force the unmounting of (inaccessible) shares + + + + +Ticking this option will enable the &Ctrl; FForce Unmounting action. If clicked, it will execute a "lazy" unmount that detaches the filesystem of the mounted share from the file system hierarchy immediately and cleans up all references to the file system as soon as it is not busy anymore. This is a handy feature if you experience problems unmounting shares. + +Note: This option requires Linux kernel 2.4.11 or later and is not available under other operating systems. + +Default: not selected + + + + + + +Use super user privileges to mount and unmount shares + + + + +Super user privileges will be used to mount and unmount shares. + + +Default: not selected + + + + + + +Remove Entries + + + + +Depending on the choice under Programs, the entries in the super.tab or sudoers configuration file will be removed. The root password is needed. + + + + + + + + + +Remarks for FreeBSD Users +Under FreeBSD, the SMB protocol is implemented in a different way than with other *NIX operating systems, and, thus, mounting of remote shares works differently. The major difference is the way the logon information is passed during the mount process. While under Linux and other operating systems that use Samba's smbmount8/mount.cifs8 programs you may specify the user name and password within the command options or by setting the USER and PASSWD environment variables, under FreeBSD, all logon information is stored in the credentials file ~/.nsmbrc. If the logon information is not available there, you will not be able to mount a password protected share. +Fortunately, you do not have to prepare the ~/.nsmbrc file manually to be able to use &smb4k;. It writes new logon information to the credentials file on the fly, so that it can be used immediately. If you use a WINS server, this one and a few more global things will be considered, too. However, the information &smb4k; writes to ~/.nsmbrc is limited: Only the name of the remote share, its workgroup, the login name (user name) and the encrypted password are provided. If you experience problems due to missing entries, you need to add them manually. +If you do not trust &smb4k;, there are different ways how to fill the ~/.nsmbrc file with the necessary data. The package maintainer of &smb4k; has written a README supplied with the binary FreeBSD package. Please refer to it in the case you prefer the manual or semi-automatic set-up. + + + + + + + + +Command Reference + + +The Main Window + + +Global Shortcuts +These keyboard shortcuts are not associated with any menu entries. + + + + + + + +&Ctrl; 1 + + +Jump to Network Browser + + + + +The network browser will be shown and get the keyboard focus. + + + + + + + + +&Ctrl; 2 + + +Jump to Search Dialog + + + + +The search dialog will be shown and get the keyboard focus. + + + + + + + + +&Ctrl; 3 + + +Jump to Shares View + + + + +The shares view will get the keyboard focus. + + + + + + + + +The File Menu + + + + + + + +&Ctrl; Q + + +File +Quit + + + + +Quit &smb4k;. + + + + + + + + +The Network Menu + + + + + + + +&Ctrl; R + + +Network +Scan Network|Workgroup|Computer + + + + +(Re-)scan the network neighborhood, a workgroup, or a computer. + + + + + + + + +&Ctrl; A + + +Network +Abort + + + + +Abort the scanning for new workgroups/domains, servers or shares. + + + + + + + + +&Ctrl; O + + +Network +Mount Manually + + + + +Open the dialog to "manually" mount a remote share. + + + + + + + + +&Ctrl; T + + +Network +Authentication + + + + +Open the authentication dialog where you can enter login information. + + + + + + + + +&Ctrl; C + + +Network +Custom Options + + + + +Open a dialog where you can define custom options for a server or share. + + + + + + + + +&Ctrl; V + + +Network +Preview + + + + +Open the preview dialog that contains a preview of the contents of the selected share. + + + + + + + + +&Ctrl; P + + +Network +Print File + + + + +Open the print dialog. + + + + + + + + +&Ctrl; M + + +Network +Mount + + + + +Mount the selected remote share. + + + + + + + + +The Shares Menu + + + + + + + +&Ctrl; U + + +Shares +Unmount + + + + +Unmount the selected share. + + + + + + + + +&Ctrl; F + + +Shares +Force Unmounting + + + + +Force the unmounting of the selected share. This action is not available under FreeBSD. + + + + + + + + +&Ctrl; N + + +Shares +Unmount All + + + + +Unmount all of the mounted shares at once. In the default configuration this is restricted to the user's shares, but this can be altered in the configuration dialog. For further information read the Unmounting Shares section. + + + + + + + + +&Ctrl; Y + + +Shares +Synchronize + + + + +Open the synchronization dialog. + + + + + + + + +&Ctrl; L + + +Shares +Open with Konsole + + + + +Open the base directory of the selected share in &konsole;. + + + + + + + + +&Ctrl; K + + +Shares +Open with Konqueror + + + + +Open the contents of the selected share in Konqueror. + + + + + + + + +The Bookmarks Menu + + + + + + + +&Ctrl; B + + +Bookmarks +Add Bookmark + + + + +Add the selected share to the bookmarks. + + + + + + +Bookmarks +Edit Bookmarks + + + + +Open the bookmark editor. + + + + + + + + +The Settings Menu + + + + + +Settings +Toolbars + + + + +In this submenu you can enable or disable the tool bars. + + + + + + +Settings +Hide Statusbar + + + + +Hide or show the status bar. + + + + + + +Settings +Dock Widgets + + + + +Hide or show the dock widgets of the main window. + + + + + + +Settings +Shares View + + + + +Select between the shares icon and list view. + + + + + + +Settings +Configure &smb4k;... + + + + +Open the configuration dialog. + + + + + + + + +The Help Menu +&help.menu.documentation; + + + + +The Bookmark Editor +Right-click to open the popup menu. + + + + + + + +Delete + + +Remove + + + + +Removes the selected bookmark from the list. + + + + + + + + +&Ctrl; X + + +Remove All + + + + +Removes all bookmarks from the list. + + + + + + + + + + + +The Utility Programs + +&smb4k; comes with several utility programs that are used to mount and unmount the remote shares, kill privileged child processes, and manipulate configuration files. In the following these programs are described. + + + + +smb4k_mount + + +Name +smb4k_mount — mount remote Samba and Windows shares + + + +Synopsis + + smb4k_mount + {} + {} + {share} + {mountpoint} +    + (Linux and similar) + + + smb4k_mount + {} + {share} + {mountpoint} +    + (FreeBSD) + + + smb4k_mount + + + + smb4k_mount + + + + + +Description +smb4k_mount is the mount utility of &smb4k;. It mounts remote Samba and Windows shares to a certain mount point using either the SMBFS or CIFS file system. It invokes smbmount8 or mount.cifs8 in normal user mode and mount8 in super user mode. Under FreeBSD, always mount_smbfs8 is used. +This program is available since &smb4k; version 0.5.0. + + + +Arguments + + +{mode} + +This argument determines if smb4k_mount will switch to normal user mode or to super user mode. It is not available under FreeBSD. Under the other operating systems it is mandatory. These are the possible values: + + + + + + +Run smb4k_mount in normal user mode and thus let it invoke either smbmount8 or mount.cifs8 depending on the choice the user made with the file system. + + + + + + + +Run smb4k_mount in super user mode and thus let it invoke mount8. + + + + + + + +The same as the argument. + + + + + + + +The same as the argument. + + + + + + +{options} + +These are the options you can pass to the mount binary (see the smbmount8, mount.cifs8, mount8 or mount_smbfs8 (FreeBSD) manual page for details). +Linux and similar: Due to the changes applied to the source of smb4k_mount during the preparation of version 0.8, only the and arguments are still supported. The use of is mandatory and you have to define either the 'cifs' or 'smbfs' file system with it. The choice of any other file system will cause smb4k_mount to exit with an error message. For the available options that go with the parameter, please consult the respective manual pages. +FreeBSD: The full range of arguments available for mount_smbfs8 is supported. Please refer to its manual page for more information. + + + +{share} + +The remote share that is to be mounted. + + + +{mountpoint} + +The path where the share should be mounted to. + + + +--help + +Display a help screen and exit. + + + +--version + +Display the version information and exit. + + + + + + +Examples +Mount a share under Linux in normal user mode with the CIFS file system: +$ smb4k_mount -n -t cifs -o user=USER,pass=PASSWD //SERVER/SHARE /mnt +Mount a share under Linux in super user mode with the SMB file system: +$ sudo smb4k_mount -s -t smbfs -o username=USER,password=PASSWD //SERVER/SHARE /mnt +In the latter case an appropriate entry has to be present in the /etc/sudoers configuration file to make the command work. See the sudoers5 manual page for more information. + + + +Author +smb4k_mount was written by Alexander Reinholdt dustpuppy@users.berlios.de. + + + + + + +smb4k_umount + + +Name +smb4k_umount — unmount SMBFS and CIFS shares + + + +Synopsis + + smb4k_umount + {} + {} + {mountpoint} +    + (Linux and similar) + + + smb4k_umount + {mountpoint} +    + (FreeBSD) + + + smb4k_umount + + + + smb4k_umount + + + + + +Description +smb4k_umount is the unmount utility of &smb4k;. It unmounts SMBFS and CIFS shares by invoking smbumount8 or umount.cifs8 in normal user mode and umount8 in super user mode. Under FreeBSD, always umount8 is used +This program is available since &smb4k; version 0.5.0. + + + +Arguments + + +{mode} + +This argument determines if smb4k_umount will switch to normal user mode or to super user mode. It is not available under FreeBSD. Under the other operating systems it is mandatory. These are the possible values: + + + + + + +Run smb4k_umount in normal user mode and thus let it invoke either smbumount8 or umount.cifs8 +depending on the choice the user made with the file system. + + + + + + + +Run smb4k_umount in super user mode and thus let it invoke umount8. + + + + + + + +The same as the argument. + + + + + + + +The same as the argument. + + + + + + +{options} + + + + + + + +Define the file system that should be used for unmounting. Only 'smbfs' and 'cifs' are supported. The use of any other file system will result in an error. This argument is not available under FreeBSD. Under the other operating systems it is mandatory. + + + + + + + +Perform a lazy unmount. This option is only available under Linux in super user mode. See the manual page of umount8 for more information. You need Linux kernel version 2.4.11 or later. + + + + + + +{mountpoint} + +The path where the share has been mounted to. + + + +--help + +Display a help screen and exit. + + + +--version + +Display the version information and exit. + + + + + + +Examples +Unmount a CIFS share (under Linux) with normal user privileges: +$ smb4k_umount -n -t cifs /mnt +Unmount a SMBFS share with super user privileges: +$ sudo smb4k_umount -s -t smbfs /mnt +In the latter case an appropriate entry has to be present in the /etc/sudoers configuration file to make the command work. See the sudoers5 manual page for more information. + + + +Author +smb4k_umount was written by Alexander Reinholdt dustpuppy@users.berlios.de. + + + + + + +smb4k_kill + + +Name +smb4k_kill — kill processes + + + +Synopsis + + smb4k_kill + {pid} + + + smb4k_kill + + + + smb4k_kill + + + + + +Description +smb4k_kill is the kill utility of &smb4k;. It kills processes by invoking the kill1 command. +This program is available since &smb4k; version 0.5.0, and a major change in its behavior happened in smb4k_kill 0.6 (i.e. in April 2007). + + + +Arguments + + +{pid} + +This is the ID of the process you want to kill. + + + +--help + +Display a help screen and exit. + + + +--version + +Display the version information and exit. + + + + + + +Example +Kill a process that is running with super user privileges: +$ super smb4k_kill 1423 +An appropriate entry has to be present in the /etc/super.tab configuration file to make this command work. See the super.tab5 manual page for more information. + + + +Author +smb4k_kill was written by Alexander Reinholdt dustpuppy@users.berlios.de. + + + + + + +smb4k_cat + + +Name +smb4k_cat — write the contents of files to stdout + + + +Synopsis + + smb4k_cat + {file} + + + smb4k_cat + + + + smb4k_cat + + + + + +Description +smb4k_cat is a replacement of the cat1 command. It is part of &smb4k; and is used to read (text) files and put their contents to stdout. +This program is available since &smb4k; version 0.7.0. + + + +Arguments + + +{file} + +The (full) path of the file that should be printed to stdout. + + + +--help + +Display a help screen and exit. + + + +--version + +Display the version information and exit. + + + + + + +Example +Read a file and put its contents to stdout: +$ smb4k_cat /etc/samba/smb.conf + + + +Author +smb4k_cat was written by Alexander Reinholdt dustpuppy@users.berlios.de. + + + + + + +smb4k_mv + + +Name +smb4k_mv — move files and simulaneously change their permissions, UID and GID + + + +Synopsis + + smb4k_mv + {} + {} + {source} + {destination} + + + smb4k_mv + + + + smb4k_mv + + + + + +Description +smb4k_mv is part of &smb4k; and is an utility to move files. It has the ability to change the user, group, and permissions of a file while moving it. Thus, it can be used as a replacement for a shell command construction like +$ chown USER:GROUP FILE && chmod PERMS FILE && mv FILE DESTINATON +This program is available since &smb4k; version 0.7.0. + + + +Arguments + + +{user:group} + +The user and group the file should have after it has been moved. You may specify the user and group either by the numeric user and group ID, by the user and group name, or by a mixture of both. Read the manual page of chown1 for details. + + + +{permissions} + +The permissions the file should have after it has been moved. You have to specify them in numeric mode like described in the chmod1 manual page. + + + +{source} + +The source file that is to be moved. + + + +{destination} + +The destination where the source file will be moved to. + + + +--help + +Display a help screen and exit. + + + +--version + +Display the version information and exit. + + + + + + +Example +Move a file, set the user and group, and change the file permissions: +$ smb4k_mv 1000:1000 0700 $HOME/test.txt $HOME/backup/test.txt + + + +Author +smb4k_mv was written by Alexander Reinholdt dustpuppy@users.berlios.de. + + + + + + + + +Trouble Shooting + +If you cannot find your problem covered here, please ask for help on the Smb4K-general mailing list or visit http://smb4k.berlios.de and look for an updated version of the handbook. + + + + +Compilation and Installation + + + + +Problem: Compilation fails with an error similar to this one: +smb4kscanner.cpp:96: error: conflicting declaration 'Smb4KScannerPrivate p' +smb4kmounter.cpp:167: error: 'p' has a previous declaration as 'Smb4KMounterPrivate p' +Solution: Remove the configure argument and reconfigure the source. This should fix the problem. +Note: This issue only occurrs with versions prior to 0.9.0. + + + +Problem: Compilation fails with the following error message: +libtool: link: cannot find the library `' +Solution: Replace the file admin/ltmain.sh by the one shipped with your libtool package. Run e.g. +$ locate ltmain.sh | grep libtool +to find it. + + + +Problem: Installation fails with a linker error similar to this one: +/usr/bin/ld: cannot find -lsmb4kcore +libtool: install: error: relink `libsmb4kwidgets.la´ with the above command before installing it +Solution: One possibility to avoid this failure is to enable the building of static libraries during configuration: +$ ./configure --prefix=`kde-config --prefix` --enable-static +This will convert the error into a warning and the installation will succeed. + + + +Problem: After starting a self-compiled version of &smb4k;, the toolbar cannot be seen. +Solution: Most likely, &smb4k; has been installed to the wrong place. To correct this, it has to be uninstalled first. Go to the base directory of your &smb4k; distribution and run +$ su -c "make uninstall" +from the shell. Please note that this will not work, if you ran +$ make distclean +in the meantime. +Reconfigure the source by passing the option to the configure script: +$ ./configure --prefix=`kde-config --prefix` +Compile and install &smb4k; (see also here): +$ make && su -c "make install" +&smb4k; will be installed to the right path and everything should work fine. + + + +Problem: The configure script fails and complains about a missing Qt installation. +Solution: There are two things that should check: + +Maybe the Qt header files are not installed. If this is the case, install them and run the configure script again. +The QTDIR environment variable might not be set properly or at all. Make sure you export it in your shell's configuration file. +If you are using the bash, check for the following line in your ~/.bashrc file +export QTDIR=PREFIX +and add it, if it is not present. Replace PREFIX with the prefix of your Qt installation. Run +$ source ~/.bashrc +from the shell. Now, you're set for a second configuration attempt. + +If the header files are installed and the QTDIR variable is set, but you still get the same error, you might want to try to pass the option to the configure script. + + + +Problem: The configure script fails and complains about a missing &kde; installation. +Solution: There are two things you should check: + +Maybe the &kde; header files are not installed. If this is the case, install them and run the configure script again. +The KDEDIR environment variable might not be set properly or at all. Make sure you export it in your shell's configuration file. +If you are using the bash, check for the following line in your ~/.bashrc file +export KDEDIR=PREFIX +and add it, if it is not present. Replace PREFIX with the prefix of your &kde; installation. Run +$ source ~/.bashrc +from the shell. Now, you're set for a new configuration attempt. + + + + + + + + +Browsing + + + + +Problem: There is nothing in the network browser. +Solution: This problem may have several causes. Here is a list of common solutions: + +Include the 'interfaces' option in the [global] section of your smb.conf. It should include the interface(s) that is/are connected to your network neighborhood, e.g. +interfaces = 192.168.1.1/24 +or alternatively +interfaces = eth0 +You may also add the local interface +interfaces = 192.168.1.1/24 127.0.0.1/8 +or alternatively +interfaces = eth0 lo +Samba allows a few more ways how to define the network interface(s) (see the manual page). However, we recommend that you use the IP/mask pair (e.g. 192.168.1.1/24). + +Add the WINS server of your network neighborhood — if available — to the [global] section of your smb.conf: +wins server = 192.168.1.1 +Replace the above IP address with the one of your WINS server. +Open the ports 137 (TCP+UDP), 138 (UDP), 139 (TCP+UDP), and 445 (TCP+UDP) in your firewall. If you have SUSE's firewall running, see below. +Use a different look-up method. Therefore, change the settings under SettingsConfigure &smb4k;...NetworkBrowse List. + +After having applied a change to the smb.conf, please do not forget to restart Samba and &smb4k;. Check if your problem disappeared. If nothing helps, please ask for assistance on the Smb4K-general mailing list or file a bug report. + + + +Problem: The browser window is empty when SUSE's firewall is running. +Solution: Have a look at Novell Cool Solutions or replace your firewall (recommended). + + + +Problem: When using SELinux, the workgroup/domain only contains the master browser. +Solution: Set SELinux to 'permissive'. + + + +Problem: When opening a (certain) Windows server, its shares are not displayed. +Solution: As of version 0.6.0, &smb4k; uses the net8 command to retrieve the list of shares from a host. With the default settings, it will try to guess the protocol that is needed to communicate with the server (RAP or RPC). Unfortunately, this does not seem to work well with Windows XP/2000/2003 servers. The query fails in some cases (sometimes accompanied with an NT_STATUS_IO_TIMEOUT error but mostly with no error message at all). Please try to set the protocol to RAP either through the custom options dialog (recommended) or directly in the configuration dialog. +Note: This does not apply to versions prior to 0.6.0, because they use the RAP protocol based smbclient1 command to retrieve the browse list. + + + +Problem: Special characters (accents, umlauts, etc.) are not displayed correctly. +Solution: For a solution see here. + + + + + + + +Mounting and Unmounting of Shares + + + + +Problem: Mounting a share fails without any error message being displayed. The share is only shown for a few seconds and then vanishes. +Solution: This issues arises sometimes if you are not allowed to mount the shares as normal user. Depending on the file system your are using, have a look here (CIFS) or here (SMBFS) for a solution. +Note: Linux and similar operating systems + + + +Problem: Using the CIFS file system, mounting fails with the following error message: +mount error 1 = Operation not permitted +Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) +Solution: There are two possible causes for this: + + +You are trying to use mount.cifs8 as normal user, but the SUID root bit is not set. The following (or a similar) command can be used as root to set the SUID bit: +$ chmod +s `which mount.cifs` + + +It has been reported that mount.cifs8 fails if the Samba server uses the +security = share +option instead of +security = user +Change the settings on the server. + + +Note: Linux and similar operating systems + + + +Problem: Using the SMBFS file system, mounting fails with this error message: +smbmnt must be installed suid root for direct user mounts (500,500) +smbmnt failed: 1 +Solution: The cause of this error is that you do not have enough permissions to mount SMB shares. There are two things you can do: + + +Set the SUID root bit for smbmnt. Execute this command in the shell: +$ chmod +s `which smbmnt` +Under normal circumstances this should fix the problem. +Warning: Do not set the SUID root bit for smbmount8. Otherwise mounting will fail with the following error message: +libsmb based programs must *NOT* be setuid root. +6002: Connection to <HOSTNAME> failed +SMB connection failed + + + +Execute mount8 and umount8 with super user privileges using the program super1 (since &smb4k; 0.4.0) or sudo8 (since &smb4k; 0.5.0). To enable this feature, you have to go to SettingsConfigure &smb4k;...Super User and adjust the settings. + + +Note: Linux and similar operating systems + + + +Problem: Mounting a share from a Windows 2003 server fails with this error message: +cli_negprot: SMB signing is mandatory and we have disabled it. +4377: protocol negotiation failed +SMB connection failed +Solution: You are using the SMBFS file system which does not support signing. You have to switch to the CIFS file system in order to be able to mount the share. Go to SettingsConfigure &smb4k;...SambaFile System and choose CIFS instead of SMBFS. Depending on the configuration of your system, you might also need to enable the "Use super user privileges to mount and unmount shares" option under SettingsConfigure &smb4k;...Super UserActions. Alternatively, you can set the SUID root bit for mount.cifs8 (and umount.cifs8). +Note: Linux and similar operating systems + + + +Problem: Mounting a share that contains special characters in the name (e.g. umlauts) with the CIFS file system fails with the following error message: +mount error 6 = No such device or address +Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) +Solution: Please follow the instructions given here. Alternatively, you can try to explicitly define the correct Linux charset in the configuration dialog (see here). +Note: Linux and similar operating systems + + + +Problem: When using sudo8 and the CIFS file system, mounting fails with the following error message: +mount error 13 = Permission denied +Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) +Solution: It is very possible, that the 'env_reset' flag has been set in the /etc/sudoers file (It's the default in Gentoo and Debian for example.). It resets the environment to only contain a limited number of environment variables. Especially, the PASSWD variable is removed that is needed by &smb4k;. To make mounting work, there are three things you can do alternatively: + +Manually insert the following line after the statement beginning with "User_Alias SMB4KUSERS": +Defaults:SMB4KUSERS env_keep=PASSWD +This is the preferred method on a multi-user system. +Remove the &smb4k; user entries from /etc/sudoers and rewrite them using &smb4k; (>= 0.6.4). +Comment out the 'env_reset' variable (not recommended). + +If you are still not able to mount a share, please file a bug report. +Note: Linux and similar operating systems + + + +Problem: When using the CIFS file system, &smb4k; does not seem to care about the UID and GID that was set in the configuration dialog. +Solution: This is a Samba feature. If the target server supports the CIFS Unix extensions, the and option is ignored. For more information see the mount.cifs +8 manual page. +Note: Linux and similar operating systems + + + +Problem: Unmounting a share fails with an error message similar to this one: +smbumount must be installed suid root +Solution: You do not have enough permissions to unmount SMB shares. To fix this problem you can either set the SUID root bit for smbumount8 or enable the feature "Use super user privileges to mount and unmount shares" under SettingsConfigure &smb4k;...Super UserActions. For more information you might want to read this entry, too. +Note: Linux and similar operating systems + + + +Problem: Unmounting a share fails with the following error message: +Could not unmount <PATH>: Device or resource busy +Solution: First of all, check that you do not access any directory or file of the share with any program. If this isn't the case, you might have encountered a problem, that is known but not related to &smb4k;. It seems that under certain circumstances (that we could not figure out exactly) kdeinit background processes access files and/or directories of the share and keep them open (&kde; < 3.4). Unmounting is not possible unless you send +$ kill -HUP PID +to each kdeinit instance that has access to the share or its files. Replace PID by the pid of the kdeinit instance. You can find it out by using e. g. &ksysguard;. +Alternatively, you can force the unmounting of the share (not recommended). Highlight the share and use the SharesForce Unmounting menu item or press &Ctrl;F. +Note: Linux and similar operating systems + + + +Problem: Special characters (accents, umlauts, etc.) are not displayed correctly. +Solution: Make sure the following options are set to the correct values in the [global] section of the smb.conf5 of each Samba server and client: + +dos charset = VAL1 +unix charset = VAL2 +display charset = VAL3 + +Replace VAL1, VAL2, VAL3 with the correct values. Read the manual page for more information. +Note: Linux and similar operating systems + + + +Problem: Mounting a share fails with the following error message: +mount_smbfs: kldload(smbfs): Operation not permitted +Solution: Use sudo8 or super1 to gain super user privileges for mounting (see section The Super User Tab). The error occurs, because only root is allowed to load kernel modules. +Note: FreeBSD only + + + +Problem: Mounting a share fails with the following error message: +mount_smbfs: can not setup kernel iconv table +(ISO8859-1:tolower): syserr = Operation not permitted +Solution: Most likely, this error occurs after you decided to not use sudo8 or super1 to mount a share anymore. Since only root is allowed to set up the kernel's iconv table, you should use one of these programs to gain super user privileges for mounting (see section The Super User Tab). +Note: FreeBSD only + + + + + + + +Miscellaneous + + + +Problem: After installing &smb4k;, I wanted to take advantage of the Konqueror plugin but I couldn't find it. Where can I find it and what do I have to do? +Solution: The procedure to add the &konqueror; plugin is described in detail here. + + + +Problem: After a KDE upgrade &smb4k; does not work anymore. +Solution: If you upgraded from e.g. &kde; 3.5.1 to 3.5.2, it suffices to restart &kde;. If you moved from one major version to another, i.e. from 3.3.x to 3.5.x, you have to install a package suitable for the new &kde; version. If neither helps, ask for help on the Smb4K-general mailing list. + + + + + + + + +Reporting Bugs + +Before considering to file a bug report, please read the Trouble Shooting section. Many common problems are already covered there. Also, try the latest version of &smb4k;. Maybe your problem has already been fixed. +Please follow these directions for your bug report: + +Describe in detail what you did to receive the problem you are reporting. +Provide the version of &smb4k; and &kde;. +Mention your operating system (Linux, FreeBSD, etc.) and the distribution that is running on your computer. +Include the full error message if an error dialog was displayed. +Add additional data, i.e. attach the backtrace if you experienced a crash, send a screen shot if you are reporting a GUI related problem, etc. + +The recommended method to report a bug is to go to our bug tracking system and fill out the form. But you can also use the dialog that opens when you click the HelpReport Bug... menu item. + + + + + + +Credits and License + +Copyright (c) 2003 - 2007, Alexander Reinholdt dustpuppy@users.berlios.de +Copyright (c) 2004 -2007, Massimo Callegari massimocallegari@yahoo.it +Copyright (c) 2004, Franck Babin babinfranck@yahoo.ca +&underGPL; +This documentation is licensed under the terms of the GNU General Public License. + + +Developers (active and retired) + +Alexander Reinholdt dustpuppy@users.berlios.de +Massimo Callegarimassimocallegari@yahoo.it +Franck Babin babinfranck@yahoo.ca + + + + +Translators (active and retired) + +Brazilian Portuguese: Giovanni Degani tiefox@terra.com.br, Lamarque V. Souza lamarque_souza@hotmail.com +Bulgarian: Atanas Mavrov bugar@developer.bg +Catalan: Leopold Palomo Avellaneda lepalom@wol.es +Czech: Alois Nešpor alois.nespor@seznam.cz +Chinese Simplified (zh_CN): Nick Chen nick_chen75@hotmail.com +Chinese Traditional (zh_TW): Jack Liu chuany@chuany.net, Wei-Lun Chao chaoweilun@users.berlios.de +Danish: Michael Brinkloev mhb@qxp.dk +Dutch: Joop Beris jberis@risse.nl +French: Nicolas Ternisien nicolast@libertysurf.fr +German: Alexander Reinholdt dustpuppy@users.berlios.de +Hungarian: Karoly Barcza kbarcza@blackpanther.hu +Icelandic: Arnar Leósson leosson@frisurf.no +Italian: Isidoro Russo risidoro@aliceposta.it +Japanese: Toyohiro Asukai toyohiro@ksmplus.com +Norwegian (Bookmal & Nynorsk): Nils Kristian Tomren project@nilsk.net +Polish: Radosław Zawartko radzaw@lnet.szn.pl, Jerzy Trzeciak artusek@wp.pl +Russian: Stanislav Yudin decvar@mail.berlios.de +Slovak: Michal Šulek reloadshot@atlas.sk +Swedish: Marc Hansen marc.hansen@gmx.de +Spanish: Quique quique@sindominio.net, Martín Carr tincarr@gmail.com +Turkish: Görkem Çetin gorkem@gorkemcetin.com, Serdar Soytetir sendirom@gmail.com +Ukrainian: Ivan Petrouchtchak iip@telus.net + + + + +Special Thanks +The &smb4k; team would like to thank everyone who contibuted by sending patches. Also, a big "Thank you!" goes to Rashid N. Achilov shelton@sentry.granch.ru, who convinced us to port &smb4k; to FreeBSD and helped us a great deal to achieve this goal. + + + + + + + +Installation + + +How to obtain &smb4k; +The latest stable release is available at http://developer.berlios.de/projects/smb4k/. + + + +Requirements + +&smb4k; officially supports Linux (>= 2.2.x) and FreeBSD (>= 4.10). It might also run on other Unix systems. +If you want to compile &smb4k; from source, a standard &kde; installation (3.3.0 or later) including the header files is needed. +In order to use &smb4k; successfully, you have to install the Samba software suite (3.0.0 or later), GNU grep, GNU awk or similar, GNU sed, the GNU findutils, and the util-linux package (Linux only). If you are using Linux, you also need support of the /proc file system compiled into your kernel. +To enable full functionality, you should also install super and/or sudo, a TeX software distribution (for dvips), GNU enscript, and rsync. +&smb4k; uses about 20 MB of memory to run, but this may vary depending on your platform and configuration. +Links to all required libraries and programs as well as &smb4k; itself can be found on the &smb4k; home page. +The list of changes can be found in the ChangeLog file. + + + +Compilation and Installation + +Full Installation +This section describes a full installation of &smb4k;. Please note that you might have to adjust the ./configure command to match the installation paths of your distribution (e.g. Debian, Ubuntu). + +Change into the root directory of the source code: $ cd smb4k-x.x.x (Replace x.x.x with the version number) +Configure the source code with at least the following command: $ ./configure --prefix=`kde-config --prefix` Several more options can be added. Run $ ./configure --help to find out which ones are available. +Compile the source code: $ make +Install the application. For that, become root $ su and run $ make install in the root directory of the source code. If you want to be able to remove Smb4K with your package manager, install the 'checkinstall' package and run $ checkinstall instead. + + + +Installation without Konqueror Plugin +If you are not interested in the &konqueror; plugin that comes with &smb4k;, you should configure the source code as follows: +$ ./configure --prefix=`kde-config --prefix` --without-konqplugin +The procedure to compile and install the application is the same as mentioned above. + + + + +Debugging the Source Code +If you experience crashes or similar and want to debug the source code yourself, compile it with debugging symbols. The procedure is similar to the one described in the Compilation and Installation section except that you need to modify the configure command slightly: +$ ./configure --prefix=`kde-config --prefix` --enable-debug=full +Now compile and install the program as stated before. If you do not want to +install but only debug the newly compiled program, you may execute &smb4k; from +within the source code directory. Change into the smb4k subdirectory and run: +$ ./smb4k --nofork +If you found the cause for a bug, please let us know. A backtrace or a patch will be much appreciated. + + + +
diff --git a/doc/en/main_window.png b/doc/en/main_window.png new file mode 100644 index 0000000..4b8e25c Binary files /dev/null and b/doc/en/main_window.png differ diff --git a/doc/en/plugin_full_view.png b/doc/en/plugin_full_view.png new file mode 100644 index 0000000..bb5be11 Binary files /dev/null and b/doc/en/plugin_full_view.png differ diff --git a/doc/en/plugin_inclusion.png b/doc/en/plugin_inclusion.png new file mode 100644 index 0000000..6044377 Binary files /dev/null and b/doc/en/plugin_inclusion.png differ diff --git a/doc/en/popup_menu_bookmarks.png b/doc/en/popup_menu_bookmarks.png new file mode 100644 index 0000000..6c0c8d6 Binary files /dev/null and b/doc/en/popup_menu_bookmarks.png differ diff --git a/doc/en/popup_menu_browser.png b/doc/en/popup_menu_browser.png new file mode 100644 index 0000000..9d16a61 Binary files /dev/null and b/doc/en/popup_menu_browser.png differ diff --git a/doc/en/popup_menu_shares_view.png b/doc/en/popup_menu_shares_view.png new file mode 100644 index 0000000..1e98423 Binary files /dev/null and b/doc/en/popup_menu_shares_view.png differ diff --git a/doc/en/shares_view_icons.png b/doc/en/shares_view_icons.png new file mode 100644 index 0000000..7d64d2e Binary files /dev/null and b/doc/en/shares_view_icons.png differ diff --git a/doc/en/shares_views.png b/doc/en/shares_views.png new file mode 100644 index 0000000..c8fbfeb Binary files /dev/null and b/doc/en/shares_views.png differ diff --git a/doc/en/system_tray_icon.png b/doc/en/system_tray_icon.png new file mode 100644 index 0000000..19d93a0 Binary files /dev/null and b/doc/en/system_tray_icon.png differ diff --git a/doc/en/system_tray_icon_popup_menu.png b/doc/en/system_tray_icon_popup_menu.png new file mode 100644 index 0000000..9899e85 Binary files /dev/null and b/doc/en/system_tray_icon_popup_menu.png differ diff --git a/plugin/Makefile.am b/plugin/Makefile.am new file mode 100644 index 0000000..db77a81 --- /dev/null +++ b/plugin/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO +kde_module_LTLIBRARIES = konqsidebar_smb4k.la +konqsidebar_smb4k_la_SOURCES = smb4k_konqplugin.cpp +konqsidebar_smb4k_la_LDFLAGS = -module $(all_libraries) \ + -L$(top_builddir)/smb4k/core -L$(topbuild_dir)/smb4k/widgets -lkonqsidebarplugin +konqsidebar_smb4k_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(KDE_PLUGIN) $(LIB_KFILE) $(LIB_KPARTS) $(LIB_QT) $(LIB_KDECORE) \ + $(LIB_KDEUI) + +globaladddir = $(kde_datadir)/konqsidebartng/add +globaladd_DATA = smb4k_add.desktop +noinst_HEADERS = smb4k_konqplugin.h diff --git a/plugin/smb4k_add.desktop b/plugin/smb4k_add.desktop new file mode 100644 index 0000000..b6af026 --- /dev/null +++ b/plugin/smb4k_add.desktop @@ -0,0 +1,74 @@ +# KDE Config File +[Desktop Entry] +Name=Samba Browser +Icon=smb4k +Type=Application +GenericName=The SMB/CIFS Share Browser +GenericName[bg]=Самба ресурсен четец +GenericName[ca]=El navegador de compartits SMB/CIFS +GenericName[cs]=Prohližeč SMB/CIFS sdílení +GenericName[de]=Der Browser für SMB/CIFS-Freigaben +GenericName[es]=El explorador de recursos compartidos SMB/CIFS +GenericName[fr]=L'explorateur de partages SMB / CIFS +GenericName[hu]=Az SMB/CIFS böngésző +GenericName[it]=Browser di condivisioni SMB/CIFS +GenericName[ja]=SMB/CIFS 共有(シェア)・ブラウザー +GenericName[nl]=De SMB/CIFS Share Browser +GenericName[no]=SMB/CIFS ressurs utforsker +GenericName[no_NY]=SMB/CIFS ressurs surfar +GenericName[pl]=Przeglądarka Zasobów SMB/CIFS +GenericName[pt_BR]=O navegador de compartilhamentos SMB/CIFS +GenericName[ru]=The SMB/CIFS Share Browser +GenericName[sk]=Prehliadač SMB/CIFS zdieľaní +GenericName[sv]=SMB Katalog programmed +GenericName[tr]=SMB/CIFS Paylaşım Tarayıcısı +GenericName[uk]=Навігатор спільних ресурсів SMB/CIFS +GenericName[zh_CN]=SMB 共享浏览器" +# +# The following lines seem to be necessary for SuSE. +# +Name[bg]=Samba Browser +Name[ca]=Samba Browser +Name[cs]=Samba Browser +Name[de]=Samba Browser +Name[es]=Samba Browser +Name[fr]=Samba Browser +Name[hu]=Samba Browser +Name[it]=Samba Browser +Name[ja]=Samba Browser +Name[nl]=Samba Browser +Name[no]=Samba Browser +Name[no_NY]=Samba Browser +Name[pl]=Samba Browser +Name[pt_BR]=Samba Browser +Name[ru]=Samba Browser +Name[sk]=Samba Browser +Name[sv]=Samba Browser +Name[tr]=Samba Tarayıcısı +Name[uk]=Samba Browser +Name[zh_CN]=Samba Browser +Comment=The SMB/CIFS Share Browser +Comment[bg]=Самба ресурсен четец +Comment[ca]=El navegador de compartits SMB/CIFS +Comment[cs]=Prohližeč SMB/CIFS sdílení +Comment[de]=Der Browser für SMB/CIFS-Freigaben +Comment[es]=El explorador de recursos compartidos SMB/CIFS +Comment[fr]=L'explorateur de partages SMB / CIFS +Comment[hu]=Az SMB/CIFS böngésző +Comment[it]=Browser di condivisioni SMB/CIFS +Comment[ja]=SMB/CIFS 共有(シェア)・ブラウザー +Comment[nl]=De SMB/CIFS Share Browser +Comment[no]=SMB/CIFS ressurs utforsker +Comment[no_NY]=SMB/CIFS ressurs surfar +Comment[pl]=Przeglądarka Zasobów SMB/CIFS +Comment[pt_BR]=O navegador de compartilhamentos SMB/CIFS +Comment[ru]=The SMB/CIFS Share Browser +Comment[sk]=Prehliadač SMB/CIFS zdieľaní +Comment[sv]=SMB Katalog programmed +Comment[tr]=SMB/CIFS Paylaşım Tarayıcısı +Comment[uk]=Навігатор спільних ресурсів SMB/CIFS +Comment[zh_CN]=SMB 共享浏览器" + +X-Open=false +X-KDE-KonqSidebarAddModule=konqsidebar_smb4k +X-KDE-KonqSidebarUniversal=true diff --git a/plugin/smb4k_konqplugin.cpp b/plugin/smb4k_konqplugin.cpp new file mode 100644 index 0000000..3cab7fa --- /dev/null +++ b/plugin/smb4k_konqplugin.cpp @@ -0,0 +1,236 @@ +/*************************************************************************** + * Copyright (C) 2004 by Massimo Callegari * + * massimocallegari@yahoo.it * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// plugin specific includes +// #include "smb4k_konqplugin.moc" +#include "smb4k_konqplugin.h" +#include "../smb4k/core/smb4kcore.h" +#include "../smb4k/core/smb4kdefs.h" + +smb4kWidget::smb4kWidget( QWidget * parent, const char * name, WFlags f ) + : QVBox(parent, name, f) +{ + // Nothing exciting to do ! +} + +KonqSidebar_Smb4K::KonqSidebar_Smb4K(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name): + KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name) +{ + + widget = new smb4kWidget( widgetParent ); + + KToolBar *topBar = new KToolBar( widget, "Topbar" ); + topBar->setIconSize(16); + topBar->insertButton( "reload", 0, SIGNAL( clicked() ), this, SLOT( slotRescan() ) , TRUE, i18n( "Scan Network" ) ); + topBar->insertButton( "find", 1, SIGNAL( clicked() ), this, SLOT( slotSearch() ) , TRUE, i18n( "Search" ) ); + topBar->insertButton( "configure", 2, SIGNAL( clicked() ), this, SLOT( slotSmb4KOptionsDlg() ) , TRUE, i18n( "Configure" ) ); + + // + // Browser widget: + // + KLibFactory *browser_factory = KLibLoader::self()->factory( "libsmb4knetworkbrowser" ); + + if ( browser_factory ) + { + m_browser_part = static_cast( browser_factory->create( widget, "BrowserPart", "KParts::Part", QStringList( "konqplugin=\"true\"" ) ) ); + + // Do nothing here. The network scan (and the mounting of recently used + // shares) will be done by Smb4KCore::init() below. + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + return; + } + + connect( Smb4KCore::mounter(), SIGNAL( mountedShare( const QString &) ), this, SLOT( slotMountedShare( const QString & ) ) ); + connect( Smb4KCore::mounter(), SIGNAL( aboutToUnmount( const QString& ) ), this, SLOT( slotPrepareUnmount( const QString& ) ) ); + + // Scan the network and remount recently used shares: + Smb4KCore::self()->init(); + +} + + +KonqSidebar_Smb4K::~KonqSidebar_Smb4K() +{ + +} + +extern "C" +{ + void* create_konqsidebar_smb4k(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name) + { + KGlobal::locale()->insertCatalogue("smb4k"); + return new KonqSidebar_Smb4K(instance,par,widp,desktopname,name); + } +}; + +extern "C" +{ + bool add_konqsidebar_smb4k(QString* fn, QString* /*param*/, QMap *map) + { + map->insert("Type","Link"); + map->insert("Icon","smb4k"); + map->insert("Name",i18n("Samba Browser")); + map->insert("Open","false"); + map->insert("X-KDE-KonqSidebarModule","konqsidebar_smb4k"); + fn->setLatin1("smb4k%1.desktop"); + return true; + } +} + +void KonqSidebar_Smb4K::handleURL(const KURL &url) +{ + currentKonquerorURL = url.path(); + //kdDebug() << "KonqSidebar_Smb4K::handleURL - "<< currentKonquerorURL << endl; +} + +void KonqSidebar_Smb4K::slotRescan() +{ + // Send a custom rescan event to the browser part. + QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_SCAN_NETWORK ) ); +} + +void KonqSidebar_Smb4K::slotSearch() +{ + // Load the factory of the config dialog: + KLibFactory *search_factory = KLibLoader::self()->factory( "libsmb4ksearchdialog" ); + + if ( search_factory ) + { + KDialogBase *searchDialog = new KDialogBase( KDialogBase::Plain, i18n( "Search Dialog" ), KDialogBase::Close, + KDialogBase::NoDefault, widget, "sd", true, true ); + + QFrame *frame = searchDialog->plainPage(); + + m_search_part = static_cast( search_factory->create( frame, "SearchDialogPart", "KParts::Part" ) ); + + if ( m_search_part ) + { + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 10 ); + layout->setMargin( 0 ); + layout->addWidget ( m_search_part->widget(), 0, 0, 0 ); + searchDialog->resize(400,300); + // We do not want the dialog to be closed if the user presses return. + // Instead we want that a search is started: + searchDialog->actionButton( KDialogBase::Close )->setAutoDefault( false ); + + //connect( m_search_dialog, SIGNAL( searchResult( Smb4KHostItem * ) ), this, SLOT( slotInsertItem( Smb4KHostItem * ) ) ); + + searchDialog->show(); + } + else + { + delete searchDialog; + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + return; + } +} + +void KonqSidebar_Smb4K::slotSmb4KOptionsDlg() +{ + // Load the factory of the config dialog: + KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4kconfigdialog" ); + + if ( config_factory ) + { + KConfigDialog *dlg = static_cast( config_factory->create( widget, "ConfigDialog", "KConfigDialog" ) ); + + if ( dlg ) + { + connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); + + dlg->show(); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + return; + } + +} + +void KonqSidebar_Smb4K::slotSettingsChanged() +{ + QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) ); +} + +void KonqSidebar_Smb4K::slotMountedShare( const QString &mountedShare ) +{ + emit openURLRequest( KURL(mountedShare) ); +} + +void KonqSidebar_Smb4K::slotPrepareUnmount( const QString &mountpoint ) +{ + if ( QString::compare( currentKonquerorURL, mountpoint ) == 0 ) + { + emit openURLRequest( KURL( QDir::home().canonicalPath() ) ); + } + else + { + // Nothing to do + } +} + +#include "smb4k_konqplugin.moc" + + + + + diff --git a/plugin/smb4k_konqplugin.h b/plugin/smb4k_konqplugin.h new file mode 100644 index 0000000..7f57324 --- /dev/null +++ b/plugin/smb4k_konqplugin.h @@ -0,0 +1,136 @@ +/*************************************************************************** + * Copyright (C) 2004 by Massimo Callegari * + * massimo.callegari@telsey.it * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef SAMBROWSER_H +#define SAMBROWSER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +// KDE includes +#include +#include +#include +#include + + +class smb4kWidget : public QVBox +{ +Q_OBJECT +public: + smb4kWidget( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + +private: + +}; + +class KonqSidebar_Smb4K : public KonqSidebarPlugin +{ + Q_OBJECT +public: + /** + * Construct a @ref KonqSidebarPlugin. + * + * @param inst The sidebar's kinstance class. + * @param parent The sidebar internal button info class responsible for this plugin. + * @param widgetParent The container which will contain the plugins widget. + * @param desktopName The filename of the configuration file. + * @param name A Qt object name for your plugin. + **/ + KonqSidebar_Smb4K(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name=0); + + /** destructor */ + ~KonqSidebar_Smb4K(); + + KHTMLPart* m_part; + virtual QWidget *getWidget(){ return (QWidget*)widget;} + virtual void *provides(const QString &) {return 0;} + void emitStatusBarText (const QString &) {;} + +private: + /** + * The browser part + */ + KParts::Part *m_browser_part; + + /** + * The search dialog part + */ + KParts::Part *m_search_part; + +protected: + /** + * The main plugin widget. Contains a klistview and a ktoolbox objects + */ + smb4kWidget *widget; + + QString currentKonquerorURL; + + + virtual void handleURL(const KURL &url); +protected slots: + /** + * This slot initializes a rescan of the network neighborhood. + */ + void slotRescan(); + /** + * This slot is connected to the clicked() signal of the topBar search button + * It brings up the "Search" dialog. + */ + void slotSearch(); + /** + * Opens the configuration dialog. + */ + void slotSmb4KOptionsDlg(); + /** + * This slot is invoked when the config dialog is closed and the settings have + * been changed. Emits the reloadSettings() signal and adjusts the system tray + * widget to the new settings afterwards. + */ + void slotSettingsChanged(); + /** + * Called from mounter when a share is mounted + */ + void slotMountedShare( const QString & ); + /** + * Called from the mounter just before a share is unmounted. This slot + * changes the URL to the user's home so that we can unmount the share + * without problems. + * + * @param mountpoint The mount point of the share that's going to + * be unmounted. + */ + void slotPrepareUnmount( const QString &mounpoint ); + signals: + // see + void openURLRequest(const KURL &url, + const KParts::URLArgs &args = KParts::URLArgs()); +}; + +#endif diff --git a/po/Makefile.am b/po/Makefile.am new file mode 100644 index 0000000..4fe3ba5 --- /dev/null +++ b/po/Makefile.am @@ -0,0 +1,4 @@ +POFILES = AUTO + +EXTRA_DIST=smb4k.pot + diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..17f02d2 --- /dev/null +++ b/po/de.po @@ -0,0 +1,4040 @@ +# translation of de.po to Deutsch +# Alexander Reinholdt , 2003, 2004, 2005, 2006. +# Alexander Reinholdt , 2006. +# Alexander Reinholdt , 2006, 2007, 2008. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-20 08:48+0200\n" +"PO-Revision-Date: 2008-04-20 09:48+0200\n" +"Last-Translator: Alexander Reinholdt \n" +"Language-Team: Deutsch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: smb4k/smb4k.cpp:84 +msgid "&Dock Widgets" +msgstr "An&dockfenster" + +#: smb4k/smb4k.cpp:108 smb4k/smb4k.cpp:112 smb4k/smb4k.cpp:287 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:170 +msgid "Network Browser" +msgstr "Netzwerkbrowser" + +#: smb4k/smb4k.cpp:118 smb4k/smb4k.cpp:122 smb4k/smb4k.cpp:316 +#: plugin/smb4k_konqplugin.cpp:149 +msgid "Search Dialog" +msgstr "Suchdialog" + +#: smb4k/smb4k.cpp:156 +msgid "Shares Vie&w" +msgstr "Freigabenan&zeige" + +#: smb4k/smb4k.cpp:159 +msgid "&Icon View" +msgstr "Symbolans&icht" + +#: smb4k/smb4k.cpp:163 +msgid "List Vie&w" +msgstr "Liste&nansicht" + +#: smb4k/smb4k.cpp:203 smb4k/smb4k.cpp:771 +msgid "Ready." +msgstr "Bereit." + +#: smb4k/smb4k.cpp:264 +msgid "Jump to shares view" +msgstr "Springe zur Freigabenanzeige" + +#: smb4k/smb4k.cpp:293 +msgid "Jump to network browser" +msgstr "Springe zum Netzwerkbrowser" + +#: smb4k/smb4k.cpp:332 +msgid "Jump to search dialog" +msgstr "Springe zum Suchdialog" + +#: smb4k/smb4k.cpp:463 +msgid "" +"Closing the main window will keep Smb4K running in the system tray. Use " +"\"Quit\" from the \"File\" menu to quit the application." +msgstr "" +"Wenn Sie das Hauptfenster schließen, wird Smb4K im Systemabschnitt " +"weiterlaufen. Benutzen Sie \"Beenden\" im Menü \"Datei\", um die Anwendung " +"zu verlassen." + +#: smb4k/smb4k.cpp:465 +msgid "Docking in System Tray" +msgstr "Andocken in den Systemabschnitt" + +#: smb4k/smb4k.cpp:496 +msgid "Exiting..." +msgstr "Verlasse..." + +#: smb4k/smb4k.cpp:649 +msgid "Looking up workgroups and domains..." +msgstr "Suche Arbeitsgruppen und Domänen..." + +#: smb4k/smb4k.cpp:655 +msgid "Querying current master browser..." +msgstr "Frage derzeitigen Masterbrowser ab..." + +#: smb4k/smb4k.cpp:661 +msgid "Querying master browser %1..." +msgstr "Frage Masterbrowser %1 ab..." + +#: smb4k/smb4k.cpp:667 +msgid "Scanning broadcast areas..." +msgstr "Durchsuche Broadcastbereiche..." + +#: smb4k/smb4k.cpp:681 +msgid "Opening workgroup..." +msgstr "Öffne Arbeitsgruppe..." + +#: smb4k/smb4k.cpp:687 +msgid "Retrieving list of shares..." +msgstr "Frage Freigabenliste ab..." + +#: smb4k/smb4k.cpp:693 +msgid "Retrieving additional information..." +msgstr "Frage zusätzliche Informationen ab..." + +#: smb4k/smb4k.cpp:699 +msgid "Searching..." +msgstr "Suche..." + +#: smb4k/smb4k.cpp:705 +msgid "Retrying to retrieve list of shares..." +msgstr "Frage Freigabenliste erneut ab..." + +#: smb4k/smb4k.cpp:711 smb4k/smb4k.cpp:729 smb4k/smb4k.cpp:741 +#: smb4k/smb4k.cpp:753 smb4k/smb4k.cpp:765 +msgid "Done." +msgstr "Fertig." + +#: smb4k/smb4k.cpp:717 +msgid "Mounting share..." +msgstr "Hänge Freigabe ein..." + +#: smb4k/smb4k.cpp:723 +msgid "Unmounting share..." +msgstr "Hänge Freigabe aus..." + +#: smb4k/smb4k.cpp:735 +msgid "Printing file..." +msgstr "Drucke Datei..." + +#: smb4k/smb4k.cpp:747 +msgid "Synchronizing data..." +msgstr "Synchronisiere Daten..." + +#: smb4k/smb4k.cpp:759 +msgid "Generating preview..." +msgstr "Erzeuge Vorschau..." + +#: smb4k/smb4k.cpp:819 smb4k/smb4ksystemtray.cpp:236 +msgid "&Edit Bookmarks" +msgstr "L&esezeichen bearbeiten" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:55 +msgid "Default Destination" +msgstr "Standardzielverzeichnis" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:59 +msgid "Rsync prefix:" +msgstr "Basisverzeichnis für Rsync:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:63 +#: smb4k/configdlg/smb4krsyncoptions.cpp:166 +#: smb4k/configdlg/smb4krsyncoptions.cpp:209 +msgid "General" +msgstr "Allgemein" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:67 +msgid "Archive mode" +msgstr "Archivierungsmodus" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:68 +msgid "Recurse into directories" +msgstr "Steige in Verzeichnisse hinab" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:69 +msgid "Skip files that are newer in target directory" +msgstr "Übergehe neuere Dateien auf Empfängerseite" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:70 smb4k/core/smb4ksettings.cpp:819 +msgid "Update destination files in place" +msgstr "Aktualisiere Dateien am Platz" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:71 smb4k/core/smb4ksettings.cpp:823 +msgid "Use relative path names" +msgstr "Benutze relative Pfadnamen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:72 +msgid "Don't send implied directories" +msgstr "Sende keine inbegriffenen Verzeichnisse" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:73 smb4k/core/smb4ksettings.cpp:831 +msgid "Transfer directories without recursing" +msgstr "Übertrage Verzeichnisse nicht rekursiv" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:74 smb4k/core/smb4ksettings.cpp:835 +msgid "Compress data during transfer" +msgstr "Komprimiere Daten beim Transfer" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:76 +msgid "Links" +msgstr "Links" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:79 smb4k/core/smb4ksettings.cpp:839 +msgid "Preserve symlinks" +msgstr "Erhalte Symlinks" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:80 smb4k/core/smb4ksettings.cpp:843 +msgid "Transform symlinks" +msgstr "Transformiere Symlinks" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:81 smb4k/core/smb4ksettings.cpp:847 +msgid "Only transform unsafe symlinks" +msgstr "Transformiere nur unsichere Symlinks" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:82 smb4k/core/smb4ksettings.cpp:851 +msgid "Ignore unsafe symlinks" +msgstr "Ignoriere unsichere Symlinks" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:83 smb4k/core/smb4ksettings.cpp:855 +msgid "Preserve hard links" +msgstr "Erhalte harte Links" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:84 smb4k/core/smb4ksettings.cpp:859 +msgid "Keep directory symlinks" +msgstr "Erhalte Symlinks zu Verzeichnissen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:86 +msgid "File Permissions, etc." +msgstr "Zugriffsrechte, etc." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:90 smb4k/core/smb4ksettings.cpp:863 +msgid "Preserve permissions" +msgstr "Erhalte Zugriffsrechte" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:91 smb4k/core/smb4ksettings.cpp:867 +msgid "Preserve group" +msgstr "Erhalte Gruppe" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:92 +msgid "Preserve owner" +msgstr "Erhalte Eigentümer" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:93 smb4k/core/smb4ksettings.cpp:875 +msgid "Preserve device and special files" +msgstr "Erhalte Blockgeräte und spezielle Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:94 smb4k/core/smb4ksettings.cpp:879 +msgid "Preserve times" +msgstr "Erhalte Zeiten" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:95 smb4k/core/smb4ksettings.cpp:883 +msgid "Omit directories when preserving times" +msgstr "Übergehe Verzeichnisse beim Erhalten der Zeiten" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:105 +msgid "Copying" +msgstr "Kopieren" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:115 +msgid "File Deletion" +msgstr "Löschen von Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:118 smb4k/core/smb4ksettings.cpp:887 +msgid "Remove synchronized source files" +msgstr "Lösche synchronisierte Quelldateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:119 smb4k/core/smb4ksettings.cpp:891 +msgid "Delete extraneous files" +msgstr "Lösche fremde Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:120 smb4k/core/smb4ksettings.cpp:895 +msgid "Delete files before transfer" +msgstr "Lösche Dateien vor dem Transfer" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:121 smb4k/core/smb4ksettings.cpp:899 +msgid "Delete files after transfer" +msgstr "Lösche Dateien nach dem Transfer" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:122 smb4k/core/smb4ksettings.cpp:903 +msgid "Delete files during transfer" +msgstr "Lösche Dateien während des Transfers" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:123 +msgid "Also delete excluded files" +msgstr "Lösche auch ausgeschlossene Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:124 smb4k/core/smb4ksettings.cpp:911 +msgid "Delete even if I/O errors occur" +msgstr "Lösche sogar bei Ein-/Ausgabefehlern" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:125 smb4k/core/smb4ksettings.cpp:915 +msgid "Force deletion of non-void directories" +msgstr "Erzwinge Löschen nicht leerer Verzeichnisse" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:127 +msgid "Restrictions" +msgstr "Beschränkungen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:130 +msgid "Don't delete more than this many files:" +msgstr "Lösche nicht mehr Dateien als:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:133 +msgid "File Transfer" +msgstr "Dateiübertragung" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:137 +msgid "Don't transfer any file smaller than:" +msgstr "Übertrage keine Datei kleiner als:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:140 +msgid "Don't transfer any file larger than:" +msgstr "Übertrage keine Datei größer als:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:143 smb4k/core/smb4ksettings.cpp:943 +msgid "Keep partially transferred files" +msgstr "Bewahre teilweise übertragene Dateien auf" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:145 +msgid "Put a partially transferred file into:" +msgstr "Lege teilweise übertragene Dateien ab in:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:156 +msgid "File Deletion && Transfer" +msgstr "Löschen && Transfer von Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:170 smb4k/core/smb4ksettings.cpp:954 +msgid "Auto-ignore files in the same way CVS does" +msgstr "Ignoriere Dateien automatisch genauso wie CVS" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:172 +msgid "Exclude files matching this pattern:" +msgstr "Schließe Dateien aufgrund dieses Musters aus:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:174 +msgid "Read exclude patterns from:" +msgstr "Lese Muster für Ausschluss von:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:177 +msgid "Don't exclude files matching this pattern:" +msgstr "Berücksichtige Dateien aufgrund dieses Musters:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:179 +msgid "Read include patterns from:" +msgstr "Lese Muster für Berücksichtigung von:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:183 +msgid "Filter Rules" +msgstr "Filterregeln" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:186 +msgid "" +"The rules defined below will be added to the \"rsync\" command as they are. " +"Thus, you have to start with the --filter=... argument." +msgstr "" +"Die unten definierten Regeln werden dem \"rsync\" Befehl ohne Änderungen " +"hinzugefügt. Sie müssen daher mit dem '--filter=' Argument beginnen." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:189 +msgid "Special filter rules:" +msgstr "Spezielle Filterregeln:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:190 +msgid "Use --filter='dir-merge /.rsync-filter' filter rule" +msgstr "Benutze die --filter='dir-merge /.rsync-filter' Filterregel" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:191 +msgid "Use --filter='exclude .rsync-filter' filter rule" +msgstr "Benutze die --filter='exclude .rsync-filter' Filterregel" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:199 +msgid "Filtering" +msgstr "Filterung" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:213 smb4k/core/smb4ksettings.cpp:998 +msgid "Handle sparse files efficiently" +msgstr "Handhabe zerstreute Dateien effizient" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:214 smb4k/core/smb4ksettings.cpp:1002 +msgid "Copy files whole (no rsync algorithm)" +msgstr "Kopiere Dateien im Ganzen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:215 +msgid "Don't cross file system boundaries" +msgstr "Überschreite keine Dateisystemgrenzen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:216 +msgid "Only update files that already exist" +msgstr "Aktualisiere nur bereits existierende Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:217 +msgid "Ignore files that already exist" +msgstr "Ignoriere bereits existierende Dateien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:218 +msgid "Delay updates until the end of transfer" +msgstr "Verzögere Updates bis zum Transferende" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:220 +msgid "Backup" +msgstr "Sicherheitskopien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:223 smb4k/core/smb4ksettings.cpp:1022 +msgid "Make backups" +msgstr "Mache Sicherheitskopien" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:225 +msgid "Backup suffix:" +msgstr "Suffix für Sicherheitskopien:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:227 +msgid "Backup directory:" +msgstr "Verzeichnis für Sicherheitskopien:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:231 +msgid "Checksums" +msgstr "Prüfsummen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:234 +msgid "Force fixed checksum block size:" +msgstr "Erzwinge feste Prüfsummen-Blockgröße:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:236 +msgid "Set block/file checksum seed:" +msgstr "Setze Anfangswert für Block-/Dateiprüfsummen:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:238 +msgid "Skip files based on checksum" +msgstr "Überspringe aufgrund von Prüfsumme" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:248 +msgid "Advanced" +msgstr "Erweitert" + +#: smb4k/configdlg/smb4kshareoptions.cpp:53 +msgid "Directories" +msgstr "Verzeichnisse" + +#: smb4k/configdlg/smb4kshareoptions.cpp:59 +msgid "Mount prefix:" +msgstr "Basisverzeichnis für das Einhängen:" + +#: smb4k/configdlg/smb4kshareoptions.cpp:66 +msgid "Force generated subdirectories to be lower case" +msgstr "Erzwinge Kleinschreibung für die erstellten Unterverzeichnisse" + +#: smb4k/configdlg/smb4kshareoptions.cpp:69 +msgid "Mounting and Unmounting" +msgstr "Ein- und Aushängen" + +#: smb4k/configdlg/smb4kshareoptions.cpp:70 +msgid "Unmount all shares of user %1 on exit" +msgstr "Hänge alle Freigaben von Benutzer %1 beim Programmende aus" + +#: smb4k/configdlg/smb4kshareoptions.cpp:72 +msgid "Remount recently used shares on program start" +msgstr "Hänge vormals benutzte Freigaben beim Programmstart ein" + +#: smb4k/configdlg/smb4kshareoptions.cpp:74 +msgid "Allow the unmounting of shares that are owned by other users" +msgstr "Erlaube das Aushängen von Freigaben, die zu anderen Benutzern gehören" + +#: smb4k/configdlg/smb4kshareoptions.cpp:77 +msgid "Checks" +msgstr "Checks" + +#: smb4k/configdlg/smb4kshareoptions.cpp:79 +msgid "Interval between checks:" +msgstr "Intervall zwischen Checks:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:50 +msgid "Browse List" +msgstr "Browseliste" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:53 +msgid "Scan the network neighborhood for available workgroups and domains" +msgstr "Durchsuche die Netzwerkumgebung nach Arbeitsgruppen und Domänen" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:55 +msgid "Query the current workgroup master browser" +msgstr "Frage den derzeitigen Masterbrowser der Arbeitsgruppe ab" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:62 +msgid "Query this master browser:" +msgstr "Frage diesen Masterbrowser ab:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:65 +msgid "Scan broadcast areas:" +msgstr "Durchsuche Broadcastbereiche:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:80 +msgid "Network Search" +msgstr "Netzwerksuche" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:85 +msgid "" +"Smb4K uses \"nmblookup\" by default to search for remote hosts. This method " +"is very reliable but fails sometimes if your network neighborhood is " +"configured uncommonly. In this case you should try to use \"smbclient\"." +msgstr "" +"Smb4K benutzt standardmäßig \"nmblookup\", um entfernte Rechner zu suchen. " +"Diese Methode ist sehr zuverlässig, kann aber fehlschlagen, wenn die " +"Netzwerkumgebung ungewöhnlich konfiguriert ist. In diesem Fall sollten Sie " +"\"smbclient\" ausprobieren." + +#: smb4k/configdlg/smb4knetworkoptions.cpp:88 +msgid "Use nmblookup (recommended)" +msgstr "Benutze nmblookup (empfohlen)" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:91 +msgid "Use smbclient" +msgstr "Benutze smbclient" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:162 +msgid "User Interface" +msgstr "Benutzerschnittstelle" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:163 +#: smb4k/browser/smb4knetworkbrowser.cpp:50 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:186 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:319 +msgid "Network" +msgstr "Netzwerk" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:164 +#: smb4k/listview/smb4kshareslistview_part.cpp:144 +#: smb4k/listview/smb4kshareslistview_part.cpp:346 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:141 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:232 +msgid "Shares" +msgstr "Freigaben" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:165 +#: smb4k/configdlg/smb4ksambaoptions.cpp:89 +#: smb4k/core/smb4kpasswordhandler.cpp:237 +msgid "Authentication" +msgstr "Authentifizierung" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:166 +msgid "Samba" +msgstr "Samba" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:167 +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47 +msgid "Synchronization" +msgstr "Synchronisation" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:168 +msgid "Super User" +msgstr "Administrator" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:327 +#: smb4k/configdlg/smb4kconfigdialog.cpp:328 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1039 +#: smb4k/configdlg/smb4ksambaoptions.cpp:400 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:970 +msgid "auto" +msgstr "automatisch" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:331 +#: smb4k/configdlg/smb4kconfigdialog.cpp:352 +#: smb4k/configdlg/smb4kconfigdialog.cpp:441 +#: smb4k/configdlg/smb4kconfigdialog.cpp:451 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1098 +#: smb4k/configdlg/smb4ksambaoptions.cpp:428 +msgid "yes" +msgstr "ja" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:332 +#: smb4k/configdlg/smb4kconfigdialog.cpp:353 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1099 +#: smb4k/configdlg/smb4ksambaoptions.cpp:427 +msgid "no" +msgstr "nein" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:360 +#: smb4k/configdlg/smb4kconfigdialog.cpp:458 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1060 +#: smb4k/configdlg/smb4ksambaoptions.cpp:215 +#: smb4k/configdlg/smb4ksambaoptions.cpp:418 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:913 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-write" +msgstr "beschreibbar" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:361 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1061 +#: smb4k/configdlg/smb4ksambaoptions.cpp:216 +#: smb4k/configdlg/smb4ksambaoptions.cpp:419 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-only" +msgstr "schreibgeschützt" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:460 +#: smb4k/configdlg/smb4kconfigdialog.cpp:465 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1072 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1082 +#: smb4k/configdlg/smb4ksambaoptions.cpp:141 +#: smb4k/configdlg/smb4ksambaoptions.cpp:167 +msgid "default" +msgstr "Standard" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:707 +msgid "[Network] The custom master browser has not been entered.\n" +msgstr "" +"[Netzwerk] Der benutzerdefinierte Masterbrowser ist nicht eingetragen " +"worden.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:722 +msgid "[Network] The broadcast areas have not been entered.\n" +msgstr "[Netzwerk] Die Broadcastbereiche sind nicht eingetragen worden.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:733 +msgid "[Shares] The mount prefix is empty.\n" +msgstr "[Freigaben] Das Basisverzeichnis zum Einhängen der Freigaben ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:748 +msgid "[Authentication] The default user name has not been entered.\n" +msgstr "" +"[Authentifizierung] Der standardmäßige Benutzername wurde nicht " +"eingetragen.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:759 +msgid "[Samba] The file mask is empty.\n" +msgstr "[Samba] Die Dateimaske ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:770 +msgid "[Samba] The directory mask is empty.\n" +msgstr "[Samba] Die Verzeichnismaske ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:781 +msgid "[Samba] The UID is empty.\n" +msgstr "[Samba] Die Benutzerkennung (UID) ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:792 +msgid "[Samba] The GID is empty.\n" +msgstr "[Samba] Die Gruppenkennung (GID) ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:803 +msgid "[Synchronization] The rsync prefix is empty.\n" +msgstr "[Synchronisation] Das Basisverzeichnis für rsync ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:816 +msgid "" +"[Synchronization] The directory where partially transferred files should be " +"stored is empty.\n" +msgstr "" +"[Synchronisation] Das Verzeichnis, in dem teilweise übertragene Dateien " +"abgelegt werden sollen, ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:829 +msgid "[Synchronization] The exclude patterns have not been entered.\n" +msgstr "[Synchronisation] Die Ausschlussmuster wurden nicht eingetragen.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:842 +msgid "[Synchronization] The path of the exclude file is empty.\n" +msgstr "[Synchronisation] Der Pfad der Ausschlussdatei ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:855 +msgid "[Synchronization] The include patterns have not been entered.\n" +msgstr "[Synchronisation] Die Einschlussmuster wurden nicht eingetragen.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:868 +msgid "[Synchronization] The path of the include file is empty.\n" +msgstr "[Synchronisation] Der Pfad zur Einschlussdatei ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:887 +msgid "[Synchronization] The backup suffix has not been defined.\n" +msgstr "" +"[Synchronisation] Das Suffix für die Sicherheitskopien wurde nicht " +"angegeben.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:900 +msgid "[Synchronization] The backup directory is empty.\n" +msgstr "[Synchronisation] Das Verzeichnis für die Sicherheitskopien ist leer.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:908 +msgid "" +"The configuration could not be written, because one setting is incomplete:\n" +"%1Please correct this issue." +msgstr "" +"Die Konfiguration konnte nicht geschrieben werden, da eine Einstellung nicht " +"vollständig ist:\n" +"%1Bitte korrigieren Sie dieses Problem." + +#: smb4k/configdlg/smb4kconfigdialog.cpp:912 +msgid "" +"The configuration could not be written, because %1 settings are incomplete:\n" +"%1Please correct these issues." +msgstr "" +"Die Konfiguration konnte nicht geschrieben werden, da %1 Einstellungen nicht " +"vollständig sind:\n" +"%1Bitte korrigieren Sie diese Probleme." + +#: smb4k/configdlg/smb4kconfigdialog.cpp:1191 +msgid "Smb4KConfigDialog" +msgstr "Smb4KConfigDialog" + +#: smb4k/configdlg/smb4kauthoptions.cpp:52 +msgid "Password Storage" +msgstr "Passwortspeicherung" + +#: smb4k/configdlg/smb4kauthoptions.cpp:53 +msgid "Save the authentication data in a wallet" +msgstr "Speichere die Anmeldedaten in einer digitalen Brieftasche" + +#: smb4k/configdlg/smb4kauthoptions.cpp:55 +msgid "If no wallet is used, remember authentication data during run time" +msgstr "" +"Falls keine digitale Brieftasche genutzt wird, halte die Anmeldedaten bis " +"zum Ende vorrätig" + +#: smb4k/configdlg/smb4kauthoptions.cpp:58 +msgid "Default Login" +msgstr "Standardanmeldung" + +#: smb4k/configdlg/smb4kauthoptions.cpp:62 +msgid "Use default login" +msgstr "Benutze Standardanmeldung" + +#: smb4k/configdlg/smb4kauthoptions.cpp:69 +#: smb4k/core/smb4kpasswordhandler.cpp:291 +#: smb4k/core/smb4khomesshareshandler.cpp:89 +msgid "User:" +msgstr "Benutzer:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:72 +msgid "This login name is used by default to authenticate to a remote server." +msgstr "" +"Dieser Anmeldename wird standardmäßig für die Anmeldung bei einem entfernten " +"Server benutzt." + +#: smb4k/configdlg/smb4kauthoptions.cpp:73 +#: smb4k/core/smb4kpasswordhandler.cpp:311 +msgid "Password:" +msgstr "Passwort:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:77 +msgid "" +"This password is used by default to authenticate to a remote server. It may " +"be empty." +msgstr "" +"Dieses Passwort wird standardmäßig für die Anmeldung bei einem entfernten " +"Server benutzt. Es darf leer sein." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:70 +msgid "General Options" +msgstr "Allgemeine Einstellungen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:73 +msgid "NetBIOS name:" +msgstr "NetBIOS-Name:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:76 +msgid "Domain:" +msgstr "Domäne:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:79 +msgid "Socket options:" +msgstr "Socket-Einstellungen:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:82 +msgid "NetBIOS scope:" +msgstr "NetBIOS-Scope:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:85 +msgid "Remote SMB port:" +msgstr "Ferner SMB-Port:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:91 +msgid "Try to authenticate with Kerberos" +msgstr "Versuche eine Anmeldung mit Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:92 +msgid "Authenticate as machine account" +msgstr "Anmeldung als Maschinenaccount" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:100 +msgid "General Settings" +msgstr "Allgemeine Einstellungen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:110 +#: smb4k/configdlg/smb4ksambaoptions.cpp:384 +#: smb4k/listview/smb4kshareslistview.cpp:56 +msgid "File System" +msgstr "Dateisystem" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:120 +msgid "" +"NOTE: You might need to enable support for either \"super\" or \"sudo\" in " +"the Super User page." +msgstr "" +"HINWEIS: Sie müssen eventuell zusätzlich die Unterstützung für \"super\" " +"oder \"sudo\" unter Administrator einschalten." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:124 +msgid "User and Group" +msgstr "Benutzer und Gruppe" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:127 +#: smb4k/configdlg/smb4ksambaoptions.cpp:430 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:292 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:317 +msgid "User ID:" +msgstr "Benutzer:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:131 +#: smb4k/configdlg/smb4ksambaoptions.cpp:435 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:296 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:321 +msgid "Group ID:" +msgstr "Gruppe:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:136 +msgid "Charset and Codepage" +msgstr "Zeichensatz und Codepage" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:139 +msgid "Client charset:" +msgstr "Zeichensatz Klient:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:165 +msgid "Server codepage:" +msgstr "Codepage Server:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:202 +msgid "Permissions" +msgstr "Zugriffsrechte" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:205 +msgid "File mask:" +msgstr "Dateimaske:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:209 +msgid "Directory mask:" +msgstr "Verzeichnismaske:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:213 +#: smb4k/configdlg/smb4ksambaoptions.cpp:414 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:286 +msgid "Write access:" +msgstr "Schreibzugriff:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:220 +msgid "Advanced CIFS Options" +msgstr "Erweiterte CIFS-Optionen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:227 smb4k/core/smb4ksettings.cpp:692 +msgid "Do permission checks" +msgstr "Überprüfe Zugriffsrechte" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:229 +msgid "Attempt to set UID and GID" +msgstr "Versuche Benutzer und Gruppe zu setzen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:231 smb4k/core/smb4ksettings.cpp:700 +msgid "Use server inode numbers" +msgstr "Benutze Inode-Nummern des Servers" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:233 smb4k/core/smb4ksettings.cpp:704 +msgid "Do not cache inode data" +msgstr "Speichere keine Inode-Daten zwischen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:235 smb4k/core/smb4ksettings.cpp:708 +msgid "Translate reserved characters" +msgstr "Übersetze reservierte Zeichen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:237 smb4k/core/smb4ksettings.cpp:712 +msgid "Do not use locking" +msgstr "Benutze keine Sperrung (locking)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:244 +msgid "Additional options:" +msgstr "Zusätzliche Optionen:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:248 +msgid "Advanced SMBFS Options" +msgstr "Erweiterte SMBFS-Optionen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:251 +msgid "Use Unicode when communicating with the server" +msgstr "Benutze Unicode für die Kommunikation mit dem Server" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:252 +msgid "Use large file support" +msgstr "Benutze Unterstützung für große Dateien (LFS)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:258 +msgid "Caching time of directory listings:" +msgstr "Pufferzeit für Verzeichnisbaum:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:289 +msgid "Protocol Hint" +msgstr "Protokollhinweis" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:291 +msgid "Automatic detection" +msgstr "Automatische Erkennung" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:293 +msgid "RPC: Modern operating systems" +msgstr "RPC: Moderne Betriebssysteme" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:295 +msgid "RAP: Older operating systems" +msgstr "RAP: Ältere Betriebssysteme" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:297 +msgid "ADS: Active Directory environment (LDAP/Kerberos)" +msgstr "ADS: Active Directory-Umgebung (LDAP/Kerberos)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:318 +msgid "Name resolve order:" +msgstr "Auflösungsreihenfolge:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:321 +msgid "Buffer size:" +msgstr "Puffergröße:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:323 +msgid " Bytes" +msgstr " Bytes" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:325 +msgid "Signing state:" +msgstr "Signierstatus:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:327 +msgid "none" +msgstr "keiner" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:328 +msgid "on" +msgstr "ein" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:329 +msgid "off" +msgstr "aus" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:330 +msgid "required" +msgstr "benötigt" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:354 +msgid "Broadcast address:" +msgstr "Broadcast-Adresse:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:357 +msgid "Try and bind to UDP port 137 to send and receive UDP datagrams" +msgstr "Benutze UDP-Port 137 zum Austausch von UDP-Datagrammen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:381 +#: smb4k/listview/smb4kshareslistview.cpp:51 +msgid "Item" +msgstr "Eintrag" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:382 +msgid "Protocol" +msgstr "Protokoll" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:385 +msgid "Write Access" +msgstr "Schreibzugriff" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:387 +msgid "Kerberos" +msgstr "Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:388 +msgid "UID" +msgstr "UID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:389 +msgid "GID" +msgstr "GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:390 +msgid "Port" +msgstr "Port" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:396 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:177 +msgid "Protocol:" +msgstr "Protokoll:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:407 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:136 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:279 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:136 +msgid "File system:" +msgstr "Dateisystem:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:423 +msgid "Kerberos:" +msgstr "Kerberos:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:440 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:164 +msgid "Port:" +msgstr "Port:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:451 +msgid "Remove All" +msgstr "Alle löschen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:493 +msgid "Custom" +msgstr "Benutzerdefiniert" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:52 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:171 +msgid "Shares View" +msgstr "Freigabenanzeige" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:55 +msgid "Show mounted shares in an icon view" +msgstr "Zeige die eingehängten Freigaben in einer Symbolansicht an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:57 +msgid "Show mounted shares in a list view" +msgstr "Zeige die eingehängten Freigaben in einer Listenansicht an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:62 +#: smb4k/core/smb4ksettings.cpp:117 +msgid "Show custom bookmark label if available" +msgstr "Zeige die benutzerdefinierte Lesezeichenbeschriftung an, falls vorhanden" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:64 +msgid "System Tray" +msgstr "Systemabschnitt" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:67 +msgid "Embed application into the system tray" +msgstr "Bette die Anwendung in den Systemabschnitt ein" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:83 +msgid "Remote Shares" +msgstr "Entfernte Freigaben" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:85 +#: smb4k/core/smb4ksettings.cpp:144 +msgid "Show printer shares" +msgstr "Zeige Drucker-Freigaben an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:86 +#: smb4k/core/smb4ksettings.cpp:148 +msgid "Show hidden shares" +msgstr "Zeige versteckte Freigaben an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:87 +msgid "Show IPC$ shares" +msgstr "Zeige IPC$-Freigaben an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:88 +msgid "Show ADMIN$ shares" +msgstr "Zeige ADMIN$-Freigaben an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:90 +msgid "Columns" +msgstr "Zeilen" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:92 +msgid "Show type" +msgstr "Zeige Typ an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:93 +msgid "Show IP address" +msgstr "Zeige IP-Adresse an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:94 +msgid "Show comment" +msgstr "Zeige Kommentar an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:96 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:124 +msgid "Tooltips" +msgstr "Tooltips" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:98 +msgid "Show tooltip with information about a network item" +msgstr "Zeige Tooltip mit Informationen über den Netzwerkeintrag" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:114 +#: smb4k/smb4ksystemtray.cpp:67 +msgid "Mounted Shares" +msgstr "Eingehängte Freigaben" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:116 +msgid "Show mount point instead of share name" +msgstr "Zeige den Einhängepunkt anstelle des Freigabenamens an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:117 +#: smb4k/core/smb4ksettings.cpp:180 +msgid "Show all shares that are mounted on the system" +msgstr "Zeige alle Freigaben an, die auf dem System eingehängt sind" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:119 +msgid "Drag and Drop" +msgstr "Ziehen und Fallenlassen" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:121 +msgid "Allow dropping of files and directories onto shares" +msgstr "Erlaube das Fallenlassen von Dateien und Verzeichnissen auf Freigaben" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:122 +msgid "Allow dragging of shares" +msgstr "Erlaube das Ziehen von Freigaben" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:126 +msgid "Show tooltip with information about a share" +msgstr "Zeige Tooltip mit Informationen über die Freigabe" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:128 +msgid "List View" +msgstr "Listenansicht" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:132 +#: smb4k/core/smb4ksettings.cpp:200 +msgid "Show owner and group (SMBFS only)" +msgstr "Zeige Eigentümer und Gruppe an (nur SMBFS)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:133 +#: smb4k/core/smb4ksettings.cpp:204 +msgid "Show login (CIFS only)" +msgstr "Zeige den Anmeldenamen an (nur CIFS)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:135 +msgid "Show owner and group" +msgstr "Zeige Eigentümer und Gruppe an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:137 +#: smb4k/core/smb4ksettings.cpp:208 +msgid "Show file system" +msgstr "Zeige das Dateisystem an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:138 +#: smb4k/core/smb4ksettings.cpp:212 +msgid "Show free disk space" +msgstr "Zeige den freien Speicherplatz an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:139 +#: smb4k/core/smb4ksettings.cpp:216 +msgid "Show used disk space" +msgstr "Zeige den verwendeten Speicherplatz an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:140 +#: smb4k/core/smb4ksettings.cpp:220 +msgid "Show total disk space" +msgstr "Zeige den gesamten Speicherplatz an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:141 +#: smb4k/core/smb4ksettings.cpp:224 +msgid "Show disk usage" +msgstr "Zeige die Speicherverwendung an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:158 +msgid "Hidden Files and Directories" +msgstr "Versteckte Dateien und Verzeichnisse" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:159 +msgid "Preview hidden files and directories" +msgstr "Zeige versteckte Dateien und Verzeichnisse in der Vorschau an" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:169 +msgid "Main Window && System Tray" +msgstr "Hauptfenster && Systemabschnitt" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:172 +msgid "Preview Dialog" +msgstr "Vorschaudialog" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:52 +msgid "Programs" +msgstr "Programme" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:55 +msgid "Use the following program to gain super user privileges:" +msgstr "Benutze das folgende Programm um Administratorrechte zu erlangen:" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:59 +msgid "Actions" +msgstr "Aktionen" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:62 +msgid "Use super user privileges to force the unmounting of (inaccessible) shares" +msgstr "" +"Benutze Administratorrechte, um das Aushängen von (unzugänglichen) Freigaben " +"zu erzwingen" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:64 +#: smb4k/core/smb4ksettings.cpp:1082 +msgid "Use super user privileges to mount and unmount shares" +msgstr "Benutze Administratorrechte, um Freigaben ein- und auszuhängen" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:67 +msgid "Remove Entries" +msgstr "Einträge löschen" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:68 +msgid "Remove entries from the configuration file" +msgstr "Entferne die Einträge aus der Konfigurationsdatei" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:69 +msgid "" +"Depending on your choice under \"Programs\", all entries that were written " +"by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. " +"Additionally, all your choices under \"Actions\" will be cleared." +msgstr "" +"Abhängig von Ihrer Wahl unter \"Programme\" werden alle Einträge entweder " +"aus der Datei /etc/super.tab oder /etc/sudoers entfernt, die von Smb4K " +"geschrieben wurden. Zusätzlich wird Ihre Auswahl unter \"Aktionen\" gelöscht." + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:109 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:154 +#: smb4k/dialogs/smb4kprintdialog.cpp:92 smb4k/dialogs/smb4kmountdialog.cpp:79 +msgid "Workgroup:" +msgstr "Arbeitsgruppe:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +msgid "Pseudo master browser:" +msgstr "Pseudo-Masterbrowser:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:158 +msgid "Master browser:" +msgstr "Masterbrowser:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:116 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:136 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:140 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:144 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:160 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:213 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:292 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:301 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:310 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:331 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:335 +#: smb4k/dialogs/smb4kprintdialog.cpp:88 +msgid "Unknown" +msgstr "Unbekannt" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:129 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:207 +#: smb4k/dialogs/smb4kprintdialog.cpp:83 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +msgid "Host:" +msgstr "Rechner:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:132 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:185 +msgid "Comment:" +msgstr "Kommentar:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:135 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:211 +#: smb4k/dialogs/smb4kprintdialog.cpp:86 +msgid "IP address:" +msgstr "IP-Adresse:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:139 +msgid "Operating system:" +msgstr "Betriebssystem:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:143 +msgid "Server string:" +msgstr "Serverkennung:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:182 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:120 +#: smb4k/dialogs/smb4kmountdialog.cpp:70 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:120 +msgid "Share:" +msgstr "Freigabe:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:188 +msgid "Type:" +msgstr "Typ:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:196 +msgid "Mounted:" +msgstr "Eingehängt:" + +#: smb4k/browser/smb4knetworkbrowser.cpp:51 +msgid "Type" +msgstr "Typ" + +#: smb4k/browser/smb4knetworkbrowser.cpp:52 +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:63 +msgid "IP Address" +msgstr "IP-Adresse" + +#: smb4k/browser/smb4knetworkbrowser.cpp:53 +msgid "Comment" +msgstr "Kommentar" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:141 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:532 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:552 +msgid "Scan Netwo&rk" +msgstr "Netzwe&rk durchsuchen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:144 +msgid "&Abort" +msgstr "&Abbrechen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:149 smb4k/smb4ksystemtray.cpp:72 +msgid "M&ount Manually" +msgstr "V&on Hand einhängen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:154 +msgid "Au&thentication" +msgstr "Au&thentifizierung" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:157 +msgid "&Custom Options" +msgstr "B&enutzerdefinierte Einstellungen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:160 +msgid "Add &Bookmark" +msgstr "Lesezeichen hinzufügen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:163 +msgid "Pre&view" +msgstr "&Vorschau" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:166 +msgid "&Print File" +msgstr "Datei &drucken" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:169 +msgid "&Mount" +msgstr "Ein&hängen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:203 +#: smb4k/listview/smb4kshareslistview_part.cpp:111 +#: smb4k/smb4ksystemtray.cpp:790 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:108 +msgid "&Unmount" +msgstr "A&ushängen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:345 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:370 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:400 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:462 +msgid "Scan Compute&r" +msgstr "&Rechner durchsuchen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:383 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:486 +msgid "Scan Wo&rkgroup" +msgstr "A&rbeitsgruppe durchsuchen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:1905 +msgid "Smb4KNetworkBrowserPart" +msgstr "Smb4KNetworkBrowserPart" + +#: smb4k/core/smb4kcore.cpp:248 +msgid "" +"Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will " +"hang if you try to access it.\n" +"Do you want to continue?" +msgstr "" +"Bis einschließlich KDE 3.3.x können KIO und Konqueror CIFS-Freigaben nicht " +"handhaben. Konqueror wird sich aufhängen, falls Sie versuchen, auf die " +"Freigaben zuzugreifen.\n" +"Wollen Sie fortfahren?" + +#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057 +msgid "Buffer size exceeded" +msgstr "Puffergröße überschritten" + +#: smb4k/core/smb4kmounter.cpp:815 smb4k/core/smb4kmounter.cpp:862 +msgid "Do you really want to force the unmounting of this share?" +msgstr "Wollen Sie wirklich das Aushängen dieser Freigabe erzwingen?" + +#: smb4k/core/smb4ksettings.cpp:30 +msgid "The path to the program \"grep\"" +msgstr "Der Pfad zum Programm \"grep\"" + +#: smb4k/core/smb4ksettings.cpp:33 +msgid "The path to the program \"awk\"" +msgstr "Der Pfad zum Programm \"awk\"" + +#: smb4k/core/smb4ksettings.cpp:36 +msgid "The path to the program \"sed\"" +msgstr "Der Pfad zum Programm \"sed\"" + +#: smb4k/core/smb4ksettings.cpp:39 +msgid "The path to the program \"xargs\"" +msgstr "Der Pfad zum Programm \"xargs\"" + +#: smb4k/core/smb4ksettings.cpp:42 +msgid "The path to the program \"rmdir\"" +msgstr "Der Pfad zum Programm \"rmdir\"" + +#: smb4k/core/smb4ksettings.cpp:45 +msgid "The path to the program \"nmblookup\"" +msgstr "Der Pfad zum Programm \"nmblookup\"" + +#: smb4k/core/smb4ksettings.cpp:48 +msgid "The path to the program \"smbclient\"" +msgstr "Der Pfad zum Programm \"smbclient\"" + +#: smb4k/core/smb4ksettings.cpp:51 +msgid "The path to the program \"smbspool\"" +msgstr "Der Pfad zum Programm \"smbspool\"" + +#: smb4k/core/smb4ksettings.cpp:54 +msgid "The path to the program \"net\"" +msgstr "Der Pfad zum Programm \"net\"" + +#: smb4k/core/smb4ksettings.cpp:57 +msgid "The path to the program \"mount.cifs\"" +msgstr "Der Pfad zum Programm \"mount.cifs\"" + +#: smb4k/core/smb4ksettings.cpp:60 +msgid "The path to the program \"umount.cifs\"" +msgstr "Der Pfad zum Programm \"umount.cifs\"" + +#: smb4k/core/smb4ksettings.cpp:63 +msgid "The path to the program \"smbmount\"" +msgstr "Der Pfad zum Programm \"smbmount\"" + +#: smb4k/core/smb4ksettings.cpp:66 +msgid "The path to the program \"smbumount\"" +msgstr "Der Pfad zum Programm \"smbumount\"" + +#: smb4k/core/smb4ksettings.cpp:69 +msgid "The path to the program \"mount\"" +msgstr "Der Pfad zum Programm \"mount\"" + +#: smb4k/core/smb4ksettings.cpp:72 +msgid "The path to the program \"mount_smbfs\" (FreeBSD only)" +msgstr "Der Pfad zum Programm \"mount_smbfs\" (nur FreeBSD)" + +#: smb4k/core/smb4ksettings.cpp:75 +msgid "The path to the program \"smbutil\" (FreeBSD only)" +msgstr "Der Pfad zum Programm \"smbutil\" (nur FreeBSD)" + +#: smb4k/core/smb4ksettings.cpp:78 +msgid "The path to the program \"umount\"" +msgstr "Der Pfad zum Programm \"umount\"" + +#: smb4k/core/smb4ksettings.cpp:81 +msgid "The path to the program \"smb4k_mount\"" +msgstr "Der Pfad zum Programm \"smb4k_umount\"" + +#: smb4k/core/smb4ksettings.cpp:84 +msgid "The path to the program \"smb4k_umount\"" +msgstr "Der Pfad zum Programm \"smb4k_umount\"" + +#: smb4k/core/smb4ksettings.cpp:87 +msgid "The path to the program \"smb4k_kill\"" +msgstr "Der Pfad zum Programm \"smb4k_kill\"" + +#: smb4k/core/smb4ksettings.cpp:90 +msgid "The path to the program \"smb4k_cat\"" +msgstr "Der Pfad zum Programm \"smb4k_cat\"" + +#: smb4k/core/smb4ksettings.cpp:93 +msgid "The path to the program \"smb4k_mv\"" +msgstr "Der Pfad zum Programm \"smb4k_mv\"" + +#: smb4k/core/smb4ksettings.cpp:96 +msgid "The path to the program \"super\" (optional)" +msgstr "Der Pfad zum Programm \"super\" (optional)" + +#: smb4k/core/smb4ksettings.cpp:99 +msgid "The path to the program \"sudo\" (optional)" +msgstr "Der Pfad zum Programm \"sudo\" (optional)" + +#: smb4k/core/smb4ksettings.cpp:102 +msgid "The path to the program \"dvips\" (optional)" +msgstr "Der Pfad zum Programm \"dvips\" (optional)" + +#: smb4k/core/smb4ksettings.cpp:105 +msgid "The path to the program \"enscript\" (optional)" +msgstr "Der Pfad zum Programm \"enscript\" (optional)" + +#: smb4k/core/smb4ksettings.cpp:108 +msgid "The path to the program \"rsync\" (optional)" +msgstr "Der Pfad zum Programm \"rsync\" (optional)" + +#: smb4k/core/smb4ksettings.cpp:111 +msgid "The path to the program \"konsole\" (optional)" +msgstr "Der Pfad zum Programm \"konsole\" (optional)" + +#: smb4k/core/smb4ksettings.cpp:118 +msgid "" +"Do not show the name of the share that is represented by the bookmark but " +"the custom label that was defined in the bookmark editor." +msgstr "" +"Zeige nicht den Namen der Freigabe an, die durch das Lesezeichen " +"repräsentiert wird, sondern die benutzerdefinierte Beschriftung, die im " +"Lesezeicheneditor definiert wurde." + +#: smb4k/core/smb4ksettings.cpp:121 +msgid "Embed application into system tray" +msgstr "Bette die Anwendung in den Systemabschnitt ein" + +#: smb4k/core/smb4ksettings.cpp:122 +msgid "" +"Embed the application into the system tray. The system tray widget provides " +"a popup menu with several commonly used tasks so that you do not need to " +"bring up the main window everytime. If this setting is chosen you have to " +"use \"Quit\" from the \"File\" menu or the system tray widget to exit the " +"application." +msgstr "" +"Bette die Anwendung in den Systemabschnitt ein. Das in den Systemabschnitt " +"eingebettete Fenster bietet ein Aufklappmenü mit einigen oft benutzten " +"Einträgen, so dass Sie nicht jedes Mal das Hauptfenster anzeigen lassen " +"müssen. Falls diese Einstellung ausgewählt ist, müssen Sie den Eintrag " +"\"Schließen\" aus dem Menü \"Datei\" oder aus dem Systemabschnittsfenster " +"benutzen, um die Anwendung zu verlassen." + +#: smb4k/core/smb4ksettings.cpp:125 +msgid "Start docked" +msgstr "Starte angedockt" + +#: smb4k/core/smb4ksettings.cpp:126 +msgid "" +"Start the application docked to the system tray, i.e. only the system tray " +"widget is shown and the main window is hidden. You can bring the main window " +"up by clicking on the system tray widget or by choosing \"Restore\" from its " +"popup menu." +msgstr "" +"Die Anwendung wird angedockt an den Systemabschnitt gestartet, das heißt, " +"nur das Fenster im Systemabschnitt wird angezeigt und das Hauptfenster " +"bleibt geschlossen. Sie können das Hauptfenster hervorbringen, indem Sie auf " +"das Fenster im Systemabschnitt klicken oder \"Wiederherstellen\" aus seinem " +"Aufklappmenü verwenden." + +#: smb4k/core/smb4ksettings.cpp:140 +msgid "How the shares should be displayed" +msgstr "Wie die Freigaben angezeigt werden sollen" + +#: smb4k/core/smb4ksettings.cpp:141 +msgid "" +"Choose the kind of view you prefer for displaying the mounted shares. There " +"is an icon view or a list view available." +msgstr "" +"Wählen Sie die Art der Ansicht, in der die eingehängten Freigaben angezeigt " +"werden sollen. Zur Verfügung stehen eine Symbol- und eine Listenansicht." + +#: smb4k/core/smb4ksettings.cpp:145 +msgid "Printer shares will be displayed in the network browser." +msgstr "Druckerfreigaben werden im Netzwerkbrowser angezeigt." + +#: smb4k/core/smb4ksettings.cpp:149 +msgid "" +"Hidden shares will be displayed in the network browser. Hidden shares are " +"ending with a $ sign, e.g. Musik$ or IPC$." +msgstr "" +"Versteckte Freigaben werden im Netzwerkbrowser angezeigt. Versteckte " +"Freigaben enden mit einem $-Zeichen (z.B. Musik$ oder IPC$)." + +#: smb4k/core/smb4ksettings.cpp:152 +msgid "Show hidden IPC$ shares" +msgstr "Zeige versteckte IPC$ Freigaben an" + +#: smb4k/core/smb4ksettings.cpp:153 +msgid "Hidden IPC$ shares will be displayed in the network browser." +msgstr "Versteckte IPC$ Freigaben werden im Netzwerkbrowser angezeigt." + +#: smb4k/core/smb4ksettings.cpp:156 +msgid "Show hidden ADMIN$ shares" +msgstr "Zeige versteckte ADMIN$ Freigaben an" + +#: smb4k/core/smb4ksettings.cpp:157 +msgid "Hidden ADMIN$ shares will be displayed in the network browser." +msgstr "Versteckte ADMIN$ Freigaben werden im Netzwerkbrowser angezeigt." + +#: smb4k/core/smb4ksettings.cpp:160 +msgid "Show the type of a share" +msgstr "Zeige den Typ der Freigaben an" + +#: smb4k/core/smb4ksettings.cpp:161 +msgid "" +"The type of a share will be displayed in a separate column in the network " +"browser. It can either be Disk, Print or IPC." +msgstr "" +"Der Typ einer Freigabe wird in einer separaten Spalte im Netzwerkbrowser " +"angezeigt. Er kann entweder \"Disk\", \"Print\" oder \"IPC\" sein." + +#: smb4k/core/smb4ksettings.cpp:164 +msgid "Show the IP address of a server" +msgstr "Zeige die IP-Adresse des Servers an" + +#: smb4k/core/smb4ksettings.cpp:165 +msgid "" +"The IP address of the server will be displayed in a separate column in the " +"network browser." +msgstr "" +"Die IP-Adresse des Servers wird in einer separaten Spalte im Netzwerkbrowser " +"angezeigt." + +#: smb4k/core/smb4ksettings.cpp:168 +msgid "Show the comment of a share" +msgstr "Zeige den Kommentar einer Freigabe an" + +#: smb4k/core/smb4ksettings.cpp:169 +msgid "" +"The comment describing the server or share will be displayed in a separate " +"column in the network browser." +msgstr "" +"Der Kommentar, der den Server oder die Freigabe beschreibt, wird in einer " +"separaten Spalte im Netzwerkbrowser angezeigt." + +#: smb4k/core/smb4ksettings.cpp:172 +msgid "Show a tooltip with information about the network item" +msgstr "Zeige einen Tooltip mit Informationen über den Netzwerkeintrag an" + +#: smb4k/core/smb4ksettings.cpp:173 +msgid "The tooltip shows various information about the current network item." +msgstr "" +"Der Tooltip zeigt verschiedene Informationen über den aktuellen " +"Netzwerkeintrag an." + +#: smb4k/core/smb4ksettings.cpp:176 +msgid "Show the mount point of a share instead of its name" +msgstr "Zeige den Einhängepunkt anstelle des Freigabenamens an" + +#: smb4k/core/smb4ksettings.cpp:177 +msgid "" +"A share is normally displayed with its name in the shares view. Choosing " +"this feature will cause the exchange of the share name by the mount point." +msgstr "" +"Eine Freigabe wird normalerweise mit ihrem Namen in der Freigabenanzeige " +"dargestellt. Die Wahl dieser Einstellung veranlasst den Austausch des Namens " +"der Freigabe durch den Einhängepunkt." + +#: smb4k/core/smb4ksettings.cpp:181 +msgid "" +"You will not only see the shares that were mounted and are owned by you, but " +"also all other mounts using the SMBFS and CIFS file system that are present " +"on the system." +msgstr "" +"Sie werden nicht nur die Freigaben sehen, die von Ihnen eingehängt wurden " +"und zu Ihnen gehören, sondern auch alle anderen, die das SMBFS oder CIFS " +"Dateisystem haben und auf Ihrem System eingehängt sind." + +#: smb4k/core/smb4ksettings.cpp:184 +msgid "Allow the dropping of files and directories onto share icons" +msgstr "Erlaube das Fallenlassen von Dateien und Verzeichnissen auf Freigaben" + +#: smb4k/core/smb4ksettings.cpp:185 +msgid "" +"This setting allows you to drop files or whole directories onto the share " +"icons, which will cause them to be copied." +msgstr "" +"Diese Einstellung ermöglicht das Fallenlassen von Dateien oder ganzen " +"Verzeichnissen auf Freigaben zum Zweck des Kopierens." + +#: smb4k/core/smb4ksettings.cpp:188 +msgid "Allow the dragging of share icons" +msgstr "Erlaube das Ziehen von Freigaben" + +#: smb4k/core/smb4ksettings.cpp:189 +msgid "" +"This setting allows you to drag a share item out of Smb4K and onto the " +"desktop or into a file manager. Only enable it if you think you absolutely " +"need it and read the handbook before you mark this checkbox." +msgstr "" +"Diese Einstellung erlaubt es Ihnen, einen Freigabeneintrag aus Smb4K heraus " +"auf den Desktop oder in einen Dateimanager zu ziehen. Schalten Sie diese " +"Fähigkeit nur dann an, wenn Sie der Meinung sind, dass Sie sie unbedingt " +"benötigen und lesen Sie vorher das Handbuch." + +#: smb4k/core/smb4ksettings.cpp:192 +msgid "Show a tooltip with information about the share" +msgstr "Zeige einen Tooltip mit Informationen über die Freigabe an" + +#: smb4k/core/smb4ksettings.cpp:193 +msgid "The tooltip shows various information about the current share." +msgstr "Der Tooltip zeigt verschiedene Informationen über die aktuelle Freigabe an." + +#: smb4k/core/smb4ksettings.cpp:196 +msgid "Show hidden files and directories when previewing a share" +msgstr "Zeige versteckte Dateien und Verzeichnisse bei der Vorschau einer Freigabe an" + +#: smb4k/core/smb4ksettings.cpp:197 +msgid "" +"Display hidden files and directories in the preview dialog. The names of " +"hidden files and directories are beginning with a period and are usually " +"needed for very specific purposes (configuration file of an application, " +"etc.). Since they are not of any importance for your regular work, you " +"normally do not need to enable this feature." +msgstr "" +"Zeige versteckte Dateien und Verzeichnisse im Vorschaudialog an. Die Namen " +"von versteckten Dateien oder Verzeichnissen beginnen mit einem Punkt und " +"werden meistens für spezielle Aufgaben benötigt (Konfigurationsdatei einer " +"Anwendung, etc.). Da sie von keiner Bedeutung für Ihre alltägliche Arbeit " +"sind, brauchen sie diese Einstellung normalerweise nicht einzuschalten." + +#: smb4k/core/smb4ksettings.cpp:201 +msgid "" +"Show the UID and GID that own all files on the mounted file system. At the " +"moment the column will only contain an entry if the share was mounted with " +"the SMBFS file system." +msgstr "" +"Zeige die Benutzer- und Gruppenkennung (UID und GID) an, die die Dateien auf " +"dem eingehängten Dateisystem besitzen. Zur Zeit enthält die Spalte nur einen " +"Eintrag, wenn die Freigabe mit dem SMBFS Dateisystem eingehängt wurde." + +#: smb4k/core/smb4ksettings.cpp:205 +msgid "" +"Show the login that was used to authenticate to the server. The column will " +"only contain an entry if the share was mounted with the CIFS file system." +msgstr "" +"Zeige den Anmeldenamen an, der für die Authentifizierung gegenüber dem " +"Server benutzt wurde. Diese Spalte besitzt nur einen Eintrag, wenn die " +"Freigabe mit dem CIFS Dateisystem eingehängt wurde." + +#: smb4k/core/smb4ksettings.cpp:209 +msgid "Show the file system that was used for mounting the share." +msgstr "Zeige das Dateisystem an, das für das Einhängen der Freigabe benutzt wurde." + +#: smb4k/core/smb4ksettings.cpp:213 +msgid "Show the free disk space that is left on the share." +msgstr "Zeige den auf der Freigabe freien Speicherplatz an." + +#: smb4k/core/smb4ksettings.cpp:217 +msgid "Show the disk space that is already used on the share." +msgstr "Zeige den auf der Freigabe bereits verwendeten Speicherplatz an." + +#: smb4k/core/smb4ksettings.cpp:221 +msgid "Show the total disk space of the share." +msgstr "Zeige den gesamten Speicherplatz der Freigabe an." + +#: smb4k/core/smb4ksettings.cpp:225 +msgid "Show the space that is used on the share in percent." +msgstr "Zeige den auf der Freigabe verwendeten Speicherplatz in Prozent an." + +#: smb4k/core/smb4ksettings.cpp:252 +msgid "Method how to retrieve the browse list" +msgstr "Methode, wie die Browseliste abgefragt wird" + +#: smb4k/core/smb4ksettings.cpp:253 +msgid "" +"Choose the method how to compile the initial browse list. There are four " +"options available: The first one is the default one and employs \"nmblookup -" +"M -- -\" to discover all workgroups, domains, and their master browsers on " +"your network neighborhood. The second one instructs Smb4K to query the " +"current master browser of your workgroup or domain to retrieve the browse " +"list. The third is similar to the second one except that you can define the " +"master browser that should be queried. If you choose the last option, the " +"provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x." +"x -- '*'\"." +msgstr "" +"Wählen Sie die Methode, wie die anfängliche Browseliste erstellt werden " +"soll. Vier Optionen stehen hierfür zur Verfügung: Die erste ist die " +"voreingestellte und benutzt \"nmblookup -M -- -\", um die Arbeitsgruppen, " +"Domänen und deren Masterbrowser in Ihrer Netzwerkumgebung ausfindig zu " +"machen. Die zweite veranlasst Smb4K dazu, die Browseliste vom derzeitigen " +"Masterbrowser Ihrer Arbeitsgruppe oder Domäne abzufragen. Die dritte ist " +"ähnlich der zweiten, nur dass hier ein benutzerdefinierter Masterbrowser " +"angegeben werden muss. Falls Sie die letzte Option wählen, werden die " +"angegebenen Broadcastbereiche mit Hilfe des Befehls \"nmblookup -B x.x.x.x " +"-- '*'\" durchsucht." + +#: smb4k/core/smb4ksettings.cpp:256 +msgid "A custom master browser that is to be queried" +msgstr "Ein benutzerdefinierter Masterbrowser, der abgefragt werden soll" + +#: smb4k/core/smb4ksettings.cpp:257 +msgid "" +"Enter the name or IP address of a master browser here that should be queried " +"to compile the initial browse list." +msgstr "" +"Tragen Sie den Namen oder die IP-Adresse des Masterbrowsers hier ein, der " +"abgefragt werden soll, um die anfängliche Browseliste zusammenzustellen." + +#: smb4k/core/smb4ksettings.cpp:260 +msgid "A custom list of broadcast addresses" +msgstr "Eine benutzerdefinierte Liste von Broadcastadressen" + +#: smb4k/core/smb4ksettings.cpp:261 +msgid "" +"Enter a comma-separated list of broadcast addresses here (e.g. " +"192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the " +"respective broadcast areas." +msgstr "" +"Tragen Sie eine durch Kommata getrennte Liste von Broadcastadressen (z. B. " +"192.168.0.255, 192.168.1.255) hier ein. Sie wird genutzt, um nach bekannten " +"Rechnern in den entsprechenden Broadcastbereichen zu suchen." + +#: smb4k/core/smb4ksettings.cpp:275 +msgid "Method for searching for remote hosts" +msgstr "Methode zum Suchen von entfernten Rechnern" + +#: smb4k/core/smb4ksettings.cpp:276 +msgid "" +"Smb4K is able to search for remote hosts either using nmblookup or " +"smbclient. The nmblookup method is very reliable and works well. However, if " +"your network is configured uncommonly and you experience problems when " +"searching, you should try the smbclient method. But please note that you " +"lose the ability to search for IP addresses in that case." +msgstr "" +"Smb4K kann nach entfernten Rechnern entweder mit nmblookup oder smbclient " +"suchen. Die nmblookup-Methode ist sehr zuverlässig und funktioniert gut. Ist " +"Ihr Netzwerk allerdings ungewöhnlich konfiguriert und es tauchen Probleme " +"bei der Suche auf, dann sollten Sie die smbclient-Methode ausprobieren. " +"Bitte beachten Sie aber, dass Sie dadurch die Möglichkeit verlieren, nach IP-" +"Adressen zu suchen." + +#: smb4k/core/smb4ksettings.cpp:282 +msgid "The mount prefix" +msgstr "Das Basisverzeichnis für das Einhängen" + +#: smb4k/core/smb4ksettings.cpp:283 +msgid "" +"This is the prefix where Smb4K will create the mount points and mount the " +"remote shares." +msgstr "" +"Dies ist das Basisverzeichnis, in dem Smb4K die Einhängepunkte anlegt und " +"die entfernten Freigaben einbindet." + +#: smb4k/core/smb4ksettings.cpp:286 +msgid "Force the subdirectories created by Smb4K to be lowercase" +msgstr "Erzwinge Kleinschreibung für die von Smb4K erstellten Unterverzeichnisse" + +#: smb4k/core/smb4ksettings.cpp:287 +msgid "" +"All names of the subdirectories created by Smb4K below the mount prefix will " +"be lowercase." +msgstr "" +"Alle Namen der durch Smb4K unterhalb des Basisverzeichnisses erzeugten " +"Ordner werden kleingeschrieben." + +#: smb4k/core/smb4ksettings.cpp:290 +msgid "Unmount the shares owned by the user on exit" +msgstr "Hänge die Freigaben des Benutzers beim Programmende aus" + +#: smb4k/core/smb4ksettings.cpp:291 +msgid "Unmount all shares that belong to you when the program exits." +msgstr "Hänge alle Freigaben beim Programmende aus, die Ihnen gehören." + +#: smb4k/core/smb4ksettings.cpp:294 +msgid "Remount shares" +msgstr "Hänge Freigaben erneut ein" + +#: smb4k/core/smb4ksettings.cpp:295 +msgid "" +"Remount all your shares that were still mounted when you exited the program. " +"Shares that were mounted by other users are ignored." +msgstr "" +"Hänge alle Freigaben erneut ein, die noch eingehängt waren, als das Programm " +"beendet wurde. Freigaben, die von anderen Benutzern eingehängt wurden, " +"werden nicht berücksichtigt." + +#: smb4k/core/smb4ksettings.cpp:298 +msgid "Allow the unmounting of shares owned by other users" +msgstr "Erlaube das Aushängen von Freigaben, die anderen Benutzern gehören" + +#: smb4k/core/smb4ksettings.cpp:299 +msgid "" +"Allow the unmounting of shares that were mounted by other users. In most " +"cases you need super user privileges for this. Please think before you " +"enable this option!" +msgstr "" +"Erlaube das Aushängen von Freigaben, die von anderen Benutzern eingehängt " +"wurden. In den meisten Fällen benötigen Sie hierfür Administratorrechte. " +"Bitte denken Sie nach, bevor Sie diese Einstellung aktivieren." + +#: smb4k/core/smb4ksettings.cpp:304 +msgid "Interval between checks for new and inaccessible shares" +msgstr "Das Intervall zwischen den Checks nach neuen und unzugänglichen Freigaben" + +#: smb4k/core/smb4ksettings.cpp:305 +msgid "" +"This is the time that elapses until Smb4K checks again for new mounts and " +"unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note " +"that the smaller the interval gets the higher is your system load." +msgstr "" +"Dies ist die Zeit, die vergeht, bis Smb4K erneut danach schaut, ob Freigaben " +"ein- oder ausgehängt wurden. Die untere Grenze sind 500 ms und die obere " +"300000 ms. Bitte beachten Sie, dass die Systemauslastung bei kleinen " +"Intervallen ansteigt." + +#: smb4k/core/smb4ksettings.cpp:311 +msgid "Use a wallet to store authentication data" +msgstr "Benutze eine digitale Brieftasche um Anmeldedaten zu speichern" + +#: smb4k/core/smb4ksettings.cpp:312 +msgid "" +"Use a wallet to store the authentication data. The login name and the " +"password name are stored encrypted on your hard drive. If this setting is " +"disabled, the authentication data is not stored permanently but only " +"temporarily." +msgstr "" +"Benutze eine digitale Brieftasche, um die Anmeldedaten zu speichern. Der " +"Anmeldename und das Passwort werden verschlüsselt auf Ihrer Festplatte " +"abgelegt. Falls diese Einstellung ausgeschaltet ist, werden die Anmeldedaten " +"nicht permanent sondern nur temporär gespeichert." + +#: smb4k/core/smb4ksettings.cpp:315 +msgid "Remember passwords if no wallet is used" +msgstr "Behalte die Passwörter, falls keine digitale Brieftasche benutzt wird" + +#: smb4k/core/smb4ksettings.cpp:316 +msgid "" +"If you decided to store the login names and passwords only temporarily, " +"Smb4K will remember them until the program exits. If you disable this " +"setting, you will have to provide the authentication data everytime it is " +"needed." +msgstr "" +"Wenn Sie sich dazu entschließen, die Anmeldenamen und Passwörter nur " +"temporär zu speichern, dann wird Smb4K sie bis zum Programmende vorrätig " +"halten. Falls Sie diese Einstellung ausschalten, müssen Sie jedes Mal die " +"Anmeldedaten eingeben, wenn sie benötigt werden." + +#: smb4k/core/smb4ksettings.cpp:319 +msgid "Use a default login" +msgstr "Benutze einen Standardanmeldenamen" + +#: smb4k/core/smb4ksettings.cpp:320 +msgid "" +"Enable the usage of a default login name and password. The authentication " +"data provided below is then used by default to authenticate to a remote " +"server. This is very useful e.g. if you are working in an Active Directory " +"environment or an NT domain." +msgstr "" +"Ermögliche die Verwendung eines Standardanmeldenamens und -passworts. Die " +"unten angegebenen Anmeldedaten werden standardmäßig zur Anmeldung bei einem " +"entfernten Server benutzt. Dies ist besonders nützlich, wenn Sie z. B. in " +"einer Active Directory-Umgebung oder einer NT-Domäne arbeiten." + +#: smb4k/core/smb4ksettings.cpp:326 +msgid "The NetBIOS name of this computer" +msgstr "Der NetBIOS-Name dieses Rechners" + +#: smb4k/core/smb4ksettings.cpp:327 +msgid "" +"This is the NetBIOS name of this computer that is used by Smb4K. By default, " +"it is either the NetBIOS name that is defined in the smb.conf file or the " +"host name." +msgstr "" +"Dies ist der von Smb4K benutzte NetBIOS-Name dieses Rechners. Standardmäßig " +"ist dies entweder der NetBIOS-Name, der in der Datei smb.conf definiert ist, " +"oder der Rechnername." + +#: smb4k/core/smb4ksettings.cpp:330 +msgid "The name of the workgroup/domain this computer is in" +msgstr "Der Name der Arbeitsgruppe/Domäne, der dieser Rechner angehört" + +#: smb4k/core/smb4ksettings.cpp:331 +msgid "" +"This is the workgroup or domain this computer is or should be in. By " +"default, it is the workgroup that is defined in the smb.conf file." +msgstr "" +"Dies ist die Arbeitsgruppe oder Domäne, der dieser Rechner angehört oder " +"angehören soll. Standardmäßig ist dies die Arbeitsgruppe, die in der Datei " +"smb.conf definiert ist." + +#: smb4k/core/smb4ksettings.cpp:334 +msgid "The socket options" +msgstr "Die Socket-Optionen" + +#: smb4k/core/smb4ksettings.cpp:335 +msgid "" +"These are the TCP socket options that are used by nmblookup, smbmount and " +"smbclient. Socket options are controls on the networking layer of the " +"operating systems which allow the connection to be tuned. See the manual " +"page of smb.conf for more information." +msgstr "" +"Dieses sind die TCP Socket-Optionen, die von nmblookup, smbmount und " +"smbclient verwendet werden. Die Socket-Optionen dienen der Steuerung der " +"Netzwerkschicht des Betriebssystems und können benutzt werden, um die " +"Verbindung abzugleichen. Lesen Sie die Manualpage über smb.conf, um mehr zu " +"erfahren." + +#: smb4k/core/smb4ksettings.cpp:338 +msgid "The NetBIOS scope" +msgstr "Der NetBIOS-Name" + +#: smb4k/core/smb4ksettings.cpp:339 +msgid "" +"This sets the NetBIOS scope that nmblookup, smbmount and smbclient will " +"operate under. It should not be set unless every machine on your network " +"neighborhood sets this value." +msgstr "" +"Dies setzt den NetBIOS Scope, unter dem nmblookup, smbmount und smbclient " +"operieren werden. Er sollte nicht benutzt werden, es sei denn, alle " +"Maschinen in der Netzwerkumgebung benutzen diesen Wert." + +#: smb4k/core/smb4ksettings.cpp:344 +msgid "The remote SMB port" +msgstr "Der ferner SMB-Port" + +#: smb4k/core/smb4ksettings.cpp:345 +msgid "" +"This is the port that is to be used for connecting to remote servers. Please " +"note that this is independent of the settings in the smb.conf file." +msgstr "" +"Dies ist der Port, der für die Verbindung mit entfernten Servern benutzt " +"wird. Bitte beachten Sie, dass er unabhängig von den Einstellungen in der " +"Datei smb.conf ist." + +#: smb4k/core/smb4ksettings.cpp:348 +msgid "Use Kerberos for authentication" +msgstr "Benutze Kerberos für die Anmeldung" + +#: smb4k/core/smb4ksettings.cpp:349 +msgid "" +"Try to authenticate with Kerberos. This is only useful in an Active " +"Directory environment. The setting affects the smbmount and smbclient " +"command." +msgstr "" +"Versuche eine Anmeldung mit Kerberos. Dies ist nur in einer Active Directory " +"Umgebung sinnvoll. Beeinflusst werden die Befehle smbmount und smbclient." + +#: smb4k/core/smb4ksettings.cpp:352 +msgid "Use machine account for login" +msgstr "Benutze Maschinenaccount für die Anmeldung" + +#: smb4k/core/smb4ksettings.cpp:353 +msgid "" +"Make queries to the remote server using the machine account of the local " +"server. The setting affects the net and the smbclient command." +msgstr "" +"Der lokale Maschinenaccount wird für die Anfragen an den entfernten Server " +"benutzt. Diese Einstellung beeinflusst die Programme net und smbclient." + +#: smb4k/core/smb4ksettings.cpp:367 +msgid "The file system that is used for mounting remote shares" +msgstr "Das Dateisystem, das zum Einhängen der entfernten Freigaben genutzt wird" + +#: smb4k/core/smb4ksettings.cpp:368 +msgid "" +"This is the file system that will be used to mount the remote shares. The " +"Common Internet File System (CIFS) is supported by Windows 2000 and above as " +"well as by Samba. It offers many improvements and advancements compared to " +"the Server Message Block File System (SMBFS) which is used by Windows 9x and " +"below." +msgstr "" +"Dies ist das Dateisystem, das für das Einhängen der entfernten Freigaben " +"benutzt wird. Das Common Internet File System (CIFS) wird von Windows 2000 " +"und höher sowie von Samba unterstützt. Es bietet viele Verbesserungen und " +"Erweiterungen gegenüber dem Server Message Block File System (SMBFS), das " +"von Windows 9x und früher verwendet wird." + +#: smb4k/core/smb4ksettings.cpp:487 +msgid "The charset used by the client" +msgstr "Der vom Klienten benutzte Zeichensatz" + +#: smb4k/core/smb4ksettings.cpp:488 +msgid "" +"This is the charset that is used by the client side (i.e. your side) either " +"to convert local path names to and from Unicode in case of the CIFS file " +"system or for codepage to charset translations (NLS) in case of the SMBFS " +"file system. If you keep the default setting, Smb4K will try to " +"automatically determine the charset by looking up the \"unix charset\" " +"option in the smb.conf." +msgstr "" +"Dies ist der Zeichensatz, der von der Klientenseite (also Ihrer Seite) " +"benutzt wird, um entweder die lokalen Pfadnamen in oder aus Unicode " +"umzuwandeln (CIFS Dateisystem) oder die Codepage des Servers in den lokalen " +"Zeichensatz zu übersetzen (NLS, SMBFS Dateisystem). Behalten Sie die " +"Voreinstellung bei, dann versucht Smb4K, den Zeichensatz automatisch durch " +"Auswertung der \"unix charset\" Option in der smb.conf festzustellen." + +#: smb4k/core/smb4ksettings.cpp:657 +msgid "The codepage used by the server" +msgstr "Die vom Server benutzte Codepage" + +#: smb4k/core/smb4ksettings.cpp:658 +msgid "" +"This is the codepage that is used by the server. The setting is only " +"available with the SMBFS file system. If you keep the default setting, Smb4K " +"will try to automatically determine the codepage by looking up the \"dos " +"charset\" option in the smb.conf." +msgstr "" +"Dies ist die Codepage, die vom Server benutzt wird. Die Einstellung ist nur " +"bei Verwendung des SMBFS Dateisystems verfügbar. Wenn Sie die " +"Standardeinstellung beibehalten, dann versucht Smb4K die Codepage " +"automatisch durch die Auswertung der \"dos charset\" Option in der smb.conf " +"festzustellen." + +#: smb4k/core/smb4ksettings.cpp:661 +msgid "The user ID that is to be used for mounting" +msgstr "Die für das Einhängen benutzte Benutzerkennung (UID)" + +#: smb4k/core/smb4ksettings.cpp:662 +msgid "" +"Here you can enter the user ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" +"Hier können Sie die Benutzerkennung (UID, eine Zahl) eingeben, die auf die " +"Dateien und Verzeichnisse der eingehängten Freigabe angewendet wird. Falls " +"Sie das CIFS Dateisystem benutzen und der entfernte Server die CIFS Unix " +"Extentions unterstützt, dann wird diese Einstellung ignoriert." + +#: smb4k/core/smb4ksettings.cpp:665 +msgid "The group ID that is to be used for mounting" +msgstr "Die für das Einhängen benutzte Gruppenkennung (GID)" + +#: smb4k/core/smb4ksettings.cpp:666 +msgid "" +"Here you can enter the group ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" +"Hier können Sie die Gruppenkennung (GID, eine Zahl) eingeben, die auf die " +"Dateien und Verzeichnisse der eingehängten Freigabe angewendet wird. Falls " +"Sie das CIFS Dateisystem benutzen und der entfernte Server die CIFS Unix " +"Extentions unterstützt, dann wird diese Einstellung ignoriert." + +#: smb4k/core/smb4ksettings.cpp:669 +msgid "The file mask for a share" +msgstr "Die Dateimaske für die Freigabe" + +#: smb4k/core/smb4ksettings.cpp:670 +msgid "" +"This is the mask that will be used for creating files. It must be defined in " +"octal. In case the CIFS file system is used, this setting only takes effect " +"if the server does not support the CIFS Unix Extensions." +msgstr "" +"Dies ist die Maske, die bei der Erzeugung von Dateien verwendet wird. Sie " +"muss als oktale Zahl angegeben werden. Im Fall, dass das CIFS Dateisystem " +"benutzt wird, hat diese Einstellung nur Auswirkungen, wenn der Server die " +"CIFS Unix Extentions nicht unterstützt." + +#: smb4k/core/smb4ksettings.cpp:673 +msgid "The directory mask for a share" +msgstr "Die Verzeichnismaske für die Freigabe" + +#: smb4k/core/smb4ksettings.cpp:674 +msgid "" +"This is the mask that will be used for creating directories. It must be " +"defined in octal. In case the CIFS file system is used, this setting only " +"takes effect if the server does not support the CIFS Unix Extensions." +msgstr "" +"Dies ist die Maske, die bei der Erzeugung von Verzeichnissen verwendet wird. " +"Sie muss als oktale Zahl angegeben werden. Im Fall, dass das CIFS " +"Dateisystem benutzt wird, hat diese Einstellung nur Auswirkungen, wenn der " +"Server die CIFS Unix Extentions nicht unterstützt." + +#: smb4k/core/smb4ksettings.cpp:688 +msgid "The write access granted for the share" +msgstr "Der für die Freigabe gestattete Schreibzugriff" + +#: smb4k/core/smb4ksettings.cpp:689 +msgid "" +"Here you can choose if the shares should be mounted in read and write mode " +"or only read-only." +msgstr "" +"Hier können Sie auswählen, ob die Freigabe mit Lese- und Schreibzugriff oder " +"nur Lesezugriff eingehängt werden soll." + +#: smb4k/core/smb4ksettings.cpp:693 +msgid "" +"The client side (i.e. your side) will check if you have the right UID/GID to " +"manipulate a file or directory. You might want to switch this feature off if " +"the server(s) support the CIFS Unix Extensions and you are not allowed to " +"access the files and directories. This setting does not affect the normal " +"ACL check." +msgstr "" +"Die Klientenseite (d.h. Ihre Seite) überprüft, ob Sie die richtige Benutzer- " +"und Gruppenkennung (UID/GID) besitzen, um Dateien und Verzeichnisse zu " +"manipulieren. Eventuell sollten Sie diese Eigenschaft ausstellen, wenn die " +"Server die CIFS Unix Extentions unterstützen und Sie keinen Zugriff auf die " +"Dateien und Verzeichnisse haben. Diese Einstellung berührt die normalen ACL " +"Überprüfungen nicht." + +#: smb4k/core/smb4ksettings.cpp:696 +msgid "Set UID and GID" +msgstr "Setze die Benutzer- und Gruppenkennung (UID und GID)" + +#: smb4k/core/smb4ksettings.cpp:697 +msgid "" +"In case the server supports the CIFS Unix Extensions, the client side (i.e. " +"your side) attempts to set the effective UID and GID of the current process " +"on newly created files, directories and devices. If this feature is turned " +"off, the default UID and GID defined for the share will be used. It is " +"recommended that you read the manual page of mount.cifs before you change " +"this setting." +msgstr "" +"Im Fall, dass der Server die CIFS Unix Extentions unterstützt, versucht die " +"Klientenseite (d.h. Ihre Seite) die effektive Benutzer- und Gruppenkennung " +"(UID und GID) des laufenden Prozesses auf die neu erstellten Dateien, " +"Verzeichnisse und Devices anzuwenden. Wenn diese Einstellung ausgeschaltet " +"ist, dann wird die standardmäßig für die Freigabe definierte UID und GID " +"verwendet. Es wird empfohlen, dass Sie die Manualpage für mount.cifs lesen, " +"bevor Sie diese Einstellung ändern." + +#: smb4k/core/smb4ksettings.cpp:701 +msgid "" +"Use inode numbers (unique persistent file identifiers) returned by the " +"server instead of automatically generating temporary inode numbers on the " +"client side." +msgstr "" +"Nutze die Inode-Nummern (eindeutige, beständige Dateikennungen), die vom " +"Server gemeldet werden, anstatt automatisch temporäre Inode-Nummern auf der " +"Klientenseite zu generieren." + +#: smb4k/core/smb4ksettings.cpp:705 +msgid "" +"Directly read from and write to files opened on the share. In some cases " +"this can provide better performance than the default behavior which caches " +"reads and writes." +msgstr "" +"Greife direkt auf die auf der Freigabe geöffneten Dateien zu. In einigen " +"Fällen kann dies zu einem besseren Durchsatz führen als das standardmäßige " +"Verhalten, bei dem die Lese- und Schreibzugriffe zwischengespeichert werden." + +#: smb4k/core/smb4ksettings.cpp:709 +msgid "" +"Translate six of the seven reserved characters (including the colon, " +"question mark, pipe, asterisk, greater than and less than characters but not " +"the backslash) to remap range (above 0xF000). This allows you to open files " +"that were created with such characters. This has no effect if the server " +"does not support Unicode." +msgstr "" +"Übersetze sechs der sieben reservierten Buchstaben (den Punkt, das " +"Fragezeichen, die Pipe, das Sternchen, das Größer- und das Kleinerzeichen, " +"aber nicht den Backslash) in den Remap-Bereich (oberhalb von 0xF000). " +"Dadurch können Sie Dateien öffnen, die mit diesen Buchstaben erstellt " +"wurden. Diese Einstellung hat keinen Auswirkungen, wenn der Server kein " +"Unicode unterstützt." + +#: smb4k/core/smb4ksettings.cpp:713 +msgid "Do not use locking. Do not start lockd." +msgstr "Benutze keine Sperrung (locking). Starte den lockd nicht." + +#: smb4k/core/smb4ksettings.cpp:716 +msgid "Advanced custom options for the CIFS file system" +msgstr "Erweiterte benutzerdefinierte Optionen für das CIFS Dateisystem" + +#: smb4k/core/smb4ksettings.cpp:717 +msgid "" +"Here you can enter advanced options for the CIFS file system in a comma-" +"separated list (refer to the manual page of mount.cifs to learn more). The " +"list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not " +"enter options that have already been defined in the configuration dialog." +msgstr "" +"Hier können Sie erweiterte Optionen für das CIFS Dateisystem in einer durch " +"Kommata getrennten Liste angeben (lesen Sie die Manualpage von mount.cifs, " +"um mehr zu lernen). Die Liste wird OHNE ÄNDERUNGEN an das \"-o\" Argument " +"von mount.cifs angehängt. Bitte geben Sie keine Optionen an, die bereits im " +"Konfigurationsdialog angegeben worden sind." + +#: smb4k/core/smb4ksettings.cpp:720 +msgid "Determines how long directory listings are cached" +msgstr "Bestimmt wie lange Verzeichnislisten zwischengespeichert werden" + +#: smb4k/core/smb4ksettings.cpp:721 +msgid "" +"This setting determines how long a directory listing is cached in " +"milliseconds. A high value means it takes longer until changes on the server " +"are noticed on the client side (i.e. your side), but it can also give you an " +"increase in performance on large directories, especially on long distances. " +"You need Linux kernel 2.4.2 or later to take advantage of this setting." +msgstr "" +"Diese Einstellung bestimmt, wieviele Millisekunden ein Verzeichnisbaum " +"zwischengespeichert wird. Ein hoher Wert bedeutet, dass es länger dauert, " +"bis Änderungen auf dem Server auf der Klientenseite (d.h. Ihrer Seite) " +"wahrgenommen werden, aber er gibt Ihnen auch eine Verbesserung bei der " +"Arbeit mit großen Verzeichnissen, insbesondere über weite Entfernungen. Sie " +"benötigen den Linux-Kernel 2.4.2 oder höher, um diese Einstellung nutzen zu " +"können." + +#: smb4k/core/smb4ksettings.cpp:724 +msgid "Unicode support" +msgstr "Unterstützung für Unicode" + +#: smb4k/core/smb4ksettings.cpp:725 +msgid "" +"Use Unicode when communicating with the server. This will give you better " +"support for non-ASCII character sets with the SMBFS file system." +msgstr "" +"Benutze Unicode für die Kommunikation mit dem Server. Hierdurch erhalten Sie " +"eine bessere Unterstützung von nicht-ASCII Zeichensätzen mit dem SMBFS " +"Dateisystem." + +#: smb4k/core/smb4ksettings.cpp:728 +msgid "Long file support" +msgstr "Unterstützung für große Dateisysteme" + +#: smb4k/core/smb4ksettings.cpp:729 +msgid "" +"Large file support (LFS) enables you to read and write \n" +"files bigger than 2 GB on shares that were mounted with the SMBFS file " +"system." +msgstr "" +"Die Unterstützung für große Dateien (LFS) versetzt Sie in die Lage, " +"auch Dateien, die größer als 2 GB sind, auf Freigaben zu lesen und " +"schreiben, die mit dem SMBFS Dateisystem eingehängt wurden." + +#: smb4k/core/smb4ksettings.cpp:754 +msgid "The protocol that is used with the net command" +msgstr "Das mit dem net Befehl zu benutzende Protokoll" + +#: smb4k/core/smb4ksettings.cpp:755 +msgid "" +"Here you can choose the protocol that will be used by the net command for " +"the communication with remote servers if appropriate. In most cases the " +"automatic detection will work fine and you should not need to change the " +"default setting. However, if you experience problems, use the RPC protocol " +"for newer operating systems (Windows NT4 and above) and the RAP protocol for " +"older ones (Windows 98/NT3 and below). Functions that need the ADS protocol " +"(for Active Directory environments) have not been implemented yet, so you " +"can ignore that one for now." +msgstr "" +"Hier können Sie das Protokoll wählen, das durch das net Kommando für die " +"Kommunikation mit entfernten Rechnern benutzt wird, falls dies angebracht " +"ist. In den meisten Fällen arbeitet die automatische Erkennung einwandfrei " +"und Sie brauchen die Standardeinstellung nicht zu ändern. Sollten Sie " +"allerdings Probleme feststellen, benutzen Sie das RPC-Protokoll für neuere " +"Betriebssysteme (Windows NT4 und später) und das RAP-Protokoll für ältere " +"(Windows 98/NT3 und davor). Funktionen, die das ADS-Protokoll benötigen " +"(Active Directory-Umgebungen), sind bisher nicht implementiert worden. Sie " +"können es deshalb im Moment und bis auf Weiteres ignorieren." + +#: smb4k/core/smb4ksettings.cpp:758 +msgid "Name resolve order used by smbclient" +msgstr "Die von smbclient benutzte Reihenfolge der Namensauflösung " + +#: smb4k/core/smb4ksettings.cpp:759 +msgid "" +"This option is used to determine what naming services and in what order are " +"used to resolve host names and IP addresses. It takes a space-separated list " +"of up to four different name resolution options. Those are: lmhost, host, " +"wins, bcast. See the manual page of smbclient for further information." +msgstr "" +"Diese Option wird bestimmt, um zu bestimmen, welche Services für die " +"Auflösung der Rechnernamen und IP-Adressen genutzt werden sollen und in " +"welcher Reihenfolge dies geschehen soll. Sie besteht aus einer bis zu vier " +"Services umfassenden, durch Kommata getrennten Liste. Folgende Services " +"stehen zur Verfügung: lmhost, host, wins, bcast. Lesen Sie die Manualpage " +"für smbclient für weitere Informationen." + +#: smb4k/core/smb4ksettings.cpp:763 +msgid "Transmit/send buffer size used by smbclient" +msgstr "Von smbclient benutzte Übermittlungs-/Sendepuffergröße " + +#: smb4k/core/smb4ksettings.cpp:764 +msgid "" +"This option changes the transmit/send buffer size when getting or putting a " +"file from/to the server. The default is 65520 bytes. Setting this value " +"smaller has been observed to speed up file transfers to and from Windows 9x " +"servers." +msgstr "" +"Diese Option ändert die Übermittlungs-/Sendepuffergröße, die für die " +"Dateiübertragung vom oder zum Server benutzt wird. Der Standardwert ist " +"65520 Bytes. Die Verkleinerung dieses Werts hat sich als hilfreich " +"herausgestellt, um die Übertragung zu und von Windows 9x zu beschleunigen." + +#: smb4k/core/smb4ksettings.cpp:788 +msgid "Signing state" +msgstr "Signierstatus" + +#: smb4k/core/smb4ksettings.cpp:789 +msgid "Set the signing state for smbclient." +msgstr "Setze den Signierstatus für smbclient." + +#: smb4k/core/smb4ksettings.cpp:792 +msgid "The broadcast address used by nmblookup" +msgstr "Die von nmblookup benutzte Broadcastadresse" + +#: smb4k/core/smb4ksettings.cpp:793 +msgid "" +"Queries performed with nmblookup will be send to the given broadcast " +"address. Without this option the default behavior is to send the queries to " +"the broadcast address of the network interface that was either auto-detected " +"or defined in the \"interfaces\" parameter of the smb.conf file." +msgstr "" +"Mit nmblookup durchgeführte Abfragen werden an die gegebene Broadcastadresse " +"gesendet. Ohne diese Option werden die Abfragen standardmäßig entweder an " +"die automatisch erkannte oder an die durch den \"interfaces\"-Parameter in " +"der smb.conf Datei definierte Broadcastadresse gesendet." + +#: smb4k/core/smb4ksettings.cpp:796 +msgid "Use UDP port 137 with nmblookup" +msgstr "Benutze den UPD Port 137 mit nmblookup" + +#: smb4k/core/smb4ksettings.cpp:797 +msgid "" +"Try and bind to UDP port 137 to send and receive UDP datagrams. The reason " +"for this option is a bug in Windows 95 where it ignores the source port of " +"the requesting packet and only replies to UDP port 137. Unfortunately, on " +"most Unix systems super user privileges are needed to bind to this port. " +"Please read the manual page of nmblookup for more information." +msgstr "" +"Nutze UDP-Port 137 zum Senden und Empfangen von UDP-Datagrammen, falls dies " +"möglich ist. Der Grund für diese Option ist ein Fehler in Windows 95, durch " +"den der Quellport eines anfragenden Pakets ignoriert wird und Antworten nur " +"auf UDP-Port 137 gegeben werden. Leider sind auf den meisten Unix-Systemen " +"Administratorrecht nötig, um diesen Port zu benutzen. Bitten lesen die " +"Manualpage für nmblookup für mehr Informationen." + +#: smb4k/core/smb4ksettings.cpp:803 +msgid "Prefix for synchronization" +msgstr "Basisverzeichnis für die Synchronisation" + +#: smb4k/core/smb4ksettings.cpp:804 +msgid "" +"This is the path where Smb4K will store the files and directories during " +"synchronization. If you plan to synchronize only with one remote share, then " +"you can put the data directly in this directory. If you want to synchronize " +"with several remote shares, then you should create a subdirectory for each " +"share and choose the appropriate one in the synchronization dialog." +msgstr "" +"Das ist der Pfad, den Smb4K benutzt, um darunter Dateien und Verzeichnisse " +"während einer Synchronisation abzulegen. Wenn Sie planen, nur eine einzige " +"Freigabe zu synchronisieren, dann können Sie die Daten direkt in dieses " +"Verzeichnis ablegen lassen. Sollten Sie mehrere Freigaben synchronisieren " +"lassen wollen, dann sollten Sie jeweils ein Unterverzeichnis für jede " +"Freigabe einrichten und das entsprechende Verzeichnis dann im " +"Synchronisationsdialog auswählen." + +#: smb4k/core/smb4ksettings.cpp:807 +msgid "Use archive mode" +msgstr "Benutze den Archivierungsmodus" + +#: smb4k/core/smb4ksettings.cpp:808 +msgid "Use archive mode (-a, --archive). This is a short form of -rlptgoD." +msgstr "" +"Benutze den Archivierungsmodus (-a, --archive). Dies ist eine Kurzform für -" +"rlptgoD." + +#: smb4k/core/smb4ksettings.cpp:811 +msgid "Recurse into subdirectories" +msgstr "Steige in Verzeichnisse hinab" + +#: smb4k/core/smb4ksettings.cpp:812 +msgid "Recurse into directories (-r, --recursive)." +msgstr "Steige in Verzeichnisse hinab (-r, --recursive)." + +#: smb4k/core/smb4ksettings.cpp:815 +msgid "Skip files that are newer in the target directory" +msgstr "Übergehe neuere Dateien im Zielverzeichnis" + +#: smb4k/core/smb4ksettings.cpp:816 +msgid "" +"Update files in the destination directory that are older than in the source " +"directory (-u, --update)." +msgstr "" +"Aktualisiere Dateien im Zielverzeichnis, die älter sind als im " +"Quellverzeichnis (-u, --update)." + +#: smb4k/core/smb4ksettings.cpp:820 +msgid "" +"Update destination files in-place (--inplace). By default, rsync first " +"creates a new copy of a file and moves it into place after its transfer " +"finished. If you enable this feature, no copy will be created but the " +"destination file will immediately be overwritten instead. An exception to " +"this is if you combine this option with --backup." +msgstr "" +"Aktualisiere Zieldateien am Platz (--inplace). Standardmäßig erzeugt rsync " +"zunächst eine neue Kopie einer Datei und verschiebt sie erst nach der " +"vollständigen Übertragung an ihren Platz. Wenn Sie diese Eigenschaft " +"einschalten, dann wird keine Kopie erstellt, sondern die Zieldatei wird " +"stattdessen sofort überschrieben. Eine Ausnahme hierzu bildet die " +"Kombination mit --backup." + +#: smb4k/core/smb4ksettings.cpp:824 +msgid "" +"Use relative paths (-R, --relative). This means that the full path names " +"specified on the command line are sent to the server rather than just the " +"last parts of the file names." +msgstr "" +"Benutze relative Pfadnamen (-R, --relative). Das bedeutet, dass die in der " +"Kommandozeile angegeben Pfadnamen in voller Länge an den Server übermittelt " +"werden. Andernfalls wird jeweils nur der hintere Teil weitergegeben." + +#: smb4k/core/smb4ksettings.cpp:827 +msgid "Don't send implied directories with --relative" +msgstr "Sende keine inbegriffenen Verzeichnisse" + +#: smb4k/core/smb4ksettings.cpp:828 +msgid "" +"Don't send implied directories with --relative (--no-implied-dirs). This " +"means that the corresponding path elements on the destination system are " +"left unchanged if they exist, and any missing implied directories are " +"created with default attributes. This even allows these implied path " +"elements to have big differences, such as being a symlink to a directory on " +"one side of the transfer, and a real directory on the other side." +msgstr "" +"Sende keine inbegriffenen Verzeichnisse mit bei der Verwendung von --" +"relative (--no-implied-dirs). Das bedeutet, dass die entsprechenden " +"Pfadelemente auf dem Zielsystem nicht geändert werden, wenn sie existieren, " +"und alle fehlenden inbegriffenen Verzeichnisse mit Standardattributen " +"erzeugt werden. Das lässt sogar große Unterschiede der inbegriffenen " +"Pfadelemente zu, zum Beispiel, dass ein Verzeichnis auf der einen Seite ein " +"Symlink und auf der anderen Seite ein regulärer Eintrag ist." + +#: smb4k/core/smb4ksettings.cpp:832 +msgid "" +"Transfer directories without recursing (-d, --dirs). This means that all top-" +"level subdirectories are transferred but without their contents." +msgstr "" +"Übertrage Verzeichnisse, ohne in sie hinabzusteigen (-d, --dirs). Das " +"bedeutet, dass alle Verzeichnisse auf höchster Ebene zwar übertragen werden, " +"aber ohne ihren Inhalt." + +#: smb4k/core/smb4ksettings.cpp:836 +msgid "" +"Compress data during transfer (-z, --compress). This significantly reduces " +"the amount of data that is being transferred. You may want to use this " +"option, if you have a slow connection." +msgstr "" +"Komprimiere die Daten während des Transfers (-z, --compress). Dies " +"verringert deutlich die Menge an Daten, die übertragen werden müssen. Sie " +"wollen diese Option eventuell benutzen, wenn Sie eine langsame Verbindung " +"haben." + +#: smb4k/core/smb4ksettings.cpp:840 +msgid "Copy symlinks as symlinks (-l, --links)." +msgstr "Kopiere Symlinks als Symlinks (-l, --links)." + +#: smb4k/core/smb4ksettings.cpp:844 +msgid "Transform symlinks into the items they are pointing to (-L, --copy-links)." +msgstr "" +"Transformiere Symlinks in die Elemente, auf die sie zeigen (-L, --copy-" +"links)." + +#: smb4k/core/smb4ksettings.cpp:848 +msgid "" +"Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-" +"links). This means that only those symlinks are transformed that point to " +"items that are outside the copied tree. Absolute symlinks are treated the " +"same way. This option has no additional effect if --copy-links has also been " +"specified." +msgstr "" +"Wandle unsichere Symlinks in die Einträge um, aus die sie zeigen (--copy-" +"unsafe-links). Das bedeutet, dass nur die Symlinks umgewandelt werden, die " +"aus dem zu kopierenden Verzeichnisbaum hinauszeigen. Absolute Symlinks " +"werden genauso behandelt. Diese Option hat keinen zusätzlichen Effekt, wenn " +"ebenfalls --copy-links angegeben wurde." + +#: smb4k/core/smb4ksettings.cpp:852 +msgid "" +"Ignore symlinks that point outside the copied tree (--safe-links). All " +"absolute symlinks are also ignored. If you use this option in conjunction " +"with --relative you might get unexpected results." +msgstr "" +"Ignoriere Symlinks, die aus dem zu übertragenden Verzeichnisbaum " +"herauszeigen (--safe-links). Alle absoluten Symlinks werden zusätzlich " +"ignoriert. Falls Sie diese Option in Verbindung mit --relative nutzen, " +"können Sie eventuell unerwartete Ergebnisse erhalten." + +#: smb4k/core/smb4ksettings.cpp:856 +msgid "" +"Preserve hard links (-H, --hard-links). This options causes rsync to " +"preserve the hard links that are found during the transfer. Without it, hard " +"links are treated as though they were separate files." +msgstr "" +"Erhalte harte Links (-H, --hard-links). Diese Option veranlasst rsync dazu, " +"harte Links zu erhalten, die während des Transfers gefunden werden. Ohne sie " +"werden harte Links so behandelt, als ob sie separate Dateien wären." + +#: smb4k/core/smb4ksettings.cpp:860 +msgid "" +"Treat symlinked directories on the receiving side as though they were real " +"ones (-K, --keep-dirlinks). This only works if the symlink matches a real " +"directory from the sending side. Without this option, the receiver's symlink " +"will be deleted and replaced with a real directory." +msgstr "" +"Behandle symbolisch verknüpfte Verzeichnisse auf der empfangenden Seite, als " +"ob sie reale Verzeichnisse wären (-K, --keep-dirlinks). Das funktioniert " +"nur, wenn der Symlink einem realen Verzeichnis auf der sendenden Seite " +"entspricht. Ohne diese Option wird der Symlink auf der empfangenden Seite " +"gelöscht und mit einem realen Verzeichnis ersetzt." + +#: smb4k/core/smb4ksettings.cpp:864 +msgid "" +"Preserve permissions (-p, --perms). The permissions of the destination file " +"will be same as the source file. For what happens if this option is switched " +"off, please read rsync's manual page." +msgstr "" +"Erhalte Zugriffsrechte (-p, --perms). Die Zieldatei wird mit denselben " +"Zugriffsrechten erzeugt, wie sie die Quelldatei besitzt. Was passiert, wenn " +"Sie diese Option ausschalten, lesen Sie bitte die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:868 +msgid "" +"Preserve the group (-g, --group). The group of the destination file will be " +"set to the same value as the source file." +msgstr "" +"Erhalte die Gruppe (-g, --group). Die Gruppe der Zieldatei wird auf " +"denselben Wert gesetzt, wie ihn die Quelldatei besitzt." + +#: smb4k/core/smb4ksettings.cpp:871 +msgid "Preserve owner (super user only)" +msgstr "Erhalte Eigentümer (nur root)" + +#: smb4k/core/smb4ksettings.cpp:872 +msgid "" +"Preserve the owner (-o, --owner). The owner of the destination file will be " +"set to the same value as the source file, but only if the receiving rsync is " +"run as the super user. Without this option, the owner is set to the invoking " +"user on the receiving side." +msgstr "" +"Erhalte den Eigentümer (-o, --owner). Der Besitzer der Zieldatei wird auf " +"denselben Wert gesetzt, wie ihn die Quelldatei besitzt, jedoch nur dann, " +"wenn rsync auf der Empfängerseite als Administrator ausgeführt wird. Ohne " +"diese Option wird der Benutzer auf der empfangenden Seite der Besitzer." + +#: smb4k/core/smb4ksettings.cpp:876 +msgid "" +"Preserve device and special files (-D, --devices --specials). This option " +"causes rsync to transfer character and block devices as well as special " +"files such as named sockets and fifos. It works only partially if rsync is " +"not run as super user and the --super option is not specified." +msgstr "" +"Erhalte Blockgeräte und spezielle Dateien (-D, --devices --specials). Diese " +"Option verursacht, dass rsync Blockgeräte und spezielle Dateien, wie zum " +"Beispiel fifos oder named sockets, ebenfalls überträgt. Das funktioniert nur " +"teilweise, wenn rsync nicht als Systemadministrator ausgeführt wird und --" +"super nicht angegeben wurde." + +#: smb4k/core/smb4ksettings.cpp:880 +msgid "" +"Preserve times (-t, --times). The modification times are transferred along " +"with the files. For what happens if this option is switched off, please read " +"rsync's manual page." +msgstr "" +"Erhalte die Zeiten (-t, --times). Die Änderungszeiten werden zusammen mit " +"den Dateien übertragen. Was passiert, wenn diese Option ausgeschaltet wird, " +"lesen Sie bitte die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:884 +msgid "" +"Omit directories when preserving times (-O, --omit-dir-times). This means " +"that directories are omitted when modification times are being preserved. " +"Thus, this feature only works in conjunction with --times." +msgstr "" +"Übergehe Verzeichnisse beim Erhalten der Zeiten (-O, --omit-dir-times). Das " +"bedeute, dass Verzeichnisse übergangen werden, wenn die Änderungszeiten " +"erhalten werden sollen. Daher funktioniert diese Option nur zusammen mit --" +"times." + +#: smb4k/core/smb4ksettings.cpp:888 +msgid "" +"Remove all synchronized source files (--remove-source-files). This tells " +"rsync to remove from the sending side the non-directory items that are a " +"part of the transfer and have been successfully duplicated on the receiving " +"side." +msgstr "" +"Lösche alle synchronisierten Quelldateien (--remove-source-files). Dies " +"veranlasst rsync dazu, alle Einträge, die Teil des Transfers und keine " +"Verzeichnisse sind, von der sendenden Seite zu entfernen, sobald sie auf der " +"empfangenden Seite erfolgreich dupliziert wurden." + +#: smb4k/core/smb4ksettings.cpp:892 +msgid "" +"Delete extraneous files from destination (--delete). This tells rsync to " +"delete all files from the receiving side that are not present on the sending " +"side, but only for the directories that are being synchronized." +msgstr "" +"Lösche fremde Dateien auf der Zielseite (--delete). Hierdurch wird rsync " +"dazu gebracht, alle Dateien auf der empfangenden Seite zu löschen, die nicht " +"auch auf der Quellseite vorhanden sind. Dies gilt allerdings nur für die " +"Verzeichnisse, die tatsächlich aktualisiert werden." + +#: smb4k/core/smb4ksettings.cpp:896 +msgid "" +"Delete files on the receiving side before the transfer starts (--delete-" +"before). This is the default behavior if --delete or --delete-excluded is " +"specified without one of the --delete-WHEN options." +msgstr "" +"Lösche die Dateien auf der empfangenden Seite bevor der Transfer startet (--" +"delete-before). Dies ist das Standardverhalten, wenn --delete oder --delete-" +"excluded ohne eine der --delete-WANN Optionen angegeben wurde." + +#: smb4k/core/smb4ksettings.cpp:900 +msgid "" +"Delete files on the receiving side after the transfer has completed (--" +"delete-after, --del)." +msgstr "" +"Lösche die Dateien auf der empfangenden Seite, nachdem der Transfer beendet " +"ist (--delete-after, --del)." + +#: smb4k/core/smb4ksettings.cpp:904 +msgid "" +"Delete files on the receiving side during the transfer (--delete-during). " +"This method is faster than --delete-before or --delete-after, but it is only " +"supported with rsync 2.6.4 or later." +msgstr "" +"Lösche die Dateien auf der empfangenden Seite während des Transfers (--" +"delete-during). Diese Methode ist schneller als --delete-before oder --" +"delete-after, wird aber erst ab rsync 2.6.4 unterstützt." + +#: smb4k/core/smb4ksettings.cpp:907 +msgid "Also delete excluded files from destination directory" +msgstr "" +"Lösche auch ausgeschlossene Dateien aus dem\n" +"Zielverzeichnis" + +#: smb4k/core/smb4ksettings.cpp:908 +msgid "" +"Also delete excluded files from destination directory (--delete-excluded). " +"In addition to deleting the files on the receiving side that are not on the " +"sending side, this tells rsync to also delete any files on the receiving " +"side that are excluded. Refer to rsync's manual page for further information." +msgstr "" +"Lösche auch ausgeschlossene Dateien vom Zielverzeichnis (--delete-excluded). " +"Zusätzlich zum Löschen der auf der empfangenden, aber nicht auf der " +"sendenden Seite vorhandenen Dateien, veranlasst dies rsync dazu, alle " +"Dateien auf der empfangenden Seite zu löschen, die ausgeschlossen wurden. " +"Lesen Sie die Manualpage für rsync für mehr Informationen." + +#: smb4k/core/smb4ksettings.cpp:912 +msgid "" +"Delete even if I/O errors occur (--ignore-errors). This option has to be " +"specified in conjunction with --delete to take effect." +msgstr "" +"Lösche sogar dann, wenn Ein- und Ausgabefehler auftreten (--ignore-errors). " +"Diese Option muss zusammen mit --delete angegeben werden, um in Effekt zu " +"treten." + +#: smb4k/core/smb4ksettings.cpp:916 +msgid "" +"Force deletion of directories even if they are not empty (--force). This " +"option tells rsync to delete a non-empty directory when it is to be replaced " +"by a non-directory. This is only relevant if deletions are not active." +msgstr "" +"Erzwinge das Löschen von Verzeichnissen sogar dann, wenn sie nicht leer sind " +"(--force). Diese Option veranlasst rsync dazu, ein nicht leeres Verzeichnis " +"zu löschen, wenn es durch einen Eintrag ersetzt werden soll, der kein " +"Verzeichnis ist. Dies ist jedoch nur relevant, wenn keine anderweitigen " +"Löschungen aktiviert wurden." + +#: smb4k/core/smb4ksettings.cpp:919 +msgid "Only delete a maximum number of files" +msgstr "Lösche nur eine maximale Anzahl von Dateien" + +#: smb4k/core/smb4ksettings.cpp:920 +msgid "" +"Only delete as many files as defined here (--max-delete=NUM). This tells " +"rsync not to delete more than NUM files or directories (NUM must be non-" +"zero). This is useful when mirroring very large trees to prevent disasters." +msgstr "" +"Lösche nur so viele Dateien, wie hier angegeben sind (--max-delete=ZAHL). " +"Dies veranlasst rsync dazu, nicht mehr als ZAHL Dateien und Verzeichnisse zu " +"löschen (ZAHL darf nicht Null sein). Dies ist nützlich, wenn man sehr große " +"Verzeichnisbäume spiegelt und ein Desaster verhindern will." + +#: smb4k/core/smb4ksettings.cpp:924 +msgid "Value for DeleteMaximum config entry" +msgstr "Der Werte für den DeleteMaximum Konfigurationseintrag" + +#: smb4k/core/smb4ksettings.cpp:927 smb4k/core/smb4ksettings.cpp:935 +msgid "Don't transfer any file smaller than SIZE" +msgstr "Übertrage keine Datei, die kleiner ist als GRÖSSE" + +#: smb4k/core/smb4ksettings.cpp:928 +msgid "" +"This option causes rsync to not transfer any file that is smaller than the " +"specified size (--min-size=SIZE)." +msgstr "" +"Diese Option veranlasst rsync, keine Datei zu übertragen, die kleiner als " +"die angegebene Größe ist (--min-size=GRÖSSE)." + +#: smb4k/core/smb4ksettings.cpp:932 +msgid "Value for MinimalTransferSize config entry" +msgstr "Wert für den MinimalTransferSize Konfigurationseintrag" + +#: smb4k/core/smb4ksettings.cpp:936 +msgid "" +"This option causes rsync to not transfer any file that is larger than the " +"specified size (--max-size=SIZE)." +msgstr "" +"Diese Option veranlasst rsync, keine Datei zu übertragen, die größer als die " +"angegebene Größe ist (--max-size=GRÖSSE)." + +#: smb4k/core/smb4ksettings.cpp:940 +msgid "Value for MamximalTransferSize config entry" +msgstr "Werte für den MamximalTransferSize Konfigurationseintrag" + +#: smb4k/core/smb4ksettings.cpp:944 +msgid "" +"Keep partially transferred files (--partial). The default behavor is that " +"any partially transferred file is deleted if the transfer is interrupted." +msgstr "" +"Bewahre teilweise übertragene Dateien auf (--partial). Das Standardverhalten " +"ist, dass alle Dateien, die nur teilweise übertragen wurden, bei der " +"Unterbrechung des Transfers gelöscht werden." + +#: smb4k/core/smb4ksettings.cpp:947 +msgid "The directory where to put a partially transferred file into." +msgstr "Das Verzeichnis, in das teilweise übertragene Dateien abgelegt werden." + +#: smb4k/core/smb4ksettings.cpp:948 +msgid "" +"Put a partially transferred file into this directory (--partial-dir=DIR). " +"This is a better way than the --partial option to keep partial files, " +"because the partially transferred file is kept in a different directory and " +"the destination file is not overwritten." +msgstr "" +"Lege eine teilweise übertragene Datei in diesem Verzeichnis ab (--partial-" +"dir=DIR). Dies ist eine bessere Möglichkeit nur teilweise übertragene Datei " +"aufzubewahren, als die Option --partial, weil die teilweise übertragenen " +"Dateien in einem getrennten Verzeichnis aufbewahrt und die Zieldateien nicht " +"überschrieben werden." + +#: smb4k/core/smb4ksettings.cpp:951 +msgid "The data for the UsePartialDirectory option" +msgstr "Die Eingabe für die UsePartialDirectory Option" + +#: smb4k/core/smb4ksettings.cpp:955 +msgid "" +"Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a " +"useful shorthand for excluding a broad range of files that you often do not " +"want to transfer between systems. This option uses the same algorithm that " +"CVS uses to determine if a file should be ignored." +msgstr "" +"Ignoriere Dateien automatisch genauso, wie es CVS tut (-C, --cvs-exclude). " +"Dies ist eine nützliche Kurzschreibweise für das Ausschließen einer großen " +"Anzahl von Dateien, die Sie oft gar nicht mit übertragen lassen wollen. " +"Diese Option benutzt den gleichen Algorithmus wie CVS, um zu bestimmen, ob " +"eine Datei ignoriert werden soll." + +#: smb4k/core/smb4ksettings.cpp:958 +msgid "Exclude files that match a certain pattern" +msgstr "Schließe Dateien aus, die einem bestimmten Muster entsprechen" + +#: smb4k/core/smb4ksettings.cpp:959 +msgid "" +"Exclude files that match a certain pattern (--exclude=PATTERN). This is a " +"special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" +"Schließe Dateien aus, die einem bestimmten Muster entsprechen (--" +"exclude=MUSTER). Dies ist eine spezielle Filterregel. Für weitere " +"Informationen zu Filterregeln lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:962 +msgid "Pattern that is used for file exclusion" +msgstr "Muster, das für den Ausschluss von Dateien benutzt wird" + +#: smb4k/core/smb4ksettings.cpp:965 +msgid "Read exclude patterns from a file" +msgstr "Lese Ausschlussmuster von einer Datei" + +#: smb4k/core/smb4ksettings.cpp:966 +msgid "" +"Read exclude patterns from a file (--exclude-from=FILE). This option is " +"similar to the --exclude=PATTERN option except that the exclude patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" +"Lese die Ausschlussmuster von einer Datei (--exclude-from=DATEI). Diese " +"Option ist ähnlich zu --exclude=MUSTER, außer dass die Ausschlussmuster von " +"einer Datei gelesen werden. Dies ist eine spezielle Filterregel. Für weitere " +"Informationen zu Filterregeln lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:969 +msgid "The file from which the exclude patterns are read" +msgstr "Die Datei, von der die Ausschlussmuster gelesen werden" + +#: smb4k/core/smb4ksettings.cpp:972 +msgid "Do not exclude files matching a certain pattern" +msgstr "Schließe solche Dateien nicht aus, die ein bestimmtes Muster erfüllen" + +#: smb4k/core/smb4ksettings.cpp:973 +msgid "" +"Do not exclude files matching a certain pattern (--include=PATTERN). This is " +"a special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" +"Schließe solche Dateien nicht aus, die ein bestimmtes Muster erfüllen (--" +"include=MUSTER). Dies ist eine spezielle Filterregel. Für weitere " +"Informationen zu Filterregeln lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:976 +msgid "Pattern that is used for file inclusion" +msgstr "Das Muster, das zum Dateieinschluss genutzt wird" + +#: smb4k/core/smb4ksettings.cpp:979 +msgid "Read include patterns from a file" +msgstr "Lese Einschlussmuster von einer Datei" + +#: smb4k/core/smb4ksettings.cpp:980 +msgid "" +"Read include patterns from a file (--include-from=FILE). This option is " +"similar to the --include=PATTERN option except that the include patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" +"Lese Einschlussmuster von einer Datei (--include-from=DATEI). Diese Option " +"ist ähnlich zu --include=MUSTER, außer dass die Einschlussmuster von einer " +"Datei gelesen werden. Dies ist eine spezielle Filterregel. Für weitere " +"Informationen zu Filterregeln lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:983 +msgid "The file from which the include patterns are read" +msgstr "Die Datei von der die Einschlussmuster gelesen werden" + +#: smb4k/core/smb4ksettings.cpp:986 +msgid "Add custom file-filtering rules" +msgstr "Füge benutzerdefinierte Filterregeln hinzu" + +#: smb4k/core/smb4ksettings.cpp:987 +msgid "" +"Add custom file-filtering rules (-f, --filter=RULE). This option allows you " +"to add rules to selectively exclude certain files from the list of files to " +"be transferred." +msgstr "" +"Füge benutzerdefinierte Datei-Filterregeln hinzu (-f, --filter=REGEL). Diese " +"Option erlaubt es Ihnen, Filterregeln hinzuzufügen, die wahlweise gewisse " +"Dateien von der Liste zu übertragender Dateien ausschließt." + +#: smb4k/core/smb4ksettings.cpp:990 +msgid "Use -F filter rule" +msgstr "Benutze die -F Filterregel" + +#: smb4k/core/smb4ksettings.cpp:991 +msgid "" +"This filter rule tells rsync to look for per-directory .rsync-filter files " +"that have been sprinkled through the hierarchy and use their rules to filter " +"the files in the transfer. It has no effect, if you also choose to use the --" +"filter='exclude .rsync-filter' rule." +msgstr "" +"Diese Filterregel veranlasst rsync dazu, in jedem Verzeichnis der zu " +"übertragenden Hierarchie nach einer .rsync-filter Datei zu suchen und ihre " +"Filterregeln für den Transfer zu benutzen, wenn sie vorhanden ist. Diese " +"Filterregel hat keine Auswirkungen, falls Sie ebenfalls die --" +"filter='exclude .rsync-filter' Filterregel auswählen." + +#: smb4k/core/smb4ksettings.cpp:994 +msgid "Use -FF filter rule" +msgstr "Benutze die -FF Filterregel" + +#: smb4k/core/smb4ksettings.cpp:995 +msgid "" +"This rule filters out the .rsync-filter files from the transfer. These files " +"normally contain filter rules that can be activated by choosing the --" +"filter='dir-merge /.rsync-filter' rule and deselecting this one." +msgstr "" +"Diese Regel filtert die .rsync-filter Dateien aus dem Transfer heraus. Diese " +"Dateien enthalten normalerweise Filterregeln, die durch die Wahl der --" +"filter='dir-merge /.rsync-filter' und das Ausschalten dieser Regel aktiviert " +"werden können." + +#: smb4k/core/smb4ksettings.cpp:999 +msgid "" +"Handle sparse files efficiently (-S, --sparse) so that they take up less " +"space on the destination. This option conflicts with --inplace. For further " +"information read rsync's manual page." +msgstr "" +"Übertrage zerstreut gespeicherte Dateien effizient (-S, --sparse), so dass " +"sie weniger Platz auf der Zielseite verbrauchen. Diese Option kollidiert mit " +"--inplace. Für weitere Informationen lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:1003 +msgid "" +"Copy files whole (-W, --whole-file). With this option the incremental rsync " +"algorithm is not used and the whole file is sent as-is instead." +msgstr "" +"Kopiere Dateien im Ganzen (-W, --whole-file). Mit dieser Option wird der " +"inkrementelle Algorithmus von rsync nicht genutzt und die gesamte Datei wird " +"stattdessen als Ganzes übertragen." + +#: smb4k/core/smb4ksettings.cpp:1006 +msgid "Do not cross file system boundaries" +msgstr "Überschreite keine Dateisystemgrenzen" + +#: smb4k/core/smb4ksettings.cpp:1007 +msgid "" +"Do not cross file system boundaries (-x, --one-file-system). This tells " +"rsync to avoid crossing a filesystem boundary when recursing. For further " +"information on this option, read the manual page." +msgstr "" +"Überschreite keine Dateisystemgrenzen (-x, --one-file-system). Dies " +"veranlasst rsync dazu, bei der rekursiven Übertragung keine " +"Dateisystemgrenzen zu überschreiten. Für weitere Informationen zu dieser " +"Option lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:1010 +msgid "Skip creating new files on the receiving side" +msgstr "Übergehe das Erstellen neuer Dateien auf der empfangenden Seite" + +#: smb4k/core/smb4ksettings.cpp:1011 +msgid "" +"Skip creating new files on the receiving side (--existing). This tells rsync " +"to skip creating files (including directories) that do not exist yet on the " +"destination. If this option is combined with the --ignore-existing option, " +"no files will be updated (which can be useful if all you want to do is to " +"delete extraneous files)." +msgstr "" +"Übergehe das Erzeugen neuer Dateien auf der empfangenden Seite (--existing). " +"Dies veranlasst rsync dazu, keine Dateien (und Verzeichnisse) zu erzeugen, " +"die auf der Zielseite noch nicht existieren. Wird diese Option mit der --" +"ignore-existing Option kombiniert, dann werden gar keine Dateien " +"aktualisiert (was sinnvoll sein kann, falls sie nur fremde Dateien löschen " +"wollen)." + +#: smb4k/core/smb4ksettings.cpp:1014 +msgid "Skip updating files that exist on the receiving side" +msgstr "Übergehe das Aktualisieren bereits auf der Zielseite existierender Dateien" + +#: smb4k/core/smb4ksettings.cpp:1015 +msgid "" +"Skip updating files that already exist on the receiving side (--ignore-" +"existing). Existing directories are not ignored." +msgstr "" +"Übergehe die Aktualisierung von Dateien, die bereits auf der empfangenden " +"Seite existieren (--ignore-existing). Vorhandene Verzeichnisse werden nicht " +"ignoriert." + +#: smb4k/core/smb4ksettings.cpp:1018 +msgid "Delay updates until the end of the transfer" +msgstr "Verzögere Updates bis zum Transferende" + +#: smb4k/core/smb4ksettings.cpp:1019 +msgid "" +"Delay updates until the end of the transfer (--delay-updates). This option " +"puts the temporary file from each updated file into a holding directory " +"until the end of the transfer, at which time all the files are renamed and " +"copied into place in rapid succession." +msgstr "" +"Verzögere die Aktualisierung bis zum Ende des Transfers (--delay-updates). " +"Diese Option verursacht, dass die aktualisierten Dateien bis zum Ende des " +"Transfers temporär in einem gesonderten Verzeichnis abgelegt und danach " +"umbenannt und an ihren Platz verschoben werden." + +#: smb4k/core/smb4ksettings.cpp:1023 +msgid "" +"Make backups (-b, --backup). With this option, preexisting destination files " +"are renamed as each file is transferred or deleted. You can control where " +"the backup file goes and what (if any) suffix gets appended using the --" +"backup-dir=DIR and --suffix=SUFFIX options." +msgstr "" +"Mache Sicherheitskopien (-b, --backup). Mit dieser Option werden " +"Sicherheitskopien von bereits existierenden Zieldateien angelegt, bevor sie " +"aktualisiert oder gelöscht werden. Sie können mit Hilfe der Optionen --" +"backup-dir=DIR und --suffix=SUFFIX kontrollieren, wohin die " +"Sicherheitskopien abgelegt werden und welche Suffixe ihnen angehängt werden." + +#: smb4k/core/smb4ksettings.cpp:1026 +msgid "Use a suffix for backups" +msgstr "Benutze ein Suffix für Sicherheitskopien" + +#: smb4k/core/smb4ksettings.cpp:1027 +msgid "Use this suffix for backups (--suffix=SUFFIX)." +msgstr "Benutze dieses Suffix für die Sicherheitskopien (--suffix=SUFFIX)." + +#: smb4k/core/smb4ksettings.cpp:1030 +msgid "Backup suffix" +msgstr "Suffix für Sicherheitkopien" + +#: smb4k/core/smb4ksettings.cpp:1033 +msgid "Put backups into a certain directory" +msgstr "Lege Sicherheitskopien in einem bestimmten Verzeichnis ab" + +#: smb4k/core/smb4ksettings.cpp:1034 +msgid "Store backups in this directory (--backup-dir=DIR)." +msgstr "Speichere die Sicherheitskopien in diesem Verzeichnis (--backup-dir=DIR)." + +#: smb4k/core/smb4ksettings.cpp:1037 +msgid "Backup directory" +msgstr "Verzeichnis für Sicherheitskopien" + +#: smb4k/core/smb4ksettings.cpp:1040 +msgid "Force a fixed checksum block-size" +msgstr "Erzwinge feste Prüfsummen-Blockgröße" + +#: smb4k/core/smb4ksettings.cpp:1041 +msgid "" +"Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the " +"block size used in the rsync algorithm to a fixed value." +msgstr "" +"Erzwinge eine feststehende Blockprüfsummengröße (-B, --block-size=GRÖSSE). " +"Dies erzwingt die Verwendung einer feststehenden Blockgröße im rsync-" +"Algorithmus." + +#: smb4k/core/smb4ksettings.cpp:1045 +msgid "The block size" +msgstr "Die Blockgröße" + +#: smb4k/core/smb4ksettings.cpp:1048 +msgid "Set block/file checksum seed" +msgstr "Setze Anfangswert für Block-/Dateiprüfsummen" + +#: smb4k/core/smb4ksettings.cpp:1049 +msgid "" +"Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum " +"seed to this integer. This 4 byte checksum seed is included in each block " +"and file MD4 checksum calculation. By default the checksum seed is generated " +"by the server and defaults to the current time." +msgstr "" +"Setze den Anfangswert für Block-/Dateiprüfsummen (--checksum-seed=ZAHL). " +"Setze den Anfangswert für eine MD4-Prüfsumme. Dieser 4 Byte große " +"Anfangswert wird für jede Berechnung von MD4 Block- oder Dateiprüfsummen " +"verwendet. Standardmäßig wird der Anfangswert vom Server generiert und " +"besteht aus der momentanen Zeit." + +#: smb4k/core/smb4ksettings.cpp:1053 +msgid "The checksum seed" +msgstr "Der Anfangswert für Prüfsummen" + +#: smb4k/core/smb4ksettings.cpp:1056 +msgid "Skip files based on a checksum" +msgstr "Überspringe Dateien aufgrund einer Prüfsumme" + +#: smb4k/core/smb4ksettings.cpp:1057 +msgid "" +"Skip files based on a checksum and not based on modification time and size (-" +"c, --checksum). For further information on how this feature works read " +"rsync's manual page." +msgstr "" +"Übergehe Dateien aufgrund der Prüfsumme und nicht aufgrund der Änderungszeit " +"und Größe (-c, --checksum). Für weitere Informationen, wie diese Eigenschaft " +"funktioniert, lesen Sie die Manualpage für rsync." + +#: smb4k/core/smb4ksettings.cpp:1074 +msgid "The program that should be used to gain super user privileges" +msgstr "" +"Das Programm, das für die Erlangung von Administratorrechten benutzt werden " +"soll" + +#: smb4k/core/smb4ksettings.cpp:1075 +msgid "" +"Choose the program that will grant you limited super user privileges for " +"mounting and unmounting remote shares. You can either select sudo, the " +"standard tool for this purpose on most distributions, or super." +msgstr "" +"Wählen Sie das Programm aus, mit dem Sie eingeschränkte Administratorrechte " +"bekommen, um entfernte Freigaben ein- und auszuhängen. Sie können entweder " +"sudo, den Standard hierfür bei den meisten Distributionen, oder super " +"auswählen." + +#: smb4k/core/smb4ksettings.cpp:1078 +msgid "Use super user privileges to unmount inaccessible shares" +msgstr "Benutze Administratorrechte, um unzugängliche Freigaben ein- und auszuhängen" + +#: smb4k/core/smb4ksettings.cpp:1079 +msgid "" +"Unmount a share under Linux by force. This even works if the file system is " +"\"busy\", because it is immediately detached from the file system hierarchy " +"and all references to it are cleaned up later when it is not busy anymore. " +"Linux kernel 2.4.11 or later is needed to take advantage of this feature. " +"Use with case! Note, that you will need the root password to write the " +"necessary changes to the configuration file." +msgstr "" +"Erzwinge unter Linux das Aushängen einer Freigabe. Das funktioniert sogar " +"dann, wenn das Dateisystem noch beschäftigt (\"busy\") ist, weil es sofort " +"aus der Dateisystemhierarchie entfernt wird und alle Referenzen, die auf es " +"zeigen, erst dann gelöscht werden, wenn das Dateisystem nicht mehr " +"beschäftigt ist. Linux Kernel 2.4.11 ist nötig, um diese Eigenschaft nutzen " +"zu können. Benutzen Sie diese Funktion mit Vorsicht! Beachten Sie, dass Sie " +"das Administratorpasswort benötigen, um die notwendigen Änderungen in die " +"Konfigurationsdatei zu schreiben." + +#: smb4k/core/smb4ksettings.cpp:1083 +msgid "" +"Use super user privileges for mounting and unmounting remote shares. This " +"feature is only needed, if you are not allowed to use smbmount, smbumount, " +"mount.cifs and umount.cifs as normal user. Note, that you will need the root " +"password to write the necessary changes to the configuration file." +msgstr "" +"Benutze Administratorrechte zum Ein- und Aushängen von entfernten Freigaben. " +"Diese Eigenschaft wird nur benötigt, wenn es Ihnen nicht erlaubt ist, " +"smbmount, smbumount, mount.cifs und umount.cifs als normaler Nutzer " +"auszuführen. Beachten Sie, dass Sie das Administratorpasswort benötigen, um " +"die notwendigen Änderungen in die Konfigurationsdatei zu schreiben." + +#: smb4k/core/smb4kerror.cpp:42 +msgid "" +"The browse list could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Browseliste konnte nicht abgefragt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:46 +msgid "" +"The browse list could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Browseliste konnte nicht abgefragt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:55 +msgid "" +"The list of servers could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Serverliste konnte nicht abgefragt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:59 +msgid "" +"The list of servers could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Serverliste konnte nicht abgefragt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:68 +msgid "" +"The list of shares could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Liste der Freigaben konnte nicht abgefragt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:72 +msgid "" +"The list of shares could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Liste der Freigaben konnte nicht abgefragt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:81 +msgid "" +"The preview could not be compiled.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Vorschau konnte nicht erzeugt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:85 +msgid "" +"The preview could not be compiled.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Vorschau konnte nicht erzeugt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:92 +msgid "" +"The wallet \"%1\" could not be opened. KWallet support will be disabled for " +"this session." +msgstr "" +"Die digitale Brieftasche \"%1\" konnte nicht geöffnet werden. Die " +"Unterstützung für KWallet wird für diese Sitzung ausgeschaltet." + +#: smb4k/core/smb4kerror.cpp:100 +msgid "" +"Some file permissions could not be determined.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Liste der SMB- und CIFS-Freigaben konnte nicht importiert werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:104 +msgid "" +"Some file permissions could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Einige Dateizugriffsrechte konnten nicht bestimmt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:111 +msgid "" +"You are not allowed to unmount this share, because it is owned by another " +"user." +msgstr "" +"Sie dürfen diese Freigabe nicht aushängen, weil sie zu einem anderen " +"Benutzer gehört." + +#: smb4k/core/smb4kerror.cpp:119 +msgid "" +"The share \"%1\" could not be mounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Freigabe \"%1\" konnte nicht eingehängt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:123 +msgid "" +"The share \"%1\" could not be mounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Freigabe \"%1\" konnte nicht eingehängt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:132 +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Freigabe \"%1\" konnte nicht ausgehängt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:136 +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Freigabe \"%1\" konnte nicht ausgehängt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:143 +msgid "The file \"%1\" could not be found." +msgstr "Die Datei \"%1\" konnte nicht gefunden werden." + +#: smb4k/core/smb4kerror.cpp:151 +msgid "The file \"%1\" could not be read." +msgstr "Die Datei \"%1\" konnte nicht gelesen werden." + +#: smb4k/core/smb4kerror.cpp:155 +msgid "" +"The file \"%1\" could not be read.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Datei \"%1\" konnte nicht gelesen werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:164 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Der Name Ihres Computers konnte mit Hilfe des Systemausrufs gethostname() " +"nicht bestimmt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:168 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Der Name Ihres Computer konnte mit Hilfe des Systemaufrufs gethostname() " +"nicht bestimmt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:175 +msgid "" +"Either your PATH environment variable is not set properly or there are the " +"following programs missing on your system:\n" +"%1\n" +"Please correct this and restart Smb4K." +msgstr "" +"Entweder ist Ihre PATH Umgebungsvariable nicht korrekt gesetzt, oder die " +"folgenden Programme sind nicht installiert:\n" +"%1\n" +"Bitte korrigieren Sie dies und starten Sie danach Smb4K erneut." + +#: smb4k/core/smb4kerror.cpp:181 +msgid "" +"The file \"%1\" is currently being edited by user %2. To avoid any problems, " +"access to this file is denied at the moment. Please try again later." +msgstr "" +"Die Datei \"%1\" wird zur Zeit vom Benutzer %2 editiert. Um etwaige Probleme " +"zu vermeiden, ist der Zugriff auf diese Datei im Moment nicht erlaubt. Bitte " +"versuchen Sie es später noch einmal." + +#: smb4k/core/smb4kerror.cpp:187 +msgid "The directory \"%1\" could not be created." +msgstr "Das Verzeichnis \"%1\" konnte nicht erzeugt werden." + +#: smb4k/core/smb4kerror.cpp:193 +msgid "The file \"%1\" could not be written." +msgstr "Die Datei \"%1\" konnte nicht geschrieben werden." + +#: smb4k/core/smb4kerror.cpp:199 +msgid "The share could not be unmounted, because the mount point string was empty." +msgstr "" +"Diese Freigabe konnte nicht ausgehängt werden, da der Eintrag für den " +"Einhängepunkt leer war." + +#: smb4k/core/smb4kerror.cpp:205 +msgid "This feature has not been enabled." +msgstr "Dieses Feature wurde nicht eingeschaltet." + +#: smb4k/core/smb4kerror.cpp:211 +msgid "Printers cannot be bookmarked." +msgstr "Drucker können nicht als Lesezeichen gespeichert werden." + +#: smb4k/core/smb4kerror.cpp:217 +msgid "" +"IP addresses are not supported with this search method. Please choose \"Use " +"nmblookup\" in the configuration dialog and try again." +msgstr "" +"Sie Suchmethode, die Sie ausgewählt haben (smbclient), kann IP-Adressen " +"nicht korrekt handhaben. Bitte wählen Sie \"Benutze nmblookup\" im " +"Konfigurationsdialog und versuchen Sie es erneut." + +#: smb4k/core/smb4kerror.cpp:225 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Liste der eingehängten SMBFS- und CIFS-Freigaben konnte nicht importiert " +"werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:229 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Liste der eingehängten SMBFS- und CIFS-Freigaben konnte nicht importiert " +"werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:236 +msgid "The command \"%1\" could not be found." +msgstr "Der Befehl \"%1\" konnte nicht gefunden werden." + +#: smb4k/core/smb4kerror.cpp:244 +msgid "" +"The file \"%1\" could not be printed.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Datei \"%1\" konnte nicht gedruckt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:248 +msgid "" +"The file \"%1\" could not be printed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Datei \"%1\" konnte nicht gedruckt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:257 +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Das temporäre Verzeichnis \"%1\" konnte nicht angelegt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:261 +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Das temporäre Verzeichnis \"%1\" konnte nicht angelegt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:270 +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die temporäre Datei \"%1\" konnte nicht angelegt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:274 +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die temporäre Datei \"%1\" konnte nicht angelegt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:281 +msgid "The directory \"%1\" could not be found." +msgstr "Das Verzeichnis \"%1\" konnte nicht gefunden werden." + +#: smb4k/core/smb4kerror.cpp:287 +msgid "" +"The file \"%1\" is irregular. That means it is either a symlink, a fifo, or " +"something similar. This could indicate that someone is trying to exploit " +"your system. Please inform your system administrator." +msgstr "" +"Die Datei \"%1\" ist irregulär. Das bedeutet, sie ist entweder ein Symlink, " +"ein FIFO oder ähnliches. Möglicherweise deutet das darauf hin, dass jemand " +"versucht, Ihr System anzugreifen. Bitte informieren Sie Ihren " +"Systemadministrator." + +#: smb4k/core/smb4kerror.cpp:295 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Die Synchronisation konnte nicht erfolgreich durchgeführt werden.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:299 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Synchronisation konnte nicht erfolgreich durchgeführt werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:308 +msgid "The file \"%1\" could not be opened." +msgstr "Die Datei \"%1\" konnte nicht geöffnet werden." + +#: smb4k/core/smb4kerror.cpp:312 +msgid "" +"The file \"%1\" could not be opened.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Datei \"%1\" konnte nicht geöffnet werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:321 +msgid "The file \"%1\" could not be closed." +msgstr "Die Datei \"%1\" konnte nicht geschlossen werden." + +#: smb4k/core/smb4kerror.cpp:325 +msgid "" +"The file \"%1\" could not be closed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Datei \"%1\" konnte nicht geschlossen werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:332 +msgid "" +"The list of arguments for the \"net\" command could not be assembled.\n" +"At the moment it reads: %1" +msgstr "" +"Die Argumente für das \"net\" Kommando konnten nicht zusammengestellt " +"werden.\n" +"Im Moment lesen sie sich wie folgt: %1" + +#: smb4k/core/smb4kerror.cpp:340 +msgid "The list of supplementary group IDs could not be determined." +msgstr "" +"Die Liste der zusätzlichen Gruppenkennungen (GID) konnte nicht ermittelt " +"werden." + +#: smb4k/core/smb4kerror.cpp:344 +msgid "" +"The list of supplementary group IDs could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Die Liste der zusätzlichen Gruppenkennungen (GID) konnte nicht ermittelt " +"werden.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:354 +msgid "" +"An unknown error occurred.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Ein unbekannter Fehler ist aufgetreten.\n" +"Detaillierte Informationen können nicht gegeben werden, da es keine " +"Fehlermeldung gab." + +#: smb4k/core/smb4kerror.cpp:358 +msgid "" +"An unknown error occurred.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Ein unbekannter Fehler ist aufgetreten.\n" +"Lesen Sie die Fehlermeldung unter \"Details\", um mehr herauszufinden." + +#: smb4k/core/smb4kerror.cpp:385 +msgid "" +"The mimetype \"%1\" is not supported. Please convert the file to PostScript " +"or PDF." +msgstr "" +"Der Mimetype \"%1\" wird nicht unterstützt. Bitte wandeln Sie die Datei in " +"PostScript oder PDF um." + +#: smb4k/core/smb4kerror.cpp:391 +msgid "" +"You previously chose to use \"%1\", but now it is missing on your system. " +"Smb4K will disable this feature." +msgstr "" +"Sie haben Smb4K so eingerichtet, dass \"%1\" benutzt werden soll. Es fehlt " +"allerdings nun auf Ihrem Rechner. Die entsprechende Eigenschaft wird deshalb " +"jetzt abgeschaltet." + +#: smb4k/core/smb4kerror.cpp:397 +msgid "" +"The label \"%1\" is used more than once. It will automatically be renamed " +"for bookmark \"%2\" to avoid confusion." +msgstr "" +"Die Bezeichnung \"%1\" wird mehr als einmal benutzt. Sie wird für das " +"Lesezeichen \"%2\" automatisch umbenannt, um Verwechslungen zu vermeiden." + +#: smb4k/core/smb4kpasswordhandler.cpp:258 +msgid "The access was denied. " +msgstr "Der Zugriff wurde verweigert. " + +#: smb4k/core/smb4kpasswordhandler.cpp:261 +msgid "The password is not correct. " +msgstr "Das Passwort ist nicht korrekt. " + +#: smb4k/core/smb4kpasswordhandler.cpp:264 +msgid "The permission was denied. " +msgstr "Die Zugriffsberechtigung wurde abgelehnt." + +#: smb4k/core/smb4kpasswordhandler.cpp:267 +msgid "An authentication error occurred. " +msgstr "Ein Fehler ist bei der Authentifizierung aufgetreten." + +#: smb4k/core/smb4kpasswordhandler.cpp:270 +msgid "The logon failed. " +msgstr "Die Anmeldung ist fehlgeschlagen." + +#: smb4k/core/smb4kpasswordhandler.cpp:278 +msgid "Please enter authentication data for server %1." +msgstr "Bitte geben Sie die Anmeldedaten für den Server %1 ein." + +#: smb4k/core/smb4kpasswordhandler.cpp:282 +msgid "Please enter authentication data for share %1." +msgstr "Bitte geben Sie die Authentifizierung für die Freigabe %1 ein." + +#: smb4k/core/smb4knetworkitems.cpp:202 +msgid "Disk" +msgstr "Laufwerk" + +#: smb4k/core/smb4knetworkitems.cpp:206 smb4k/dialogs/smb4kprintdialog.cpp:71 +msgid "Printer" +msgstr "Drucker" + +#: smb4k/core/smb4khomesshareshandler.cpp:73 +msgid "Specify User" +msgstr "Benutzer angeben" + +#: smb4k/core/smb4khomesshareshandler.cpp:74 +msgid "Clear List" +msgstr "Lösche Liste" + +#: smb4k/core/smb4khomesshareshandler.cpp:87 +msgid "Please specify a user name." +msgstr "Bitte geben Sie einen Benutzernamen an." + +#: smb4k/listview/smb4kshareslistview.cpp:52 +msgid "Owner" +msgstr "Eigentümer" + +#: smb4k/listview/smb4kshareslistview.cpp:54 +msgid "Login" +msgstr "Anmeldename" + +#: smb4k/listview/smb4kshareslistview.cpp:57 +msgid "Free" +msgstr "Frei" + +#: smb4k/listview/smb4kshareslistview.cpp:58 +msgid "Used" +msgstr "Benutzt" + +#: smb4k/listview/smb4kshareslistview.cpp:59 +msgid "Total" +msgstr "Gesamt" + +#: smb4k/listview/smb4kshareslistview.cpp:60 +msgid "Usage" +msgstr "Verwendung" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:122 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:122 +msgid "Mount point:" +msgstr "Einhängepunkt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:211 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:211 +msgid "Free:" +msgstr "Frei:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:215 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:215 +msgid "Used:" +msgstr "Benutzt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:219 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:219 +msgid "Total:" +msgstr "Gesamt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:223 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:223 +msgid "Usage:" +msgstr "Verwendung:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:229 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:388 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:229 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:388 +msgid "This share is inaccessible." +msgstr "Diese Freigabe ist unzugänglich." + +#: smb4k/listview/smb4kshareslistview_part.cpp:115 +#: smb4k/smb4ksystemtray.cpp:794 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:112 +msgid "&Force Unmounting" +msgstr "Aushängen e&rzwingen" + +#: smb4k/listview/smb4kshareslistview_part.cpp:119 +#: smb4k/smb4ksystemtray.cpp:446 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:116 +msgid "U&nmount All" +msgstr "Alle aushänge&n" + +#: smb4k/listview/smb4kshareslistview_part.cpp:122 +#: smb4k/smb4ksystemtray.cpp:799 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:119 +msgid "S&ynchronize" +msgstr "S&ynchronisieren" + +#: smb4k/listview/smb4kshareslistview_part.cpp:125 +#: smb4k/smb4ksystemtray.cpp:804 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:122 +msgid "Open with Konso&le" +msgstr "Öffnen mit Konso&le" + +#: smb4k/listview/smb4kshareslistview_part.cpp:128 +#: smb4k/smb4ksystemtray.cpp:809 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:125 +msgid "Open with &Konqueror" +msgstr "Öffnen mit &Konqueror" + +#: smb4k/listview/smb4kshareslistview_part.cpp:676 +msgid "Smb4KSharesListViewPart" +msgstr "Smb4KSharesListViewPart" + +#: smb4k/searchdlg/smb4ksearchdialog_part.cpp:254 +msgid "Smb4KSearchDialogPart" +msgstr "Smb4KSearchDialogPart" + +#: smb4k/searchdlg/smb4ksearchdialogitem.cpp:80 +msgid "The search failed." +msgstr "Die Suche schlug fehl." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:52 +msgid "Enter the search string here." +msgstr "Geben Sie den Suchbegriff hier ein." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:57 plugin/smb4k_konqplugin.cpp:71 +msgid "Search" +msgstr "Suche" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:63 +msgid "Search Results" +msgstr "Suchergebnisse" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize" +msgstr "Synchronisieren" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize the destination with the source" +msgstr "Synchronisiere das Zielverzeichnis mit dem Quellverzeichnis" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap Paths" +msgstr "Pfade vertauschen" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap source and destination" +msgstr "Vertausche Quell- und Zielverzeichnis" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:60 +msgid "Source:" +msgstr "Quellverzeichnis:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:65 +msgid "Destination:" +msgstr "Zielverzeichnis:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:85 +msgid "Files transferred:" +msgstr "Übertragene Dateien:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:90 +msgid "Transfer rate:" +msgstr "Übertragungsrate:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:46 +msgid "Print File" +msgstr "Datei drucken" + +#: smb4k/dialogs/smb4kprintdialog.cpp:74 +msgid "Name:" +msgstr "Name:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:98 +msgid "File:" +msgstr "Datei:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:107 +msgid "Copies:" +msgstr "Kopien:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:155 +msgid "You haven't specified a file." +msgstr "Sie haben keine Datei angegeben." + +#: smb4k/dialogs/smb4kmountdialog.cpp:48 +msgid "Mount Share" +msgstr "Hänge Freigabe ein" + +#: smb4k/dialogs/smb4kmountdialog.cpp:75 +msgid "IP Address:" +msgstr "IP-Adresse:" + +#: smb4k/dialogs/smb4kmountdialog.cpp:83 +msgid "Add this share to the bookmarks" +msgstr "Füge diese Freigabe den Lesezeichen hinzu" + +#: smb4k/dialogs/smb4kmountdialog.cpp:140 +msgid "" +"The format of the share you entered is not correct. It must have the form //" +"HOST/SHARE." +msgstr "" +"Das Format der Freigabe, die Sie eingegeben haben, ist nicht korrekt. Es " +"muss die Form //RECHNER/FREIGABE haben." + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:46 +msgid "Preview" +msgstr "Vorschau" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:111 +msgid "Forward" +msgstr "Vorwärts" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:112 +msgid "Up" +msgstr "Hoch" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:93 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:106 +msgid "Custom Options" +msgstr "Benutzerdefinierte Einstellungen" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:185 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:301 +msgid "Try to authenticate with Kerberos (Active Directory)" +msgstr "Versuche eine Anmeldung mit Kerberos (Active Directory)" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:52 +msgid "Bookmark Editor" +msgstr "Lesezeichen-Editor" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:61 +msgid "Bookmark" +msgstr "Lesezeichen" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:62 +msgid "Workgroup" +msgstr "Arbeitsgruppe" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:64 +msgid "Label" +msgstr "Beschriftung" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:76 +msgid "Remove &All" +msgstr "&Alle löschen" + +#: smb4k/smb4ksystemtray.cpp:59 smb4k/main.cpp:64 +msgid "Smb4K" +msgstr "Smb4K" + +#: smb4k/main.cpp:51 +msgid "" +"Smb4K is an advanced network neighborhood browser and a\n" +"front end to the programs of the Samba software suite." +msgstr "" +"Smb4K ist ein fortgeschrittener Browser für die Netzwerkumgebung\n" +"und ein Frond-End für die Programme der Samba-Softwaresammlung." + +#: smb4k/main.cpp:66 +msgid "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" +msgstr "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" + +#: smb4k/main.cpp:69 smb4k/main.cpp:70 smb4k/main.cpp:71 +msgid "Developer" +msgstr "Entwickler" + +#: smb4k/main.cpp:74 +msgid "Catalan translation" +msgstr "Katalanische Übersetzung" + +#: smb4k/main.cpp:75 smb4k/main.cpp:100 +msgid "Polish translation" +msgstr "Polnische Übersetzung" + +#: smb4k/main.cpp:76 +msgid "Chinese Simplified translation" +msgstr "Chinesische Übersetzung (zh_CN)" + +#: smb4k/main.cpp:77 +msgid "Russian translation" +msgstr "Russische Übersetzung" + +#: smb4k/main.cpp:78 +msgid "Swedish translation and intensive testing" +msgstr "Schwedische Übersetzung und intensives Testen" + +#: smb4k/main.cpp:79 smb4k/main.cpp:96 +msgid "Brazilian Portuguese translation" +msgstr "Brasilianisch-portugiesische Übersetzung" + +#: smb4k/main.cpp:80 +msgid "Ukrainian translation" +msgstr "Ukrainische Übersetzung" + +#: smb4k/main.cpp:81 +msgid "Hungarian translation" +msgstr "Ungarische Übersetzung" + +#: smb4k/main.cpp:82 smb4k/main.cpp:90 +msgid "Spanish translation" +msgstr "Spanische Übersetzung" + +#: smb4k/main.cpp:83 +msgid "Slovak translation" +msgstr "Slowakische Übersetzung" + +#: smb4k/main.cpp:84 +msgid "French translation" +msgstr "Französische Übersetzung" + +#: smb4k/main.cpp:85 +msgid "Japanese translation" +msgstr "Japanische Übersetzung" + +#: smb4k/main.cpp:86 +msgid "Bulgarian translation" +msgstr "Bulgarische Übersetzung" + +#: smb4k/main.cpp:87 +msgid "Italian translation" +msgstr "Italienische Übersetzung" + +#: smb4k/main.cpp:88 +msgid "Norwegian translations" +msgstr "Norwegische Übersetzungen" + +#: smb4k/main.cpp:89 +msgid "Czech translation" +msgstr "Tschechische Übersetzung" + +#: smb4k/main.cpp:91 smb4k/main.cpp:97 +msgid "Turkish translation" +msgstr "Türkische Übersetzung" + +#: smb4k/main.cpp:92 smb4k/main.cpp:98 +msgid "Chinese Traditional translation" +msgstr "Chinesische Übersetzung (zh_TW)" + +#: smb4k/main.cpp:93 +msgid "Icelandic translation" +msgstr "Isländische Übersetzung" + +#: smb4k/main.cpp:94 +msgid "Danish translation" +msgstr "Dänische Übersetzung" + +#: smb4k/main.cpp:95 +msgid "Dutch translation" +msgstr "Niederländische Übersetzung" + +#: smb4k/main.cpp:99 +msgid "Testing of Smb4K under FreeBSD" +msgstr "Testen von Smb4K unter FreeBSD" + +#: smb4k/main.cpp:129 +msgid "" +"Smb4K now uses a different configuration system. Thus, your old settings are " +"obsolete and you have to reconfigure the application.\n" +"To assure a clean transition, the current configuration file will be removed." +msgstr "" +"Smb4K benutzt nun ein anderes Konfigurationssystem. Aus diesem Grund sind " +"Ihre alten Einstellungen überholt und Sie müssen das Programm neu " +"konfigurieren.\n" +"Um einen einwandfreien Übergang zu gewährleisten, wird die momentane " +"Konfigurationsdatei nun entfernt." + +#: smb4k/iconview/smb4ksharesiconview_part.cpp:549 +msgid "Smb4KSharesIconViewPart" +msgstr "Smb4KSharesIconViewPart" + +#. i18n: file ./smb4k/smb4k_shell.rc line 7 +#. i18n: file ./smb4k/browser/smb4knetworkbrowser_part.rc line 4 +#: rc.cpp:6 rc.cpp:27 +#, no-c-format +msgid "&Network" +msgstr "&Netzwerk" + +#. i18n: file ./smb4k/smb4k_shell.rc line 9 +#: rc.cpp:9 +#, no-c-format +msgid "Sh&ares" +msgstr "Freig&aben" + +#. i18n: file ./smb4k/smb4k_shell.rc line 27 +#: rc.cpp:18 +#, no-c-format +msgid "Network ToolBar" +msgstr "Werkzeugleiste Netzwerk" + +#. i18n: file ./smb4k/smb4k_shell.rc line 29 +#: rc.cpp:21 +#, no-c-format +msgid "Shares View ToolBar" +msgstr "Werkzeugleiste Freigabenanzeige" + +#. i18n: file ./smb4k/smb4k_shell.rc line 31 +#: rc.cpp:24 +#, no-c-format +msgid "Main ToolBar" +msgstr "Hauptwerkzeugleiste" + +#. i18n: file ./smb4k/listview/smb4kshareslistview_part.rc line 4 +#. i18n: file ./smb4k/iconview/smb4ksharesiconview_part.rc line 4 +#: rc.cpp:30 rc.cpp:33 +#, no-c-format +msgid "&Shares" +msgstr "F&reigaben" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Alexander Reinholdt" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "dustpuppy@mail.berlios.de" + +#: plugin/smb4k_konqplugin.cpp:70 +msgid "Scan Network" +msgstr "Netzwerk durchsuchen" + +#: plugin/smb4k_konqplugin.cpp:122 +msgid "Samba Browser" +msgstr "Samba-Browser" + diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..4106aba --- /dev/null +++ b/po/es.po @@ -0,0 +1,3638 @@ +# translation of es.po to Español +# Translation of es to Spanish +# Translation of Smb4K to Castilian aka Spanish +# This file is distributed under the same license as the Smb4K package. +# Copyright (C) 2004 Alexander Reinholdt +# +# Quique , 2004. +# Martín Carr , 2005, 2006, 2007, 2008. +msgid "" +msgstr "" +"Project-Id-Version: es\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-20 08:48+0200\n" +"PO-Revision-Date: 2008-04-25 01:39-0300\n" +"Last-Translator: Martín Carr \n" +"Language-Team: Español\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: smb4k/smb4k.cpp:84 +msgid "&Dock Widgets" +msgstr "Em&potrables" + +#: smb4k/smb4k.cpp:108 smb4k/smb4k.cpp:112 smb4k/smb4k.cpp:287 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:170 +msgid "Network Browser" +msgstr "Explorador de red" + +#: smb4k/smb4k.cpp:118 smb4k/smb4k.cpp:122 smb4k/smb4k.cpp:316 +#: plugin/smb4k_konqplugin.cpp:149 +msgid "Search Dialog" +msgstr "Diálogo de búsqueda" + +#: smb4k/smb4k.cpp:156 +msgid "Shares Vie&w" +msgstr "Vista de &recursos compartidos" + +#: smb4k/smb4k.cpp:159 +msgid "&Icon View" +msgstr "&Vista de íconos" + +#: smb4k/smb4k.cpp:163 +msgid "List Vie&w" +msgstr "Vista de &lista" + +#: smb4k/smb4k.cpp:203 smb4k/smb4k.cpp:771 +msgid "Ready." +msgstr "Preparado." + +#: smb4k/smb4k.cpp:264 +msgid "Jump to shares view" +msgstr "Ir a la vista de recursos compartidos" + +#: smb4k/smb4k.cpp:293 +msgid "Jump to network browser" +msgstr "Ir al explorador de red" + +#: smb4k/smb4k.cpp:332 +msgid "Jump to search dialog" +msgstr "Ir al diálogo de búsqueda" + +#: smb4k/smb4k.cpp:463 +msgid "" +"Closing the main window will keep Smb4K running in the system tray. Use " +"\"Quit\" from the \"File\" menu to quit the application." +msgstr "" +"Si cierra la ventana principal, Smb4K seguirá funcionando minimizado en la " +"bandeja del sistema. Utilice \"Salir\" en el menú \"Archivo\" para salir de la " +"aplicación." + +#: smb4k/smb4k.cpp:465 +msgid "Docking in System Tray" +msgstr "Anclaje en la bandeja del sistema" + +#: smb4k/smb4k.cpp:496 +msgid "Exiting..." +msgstr "Saliendo..." + +#: smb4k/smb4k.cpp:649 +msgid "Looking up workgroups and domains..." +msgstr "Consultando grupos de trabajo y dominios..." + +#: smb4k/smb4k.cpp:655 +msgid "Querying current master browser..." +msgstr "Consultando al navegador maestro actual" + +#: smb4k/smb4k.cpp:661 +msgid "Querying master browser %1..." +msgstr "Consultando al navegador maestro %1..." + +#: smb4k/smb4k.cpp:667 +msgid "Scanning broadcast areas..." +msgstr "Explorando áreas de difusión..." + +#: smb4k/smb4k.cpp:681 +msgid "Opening workgroup..." +msgstr "Abriendo el grupo de trabajo..." + +#: smb4k/smb4k.cpp:687 +msgid "Retrieving list of shares..." +msgstr "Obteniendo lista de recursos compartidos..." + +#: smb4k/smb4k.cpp:693 +msgid "Retrieving additional information..." +msgstr "Recibiendo información adicional..." + +#: smb4k/smb4k.cpp:699 +msgid "Searching..." +msgstr "Buscando..." + +#: smb4k/smb4k.cpp:705 +msgid "Retrying to retrieve list of shares..." +msgstr "Reintentando obtener la lista de recursos..." + +#: smb4k/smb4k.cpp:711 smb4k/smb4k.cpp:729 smb4k/smb4k.cpp:741 +#: smb4k/smb4k.cpp:753 smb4k/smb4k.cpp:765 +msgid "Done." +msgstr "Hecho." + +#: smb4k/smb4k.cpp:717 +msgid "Mounting share..." +msgstr "Montando el recurso compartido..." + +#: smb4k/smb4k.cpp:723 +msgid "Unmounting share..." +msgstr "Desmontando el recurso compartido..." + +#: smb4k/smb4k.cpp:735 +msgid "Printing file..." +msgstr "Imprimiendo archivo..." + +#: smb4k/smb4k.cpp:747 +msgid "Synchronizing data..." +msgstr "Sincronizando datos..." + +#: smb4k/smb4k.cpp:759 +msgid "Generating preview..." +msgstr "Generando previsualización..." + +#: smb4k/smb4k.cpp:819 smb4k/smb4ksystemtray.cpp:236 +msgid "&Edit Bookmarks" +msgstr "&Editar los marcadores" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:55 +msgid "Default Destination" +msgstr "Destino predeterminado" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:59 +msgid "Rsync prefix:" +msgstr "Prefijo de rsync:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:63 +#: smb4k/configdlg/smb4krsyncoptions.cpp:166 +#: smb4k/configdlg/smb4krsyncoptions.cpp:209 +msgid "General" +msgstr "General" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:67 +msgid "Archive mode" +msgstr "Modo archivar" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:68 +msgid "Recurse into directories" +msgstr "Entrar recursivamente en directorios" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:69 +msgid "Skip files that are newer in target directory" +msgstr "Saltear archivos más nuevos en el directorio destino" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:70 smb4k/core/smb4ksettings.cpp:819 +msgid "Update destination files in place" +msgstr "Actualizar archivos destino en el lugar" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:71 smb4k/core/smb4ksettings.cpp:823 +msgid "Use relative path names" +msgstr "Usar caminos relativos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:72 +msgid "Don't send implied directories" +msgstr "No enviar directorios implicados" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:73 smb4k/core/smb4ksettings.cpp:831 +msgid "Transfer directories without recursing" +msgstr "Transferir directorios sin recursión" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:74 smb4k/core/smb4ksettings.cpp:835 +msgid "Compress data during transfer" +msgstr "Comprimir los datos durante la transferencia" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:76 +msgid "Links" +msgstr "Enlaces" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:79 smb4k/core/smb4ksettings.cpp:839 +msgid "Preserve symlinks" +msgstr "Preservar enlaces simbólicos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:80 smb4k/core/smb4ksettings.cpp:843 +msgid "Transform symlinks" +msgstr "Transformar enlaces simbólicos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:81 smb4k/core/smb4ksettings.cpp:847 +msgid "Only transform unsafe symlinks" +msgstr "Transformar únicamente enlaces no seguros" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:82 smb4k/core/smb4ksettings.cpp:851 +msgid "Ignore unsafe symlinks" +msgstr "Ignorar enlaces simbólicos inseguros" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:83 smb4k/core/smb4ksettings.cpp:855 +msgid "Preserve hard links" +msgstr "Conservar enlaces duros" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:84 smb4k/core/smb4ksettings.cpp:859 +msgid "Keep directory symlinks" +msgstr "Mantener enlaces simbólicos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:86 +msgid "File Permissions, etc." +msgstr "Permisos, etc." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:90 smb4k/core/smb4ksettings.cpp:863 +msgid "Preserve permissions" +msgstr "Preservar permisos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:91 smb4k/core/smb4ksettings.cpp:867 +msgid "Preserve group" +msgstr "Preservar grupo" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:92 +msgid "Preserve owner" +msgstr "Preservar dueño" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:93 smb4k/core/smb4ksettings.cpp:875 +msgid "Preserve device and special files" +msgstr "Preservar dispositivos y archivos especiales" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:94 smb4k/core/smb4ksettings.cpp:879 +msgid "Preserve times" +msgstr "Preservar fechas" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:95 smb4k/core/smb4ksettings.cpp:883 +msgid "Omit directories when preserving times" +msgstr "Omitir directorios cuando se preservan las fechas" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:105 +msgid "Copying" +msgstr "Copiando" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:115 +msgid "File Deletion" +msgstr "Eliminación de archivos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:118 smb4k/core/smb4ksettings.cpp:887 +msgid "Remove synchronized source files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:119 smb4k/core/smb4ksettings.cpp:891 +msgid "Delete extraneous files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:120 smb4k/core/smb4ksettings.cpp:895 +msgid "Delete files before transfer" +msgstr "Eliminar archivos antes de transferir" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:121 smb4k/core/smb4ksettings.cpp:899 +msgid "Delete files after transfer" +msgstr "Eliminar archivos después de transferir" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:122 smb4k/core/smb4ksettings.cpp:903 +msgid "Delete files during transfer" +msgstr "Eliminar archivos durante la transferencia" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:123 +msgid "Also delete excluded files" +msgstr "Eliminar también los archivos excluídos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:124 smb4k/core/smb4ksettings.cpp:911 +msgid "Delete even if I/O errors occur" +msgstr "Eliminar incluso si ocurren errores de E/S" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:125 smb4k/core/smb4ksettings.cpp:915 +msgid "Force deletion of non-void directories" +msgstr "Forzar la eliminación de directorios no vacíos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:127 +msgid "Restrictions" +msgstr "Restricciones" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:130 +msgid "Don't delete more than this many files:" +msgstr "No eliminar más de esta cantidad de archivos:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:133 +msgid "File Transfer" +msgstr "Transferencia de archivos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:137 +msgid "Don't transfer any file smaller than:" +msgstr "No transferir ningún archivo menor que:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:140 +msgid "Don't transfer any file larger than:" +msgstr "No transferir ningún archivo más grande que:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:143 smb4k/core/smb4ksettings.cpp:943 +msgid "Keep partially transferred files" +msgstr "Mantener archivos parcialmente transferidos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:145 +msgid "Put a partially transferred file into:" +msgstr "Poner los archivos parcialmente transferidos en:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:156 +msgid "File Deletion && Transfer" +msgstr "Eliminación de archivos && Transferencia" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:170 smb4k/core/smb4ksettings.cpp:954 +msgid "Auto-ignore files in the same way CVS does" +msgstr "Auto-ignorar archivos de la misma forma que lo hace CVS" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:172 +msgid "Exclude files matching this pattern:" +msgstr "Excluir archivos que concuerdan con este patrón:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:174 +msgid "Read exclude patterns from:" +msgstr "Leer patrones de exclusión desde:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:177 +msgid "Don't exclude files matching this pattern:" +msgstr "No excluir archivos que concuerdan con este patrón:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:179 +msgid "Read include patterns from:" +msgstr "Leer patrones de inclusión desde:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:183 +msgid "Filter Rules" +msgstr "Reglas de filtrado" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:186 +msgid "" +"The rules defined below will be added to the \"rsync\" command as they are. " +"Thus, you have to start with the --filter=... argument." +msgstr "Las reglas definidas abajo serán agregadas al comando \"rsync\" textualmente. Por lo tanto, debe empezar con el argumento --filter=." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:189 +msgid "Special filter rules:" +msgstr "Reglas de filtrado especiales:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:190 +msgid "Use --filter='dir-merge /.rsync-filter' filter rule" +msgstr "Usar regla de filtrado --filter='dir-merge /.rsync-filter'" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:191 +msgid "Use --filter='exclude .rsync-filter' filter rule" +msgstr "Usar regla de filtrado '--filter='exclude .rsync-filter'" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:199 +msgid "Filtering" +msgstr "Filtrado" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:213 smb4k/core/smb4ksettings.cpp:998 +msgid "Handle sparse files efficiently" +msgstr "Manejar archivos dispersos eficientemente" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:214 smb4k/core/smb4ksettings.cpp:1002 +msgid "Copy files whole (no rsync algorithm)" +msgstr "Copiar archivos completos (sin algoritmo de rsync)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:215 +msgid "Don't cross file system boundaries" +msgstr "No cruzar límites del sistema de archivos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:216 +msgid "Only update files that already exist" +msgstr "Sólo actualizar archivos que ya existen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:217 +msgid "Ignore files that already exist" +msgstr "Ignorar archivos que ya existen" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:218 +msgid "Delay updates until the end of transfer" +msgstr "Demorar actualización hasta el final de la transferencia" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:220 +msgid "Backup" +msgstr "Respaldo" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:223 smb4k/core/smb4ksettings.cpp:1022 +msgid "Make backups" +msgstr "Realizar respaldos" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:225 +msgid "Backup suffix:" +msgstr "Sufijo de respaldo:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:227 +msgid "Backup directory:" +msgstr "Directorio de respaldo:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:231 +msgid "Checksums" +msgstr "Verificaciones" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:234 +msgid "Force fixed checksum block size:" +msgstr "Forzar tamaño fijo de bloque de verificación:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:236 +msgid "Set block/file checksum seed:" +msgstr "Fijar semilla de verificación de bloque/archivo:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:238 +msgid "Skip files based on checksum" +msgstr "Saltear archivos basado en la verificación (checksum)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:248 +msgid "Advanced" +msgstr "Avanzado" + +#: smb4k/configdlg/smb4kshareoptions.cpp:53 +msgid "Directories" +msgstr "Directorios" + +#: smb4k/configdlg/smb4kshareoptions.cpp:59 +msgid "Mount prefix:" +msgstr "Prefijo de montaje:" + +#: smb4k/configdlg/smb4kshareoptions.cpp:66 +msgid "Force generated subdirectories to be lower case" +msgstr "Forzar subdirectorios generados en minúsculas" + +#: smb4k/configdlg/smb4kshareoptions.cpp:69 +msgid "Mounting and Unmounting" +msgstr "Montaje y desmontaje" + +#: smb4k/configdlg/smb4kshareoptions.cpp:70 +msgid "Unmount all shares of user %1 on exit" +msgstr "Desmontar todos los recursos compartidos de %1 al salir" + +#: smb4k/configdlg/smb4kshareoptions.cpp:72 +msgid "Remount recently used shares on program start" +msgstr "Volver a montar los recursos compartidos usados recientemente al iniciar" + +#: smb4k/configdlg/smb4kshareoptions.cpp:74 +msgid "Allow the unmounting of shares that are owned by other users" +msgstr "" +"Permitir el desmontaje de recursos compartidos pertenecientes a otros " +"usuarios" + +#: smb4k/configdlg/smb4kshareoptions.cpp:77 +msgid "Checks" +msgstr "Verificaciones" + +#: smb4k/configdlg/smb4kshareoptions.cpp:79 +msgid "Interval between checks:" +msgstr "Intervalo entre verificaciones:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:50 +msgid "Browse List" +msgstr "Lista de navegación" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:53 +msgid "Scan the network neighborhood for available workgroups and domains" +msgstr "Buscar en el vecindario de red por grupos de trabajo y dominios disponibles" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:55 +msgid "Query the current workgroup master browser" +msgstr "Consultar al navegador maestro actual" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:62 +msgid "Query this master browser:" +msgstr "Consultar este navegador maestro:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:65 +msgid "Scan broadcast areas:" +msgstr "Explorar áreas de difusión:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:80 +msgid "Network Search" +msgstr "Búsqueda de red" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:85 +msgid "" +"Smb4K uses \"nmblookup\" by default to search for remote hosts. This method " +"is very reliable but fails sometimes if your network neighborhood is " +"configured uncommonly. In this case you should try to use \"smbclient\"." +msgstr "" +"Smb4K utiliza \"nmblookup\" por omisión para efectuar las búsquedas de " +"red. Este método es muy fiable pero a veces falla si su red local está " +"configurada de manera no convencional. En este caso, debería intentar " +"utilizar \"smbclient\"." + +#: smb4k/configdlg/smb4knetworkoptions.cpp:88 +msgid "Use nmblookup (recommended)" +msgstr "Utilizar nmblookup (recomendado)" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:91 +msgid "Use smbclient" +msgstr "Utilizar smbclient" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:162 +msgid "User Interface" +msgstr "Interfaz de usuario" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:163 +#: smb4k/browser/smb4knetworkbrowser.cpp:50 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:186 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:319 +msgid "Network" +msgstr "Red" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:164 +#: smb4k/listview/smb4kshareslistview_part.cpp:144 +#: smb4k/listview/smb4kshareslistview_part.cpp:346 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:141 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:232 +msgid "Shares" +msgstr "Recursos compartidos" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:165 +#: smb4k/configdlg/smb4ksambaoptions.cpp:89 +#: smb4k/core/smb4kpasswordhandler.cpp:237 +msgid "Authentication" +msgstr "Autenticación" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:166 +msgid "Samba" +msgstr "Samba" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:167 +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47 +msgid "Synchronization" +msgstr "Sincronización" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:168 +msgid "Super User" +msgstr "Superusuario" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:327 +#: smb4k/configdlg/smb4kconfigdialog.cpp:328 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1039 +#: smb4k/configdlg/smb4ksambaoptions.cpp:400 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:970 +msgid "auto" +msgstr "automático" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:331 +#: smb4k/configdlg/smb4kconfigdialog.cpp:352 +#: smb4k/configdlg/smb4kconfigdialog.cpp:441 +#: smb4k/configdlg/smb4kconfigdialog.cpp:451 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1098 +#: smb4k/configdlg/smb4ksambaoptions.cpp:428 +msgid "yes" +msgstr "si" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:332 +#: smb4k/configdlg/smb4kconfigdialog.cpp:353 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1099 +#: smb4k/configdlg/smb4ksambaoptions.cpp:427 +msgid "no" +msgstr "no" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:360 +#: smb4k/configdlg/smb4kconfigdialog.cpp:458 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1060 +#: smb4k/configdlg/smb4ksambaoptions.cpp:215 +#: smb4k/configdlg/smb4ksambaoptions.cpp:418 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:913 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-write" +msgstr "lectura-escritura" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:361 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1061 +#: smb4k/configdlg/smb4ksambaoptions.cpp:216 +#: smb4k/configdlg/smb4ksambaoptions.cpp:419 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-only" +msgstr "sólo-lectura" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:460 +#: smb4k/configdlg/smb4kconfigdialog.cpp:465 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1072 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1082 +#: smb4k/configdlg/smb4ksambaoptions.cpp:141 +#: smb4k/configdlg/smb4ksambaoptions.cpp:167 +msgid "default" +msgstr "predeterminado" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:707 +msgid "[Network] The custom master browser has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:722 +msgid "[Network] The broadcast areas have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:733 +msgid "[Shares] The mount prefix is empty.\n" +msgstr "[Recursos] El prefijo de montaje está vacío.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:748 +msgid "[Authentication] The default user name has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:759 +msgid "[Samba] The file mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:770 +msgid "[Samba] The directory mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:781 +msgid "[Samba] The UID is empty.\n" +msgstr "[Samba] El UID está vacío.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:792 +msgid "[Samba] The GID is empty.\n" +msgstr "[Samba] El GID está vacío.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:803 +msgid "[Synchronization] The rsync prefix is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:816 +msgid "" +"[Synchronization] The directory where partially transferred files should be " +"stored is empty.\n" +msgstr "" +"[Sincronización] El directorio donde los archivos parcialmente transferidos " +"deberían estar está vacío.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:829 +msgid "[Synchronization] The exclude patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:842 +msgid "[Synchronization] The path of the exclude file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:855 +msgid "[Synchronization] The include patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:868 +msgid "[Synchronization] The path of the include file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:887 +msgid "[Synchronization] The backup suffix has not been defined.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:900 +msgid "[Synchronization] The backup directory is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:908 +msgid "" +"The configuration could not be written, because one setting is incomplete:\n" +"%1Please correct this issue." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:912 +msgid "" +"The configuration could not be written, because %1 settings are incomplete:\n" +"%1Please correct these issues." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:1191 +msgid "Smb4KConfigDialog" +msgstr "Smb4KConfigDialog" + +#: smb4k/configdlg/smb4kauthoptions.cpp:52 +msgid "Password Storage" +msgstr "Almacenamiento de contraseñas" + +#: smb4k/configdlg/smb4kauthoptions.cpp:53 +msgid "Save the authentication data in a wallet" +msgstr "Guardar la información de autenticación en la cartera" + +#: smb4k/configdlg/smb4kauthoptions.cpp:55 +msgid "If no wallet is used, remember authentication data during run time" +msgstr "" +"Si no se usa una cartera, recordar las contraseñas durante la ejecución del " +"programa" + +#: smb4k/configdlg/smb4kauthoptions.cpp:58 +msgid "Default Login" +msgstr "Usuario predeterminado" + +#: smb4k/configdlg/smb4kauthoptions.cpp:62 +msgid "Use default login" +msgstr "Usar el usuario predeterminado" + +#: smb4k/configdlg/smb4kauthoptions.cpp:69 +#: smb4k/core/smb4kpasswordhandler.cpp:291 +#: smb4k/core/smb4khomesshareshandler.cpp:89 +msgid "User:" +msgstr "Usuario:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:72 +msgid "This login name is used by default to authenticate to a remote server." +msgstr "" + +#: smb4k/configdlg/smb4kauthoptions.cpp:73 +#: smb4k/core/smb4kpasswordhandler.cpp:311 +msgid "Password:" +msgstr "Contraseña:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:77 +msgid "" +"This password is used by default to authenticate to a remote server. It may " +"be empty." +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:70 +msgid "General Options" +msgstr "Opciones generales" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:73 +msgid "NetBIOS name:" +msgstr "Nombre NetBIOS:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:76 +msgid "Domain:" +msgstr "Dominio:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:79 +msgid "Socket options:" +msgstr "Opciones de socket:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:82 +msgid "NetBIOS scope:" +msgstr "Ámbito NetBIOS:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:85 +msgid "Remote SMB port:" +msgstr "Puerto SMB remoto:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:91 +msgid "Try to authenticate with Kerberos" +msgstr "Intentar la autenticación con Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:92 +msgid "Authenticate as machine account" +msgstr "Autenticar como una cuenta de máquina" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:100 +msgid "General Settings" +msgstr "Opciones generales" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:110 +#: smb4k/configdlg/smb4ksambaoptions.cpp:384 +#: smb4k/listview/smb4kshareslistview.cpp:56 +msgid "File System" +msgstr "Sistema de archivos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:120 +msgid "" +"NOTE: You might need to enable support for either \"super\" or \"sudo\" in " +"the Super User page." +msgstr "" +"NOTA: Puede ser que tenga que habilitar \"super\" o \"sudo\" en la " +"pestaña Superusuario." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:124 +msgid "User and Group" +msgstr "Usuario y grupo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:127 +#: smb4k/configdlg/smb4ksambaoptions.cpp:430 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:292 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:317 +msgid "User ID:" +msgstr "ID de usuario:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:131 +#: smb4k/configdlg/smb4ksambaoptions.cpp:435 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:296 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:321 +msgid "Group ID:" +msgstr "ID de grupo:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:136 +msgid "Charset and Codepage" +msgstr "Juego de caracteres y código de página" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:139 +msgid "Client charset:" +msgstr "Juego de caracteres del cliente:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:165 +msgid "Server codepage:" +msgstr "Código de página del servidor:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:202 +msgid "Permissions" +msgstr "Permisos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:205 +msgid "File mask:" +msgstr "Máscara de archivo:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:209 +msgid "Directory mask:" +msgstr "Máscara para los directorios:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:213 +#: smb4k/configdlg/smb4ksambaoptions.cpp:414 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:286 +msgid "Write access:" +msgstr "Acceso de escritura:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:220 +msgid "Advanced CIFS Options" +msgstr "Opciones avanzadas CIFS" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:227 smb4k/core/smb4ksettings.cpp:692 +msgid "Do permission checks" +msgstr "Realizar verificación de permisos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:229 +msgid "Attempt to set UID and GID" +msgstr "Intertar fijar UID y GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:231 smb4k/core/smb4ksettings.cpp:700 +msgid "Use server inode numbers" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:233 smb4k/core/smb4ksettings.cpp:704 +msgid "Do not cache inode data" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:235 smb4k/core/smb4ksettings.cpp:708 +msgid "Translate reserved characters" +msgstr "Traducir caracteres reservados" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:237 smb4k/core/smb4ksettings.cpp:712 +msgid "Do not use locking" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:244 +msgid "Additional options:" +msgstr "Opciones adicionales:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:248 +msgid "Advanced SMBFS Options" +msgstr "Opciones avanzadas de SMBFS" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:251 +msgid "Use Unicode when communicating with the server" +msgstr "Utilizar Unicode para comunicarse con el servidor" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:252 +msgid "Use large file support" +msgstr "Utilizar compatibilidad con archivos grandes" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:258 +msgid "Caching time of directory listings:" +msgstr "Tiempo de cacheo de los listados de directorios:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:289 +msgid "Protocol Hint" +msgstr "Consejo de protocolo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:291 +msgid "Automatic detection" +msgstr "Detección automática" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:293 +msgid "RPC: Modern operating systems" +msgstr "RPC: Sistemas operativos modernos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:295 +msgid "RAP: Older operating systems" +msgstr "RAP: Sistemas operativos antiguos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:297 +msgid "ADS: Active Directory environment (LDAP/Kerberos)" +msgstr "ADS: Entorno Active Directory (LDAP/Kerberos)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:318 +msgid "Name resolve order:" +msgstr "Orden de resolución de nombres:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:321 +msgid "Buffer size:" +msgstr "Tamaño del búfer:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:323 +msgid " Bytes" +msgstr "Bytes" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:325 +msgid "Signing state:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:327 +msgid "none" +msgstr "ninguno" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:328 +msgid "on" +msgstr "encendido" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:329 +msgid "off" +msgstr "apagado" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:330 +msgid "required" +msgstr "requerido" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:354 +msgid "Broadcast address:" +msgstr "Dirección de difusión (broadcast):" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:357 +msgid "Try and bind to UDP port 137 to send and receive UDP datagrams" +msgstr "Intentar conectar al puerto UDP 137 para enviar y recibir datagramas UDP" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:381 +#: smb4k/listview/smb4kshareslistview.cpp:51 +msgid "Item" +msgstr "Item" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:382 +msgid "Protocol" +msgstr "Protocolo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:385 +msgid "Write Access" +msgstr "Acceso de escritura" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:387 +msgid "Kerberos" +msgstr "Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:388 +msgid "UID" +msgstr "UID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:389 +msgid "GID" +msgstr "GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:390 +msgid "Port" +msgstr "Puerto" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:396 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:177 +msgid "Protocol:" +msgstr "Protocolo:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:407 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:136 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:279 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:136 +msgid "File system:" +msgstr "Sistema de archivos:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:423 +msgid "Kerberos:" +msgstr "Kerberos:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:440 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:164 +msgid "Port:" +msgstr "Puerto:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:451 +msgid "Remove All" +msgstr "Eliminar todos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:493 +msgid "Custom" +msgstr "Personalizar" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:52 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:171 +msgid "Shares View" +msgstr "Vista de recursos compartidos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:55 +msgid "Show mounted shares in an icon view" +msgstr "Mostrar los recursos compartidos en vista de íconos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:57 +msgid "Show mounted shares in a list view" +msgstr "Mostrar los recursos compartidos en vista de lista" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:62 +#: smb4k/core/smb4ksettings.cpp:117 +msgid "Show custom bookmark label if available" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:64 +msgid "System Tray" +msgstr "Bandeja del sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:67 +msgid "Embed application into the system tray" +msgstr "Insertar la aplicación en la bandeja del sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:83 +msgid "Remote Shares" +msgstr "Recursos compartidos remotos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:85 +#: smb4k/core/smb4ksettings.cpp:144 +msgid "Show printer shares" +msgstr "Mostrar impresoras compartidas" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:86 +#: smb4k/core/smb4ksettings.cpp:148 +msgid "Show hidden shares" +msgstr "Mostrar recursos compartidos ocultos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:87 +msgid "Show IPC$ shares" +msgstr "Mostrar recursos compartidos IPC$" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:88 +msgid "Show ADMIN$ shares" +msgstr "Mostrar recursos compartidos ADMIN$" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:90 +msgid "Columns" +msgstr "Columnas" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:92 +msgid "Show type" +msgstr "Mostrar el tipo" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:93 +msgid "Show IP address" +msgstr "Mostrar la dirección IP" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:94 +msgid "Show comment" +msgstr "Mostrar comentarios" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:96 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:124 +msgid "Tooltips" +msgstr "Consejos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:98 +msgid "Show tooltip with information about a network item" +msgstr "Motrar información sobre el elemento de la red" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:114 +#: smb4k/smb4ksystemtray.cpp:67 +msgid "Mounted Shares" +msgstr "Recursos compartidos montados" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:116 +msgid "Show mount point instead of share name" +msgstr "Mostrar el punto de montaje en vez del nombre del recurso compartido" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:117 +#: smb4k/core/smb4ksettings.cpp:180 +msgid "Show all shares that are mounted on the system" +msgstr "Mostrar todos los recursos compartidos que están montados en el sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:119 +msgid "Drag and Drop" +msgstr "Arrastrar y soltar" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:121 +msgid "Allow dropping of files and directories onto shares" +msgstr "Permitir soltar archivos y directorios en los recursos compartidos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:122 +msgid "Allow dragging of shares" +msgstr "Permitir arrastrar recursos compartidos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:126 +msgid "Show tooltip with information about a share" +msgstr "Mostrar información sobre los recursos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:128 +msgid "List View" +msgstr "Vista de lista" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:132 +#: smb4k/core/smb4ksettings.cpp:200 +msgid "Show owner and group (SMBFS only)" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:133 +#: smb4k/core/smb4ksettings.cpp:204 +msgid "Show login (CIFS only)" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:135 +msgid "Show owner and group" +msgstr "Mostrar dueño y grupo" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:137 +#: smb4k/core/smb4ksettings.cpp:208 +msgid "Show file system" +msgstr "Mostrar sistema de archivos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:138 +#: smb4k/core/smb4ksettings.cpp:212 +msgid "Show free disk space" +msgstr "Mostrar espacio libre en disco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:139 +#: smb4k/core/smb4ksettings.cpp:216 +msgid "Show used disk space" +msgstr "Mostrar espacio usado en disco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:140 +#: smb4k/core/smb4ksettings.cpp:220 +msgid "Show total disk space" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:141 +#: smb4k/core/smb4ksettings.cpp:224 +msgid "Show disk usage" +msgstr "Mostrar uso de disco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:158 +msgid "Hidden Files and Directories" +msgstr "Archivos y directorios ocultos" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:159 +msgid "Preview hidden files and directories" +msgstr "Previsualizar archivos ocultos y directorios" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:169 +msgid "Main Window && System Tray" +msgstr "Ventana principal && Bandeja de sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:172 +msgid "Preview Dialog" +msgstr "Diálogo de vista previa" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:52 +msgid "Programs" +msgstr "Programas" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:55 +msgid "Use the following program to gain super user privileges:" +msgstr "Usar el siguiente programa para obtener permisos de superusuario:" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:59 +msgid "Actions" +msgstr "Acciones" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:62 +msgid "Use super user privileges to force the unmounting of (inaccessible) shares" +msgstr "" +"Utilizar los permisos de superusuario para desmontar los recursos " +"compartidos (inaccesibles)" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:64 +#: smb4k/core/smb4ksettings.cpp:1082 +msgid "Use super user privileges to mount and unmount shares" +msgstr "" +"Utilizar los permisos de superusuario para montar y desmontar recursos " +"compartidos" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:67 +msgid "Remove Entries" +msgstr "Eliminar las entradas" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:68 +msgid "Remove entries from the configuration file" +msgstr "" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:69 +msgid "" +"Depending on your choice under \"Programs\", all entries that were written " +"by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. " +"Additionally, all your choices under \"Actions\" will be cleared." +msgstr "" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:109 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:154 +#: smb4k/dialogs/smb4kprintdialog.cpp:92 smb4k/dialogs/smb4kmountdialog.cpp:79 +msgid "Workgroup:" +msgstr "Grupo de trabajo:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +msgid "Pseudo master browser:" +msgstr "Navegador pseudo-maestro:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:158 +msgid "Master browser:" +msgstr "Navegador maestro:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:116 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:136 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:140 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:144 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:160 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:213 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:292 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:301 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:310 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:331 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:335 +#: smb4k/dialogs/smb4kprintdialog.cpp:88 +msgid "Unknown" +msgstr "Desconocido" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:129 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:207 +#: smb4k/dialogs/smb4kprintdialog.cpp:83 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +msgid "Host:" +msgstr "Servidor:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:132 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:185 +msgid "Comment:" +msgstr "Comentario:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:135 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:211 +#: smb4k/dialogs/smb4kprintdialog.cpp:86 +msgid "IP address:" +msgstr "Dirección IP:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:139 +msgid "Operating system:" +msgstr "Sistema operativo:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:143 +msgid "Server string:" +msgstr "Servidor:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:182 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:120 +#: smb4k/dialogs/smb4kmountdialog.cpp:70 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:120 +msgid "Share:" +msgstr "Recurso Compartido:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:188 +msgid "Type:" +msgstr "Tipo:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:196 +msgid "Mounted:" +msgstr "Montado:" + +#: smb4k/browser/smb4knetworkbrowser.cpp:51 +msgid "Type" +msgstr "Tipo" + +#: smb4k/browser/smb4knetworkbrowser.cpp:52 +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:63 +msgid "IP Address" +msgstr "Dirección IP" + +#: smb4k/browser/smb4knetworkbrowser.cpp:53 +msgid "Comment" +msgstr "Comentario" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:141 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:532 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:552 +msgid "Scan Netwo&rk" +msgstr "Buscar Re&d" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:144 +msgid "&Abort" +msgstr "&Interrumpir" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:149 smb4k/smb4ksystemtray.cpp:72 +msgid "M&ount Manually" +msgstr "M&ontar manualmente" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:154 +msgid "Au&thentication" +msgstr "Au&tenticación" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:157 +msgid "&Custom Options" +msgstr "&Opciones personalizadas" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:160 +msgid "Add &Bookmark" +msgstr "&Agregar marcador" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:163 +msgid "Pre&view" +msgstr "&Vista previa" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:166 +msgid "&Print File" +msgstr "&Imprimir archivo" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:169 +msgid "&Mount" +msgstr "&Montar" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:203 +#: smb4k/listview/smb4kshareslistview_part.cpp:111 +#: smb4k/smb4ksystemtray.cpp:790 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:108 +msgid "&Unmount" +msgstr "&Desmontar" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:345 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:370 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:400 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:462 +msgid "Scan Compute&r" +msgstr "Buscar computado&ra" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:383 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:486 +msgid "Scan Wo&rkgroup" +msgstr "Buscar &grupo de trabajo" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:1905 +msgid "Smb4KNetworkBrowserPart" +msgstr "Smb4KNetworkBrowserPart" + +#: smb4k/core/smb4kcore.cpp:248 +msgid "" +"Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will " +"hang if you try to access it.\n" +"Do you want to continue?" +msgstr "" +"Hasta KDE 3.3.x, KIO y Konqueror no pueden manejar recursos compartidos " +"CIFS. Konqueror fallará si intenta acceder a uno.\n" +"¿Desea continuar?" + +#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057 +msgid "Buffer size exceeded" +msgstr "Tamaño del búfer excedido" + +#: smb4k/core/smb4kmounter.cpp:815 smb4k/core/smb4kmounter.cpp:862 +msgid "Do you really want to force the unmounting of this share?" +msgstr "¿Realmente desea forzar el desmontado de este recurso compartido?" + +#: smb4k/core/smb4ksettings.cpp:30 +msgid "The path to the program \"grep\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:33 +msgid "The path to the program \"awk\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:36 +msgid "The path to the program \"sed\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:39 +msgid "The path to the program \"xargs\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:42 +msgid "The path to the program \"rmdir\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:45 +msgid "The path to the program \"nmblookup\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:48 +msgid "The path to the program \"smbclient\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:51 +msgid "The path to the program \"smbspool\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:54 +msgid "The path to the program \"net\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:57 +msgid "The path to the program \"mount.cifs\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:60 +msgid "The path to the program \"umount.cifs\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:63 +msgid "The path to the program \"smbmount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:66 +msgid "The path to the program \"smbumount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:69 +msgid "The path to the program \"mount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:72 +msgid "The path to the program \"mount_smbfs\" (FreeBSD only)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:75 +msgid "The path to the program \"smbutil\" (FreeBSD only)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:78 +msgid "The path to the program \"umount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:81 +msgid "The path to the program \"smb4k_mount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:84 +msgid "The path to the program \"smb4k_umount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:87 +msgid "The path to the program \"smb4k_kill\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:90 +msgid "The path to the program \"smb4k_cat\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:93 +msgid "The path to the program \"smb4k_mv\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:96 +msgid "The path to the program \"super\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:99 +msgid "The path to the program \"sudo\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:102 +msgid "The path to the program \"dvips\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:105 +msgid "The path to the program \"enscript\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:108 +msgid "The path to the program \"rsync\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:111 +msgid "The path to the program \"konsole\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:118 +msgid "" +"Do not show the name of the share that is represented by the bookmark but " +"the custom label that was defined in the bookmark editor." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:121 +msgid "Embed application into system tray" +msgstr "Insertar la aplicación en la bandeja del sistema" + +#: smb4k/core/smb4ksettings.cpp:122 +msgid "" +"Embed the application into the system tray. The system tray widget provides " +"a popup menu with several commonly used tasks so that you do not need to " +"bring up the main window everytime. If this setting is chosen you have to " +"use \"Quit\" from the \"File\" menu or the system tray widget to exit the " +"application." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:125 +msgid "Start docked" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:126 +msgid "" +"Start the application docked to the system tray, i.e. only the system tray " +"widget is shown and the main window is hidden. You can bring the main window " +"up by clicking on the system tray widget or by choosing \"Restore\" from its " +"popup menu." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:140 +msgid "How the shares should be displayed" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:141 +msgid "" +"Choose the kind of view you prefer for displaying the mounted shares. There " +"is an icon view or a list view available." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:145 +msgid "Printer shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:149 +msgid "" +"Hidden shares will be displayed in the network browser. Hidden shares are " +"ending with a $ sign, e.g. Musik$ or IPC$." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:152 +msgid "Show hidden IPC$ shares" +msgstr "Mostrar recursos compartidos IPC$ ocultos" + +#: smb4k/core/smb4ksettings.cpp:153 +msgid "Hidden IPC$ shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:156 +msgid "Show hidden ADMIN$ shares" +msgstr "Mostrar recursos compartidos ADMIN$ ocultos" + +#: smb4k/core/smb4ksettings.cpp:157 +msgid "Hidden ADMIN$ shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:160 +msgid "Show the type of a share" +msgstr "Mostrar el tipo de los recursos compartidos" + +#: smb4k/core/smb4ksettings.cpp:161 +msgid "" +"The type of a share will be displayed in a separate column in the network " +"browser. It can either be Disk, Print or IPC." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:164 +msgid "Show the IP address of a server" +msgstr "Mostrar la dirección IP de los servidores" + +#: smb4k/core/smb4ksettings.cpp:165 +msgid "" +"The IP address of the server will be displayed in a separate column in the " +"network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:168 +msgid "Show the comment of a share" +msgstr "Mostrar el comentario de los recursos compartidos" + +#: smb4k/core/smb4ksettings.cpp:169 +msgid "" +"The comment describing the server or share will be displayed in a separate " +"column in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:172 +msgid "Show a tooltip with information about the network item" +msgstr "Mostrar información sobre el elemento de la red" + +#: smb4k/core/smb4ksettings.cpp:173 +msgid "The tooltip shows various information about the current network item." +msgstr "Se muestra información variada sobre el elemento de la red actual." + +#: smb4k/core/smb4ksettings.cpp:176 +msgid "Show the mount point of a share instead of its name" +msgstr "Mostrar el punto de montaje de los recursos en lugar del nombre" + +#: smb4k/core/smb4ksettings.cpp:177 +msgid "" +"A share is normally displayed with its name in the shares view. Choosing " +"this feature will cause the exchange of the share name by the mount point." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:181 +msgid "" +"You will not only see the shares that were mounted and are owned by you, but " +"also all other mounts using the SMBFS and CIFS file system that are present " +"on the system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:184 +msgid "Allow the dropping of files and directories onto share icons" +msgstr "Permitir soltar archivos y directorios en íconos de recursos compartidos" + +#: smb4k/core/smb4ksettings.cpp:185 +msgid "" +"This setting allows you to drop files or whole directories onto the share " +"icons, which will cause them to be copied." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:188 +msgid "Allow the dragging of share icons" +msgstr "Permitir arrastrar íconos de recursos compartidos" + +#: smb4k/core/smb4ksettings.cpp:189 +msgid "" +"This setting allows you to drag a share item out of Smb4K and onto the " +"desktop or into a file manager. Only enable it if you think you absolutely " +"need it and read the handbook before you mark this checkbox." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:192 +msgid "Show a tooltip with information about the share" +msgstr "Mostrar información sobre los recursos compartidos" + +#: smb4k/core/smb4ksettings.cpp:193 +msgid "The tooltip shows various information about the current share." +msgstr "Se muestra información variada sobre el recurso actual." + +#: smb4k/core/smb4ksettings.cpp:196 +msgid "Show hidden files and directories when previewing a share" +msgstr "Mostrar archivos ocultos y directorios al previsualizar recursos compartidos" + +#: smb4k/core/smb4ksettings.cpp:197 +msgid "" +"Display hidden files and directories in the preview dialog. The names of " +"hidden files and directories are beginning with a period and are usually " +"needed for very specific purposes (configuration file of an application, " +"etc.). Since they are not of any importance for your regular work, you " +"normally do not need to enable this feature." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:201 +msgid "" +"Show the UID and GID that own all files on the mounted file system. At the " +"moment the column will only contain an entry if the share was mounted with " +"the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:205 +msgid "" +"Show the login that was used to authenticate to the server. The column will " +"only contain an entry if the share was mounted with the CIFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:209 +msgid "Show the file system that was used for mounting the share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:213 +msgid "Show the free disk space that is left on the share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:217 +msgid "Show the disk space that is already used on the share." +msgstr "Mostrar el espacio en disco usado en el recurso compartido." + +#: smb4k/core/smb4ksettings.cpp:221 +msgid "Show the total disk space of the share." +msgstr "Mostrar el uso total de disco del recurso compartido." + +#: smb4k/core/smb4ksettings.cpp:225 +msgid "Show the space that is used on the share in percent." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:252 +msgid "Method how to retrieve the browse list" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:253 +msgid "" +"Choose the method how to compile the initial browse list. There are four " +"options available: The first one is the default one and employs \"nmblookup -" +"M -- -\" to discover all workgroups, domains, and their master browsers on " +"your network neighborhood. The second one instructs Smb4K to query the " +"current master browser of your workgroup or domain to retrieve the browse " +"list. The third is similar to the second one except that you can define the " +"master browser that should be queried. If you choose the last option, the " +"provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x." +"x -- '*'\"." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:256 +msgid "A custom master browser that is to be queried" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:257 +msgid "" +"Enter the name or IP address of a master browser here that should be queried " +"to compile the initial browse list." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:260 +msgid "A custom list of broadcast addresses" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:261 +msgid "" +"Enter a comma-separated list of broadcast addresses here (e.g. " +"192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the " +"respective broadcast areas." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:275 +msgid "Method for searching for remote hosts" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:276 +msgid "" +"Smb4K is able to search for remote hosts either using nmblookup or " +"smbclient. The nmblookup method is very reliable and works well. However, if " +"your network is configured uncommonly and you experience problems when " +"searching, you should try the smbclient method. But please note that you " +"lose the ability to search for IP addresses in that case." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:282 +msgid "The mount prefix" +msgstr "El prefijo de montaje" + +#: smb4k/core/smb4ksettings.cpp:283 +msgid "" +"This is the prefix where Smb4K will create the mount points and mount the " +"remote shares." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:286 +msgid "Force the subdirectories created by Smb4K to be lowercase" +msgstr "Forzar que los subdirectorios sean creados en minúsculas" + +#: smb4k/core/smb4ksettings.cpp:287 +msgid "" +"All names of the subdirectories created by Smb4K below the mount prefix will " +"be lowercase." +msgstr "Todos los nombres de los subdirectorios creados bajo el prefijo de punto de montaje serán en minúsculas." + +#: smb4k/core/smb4ksettings.cpp:290 +#, fuzzy +msgid "Unmount the shares owned by the user on exit" +msgstr "Desmontar todos los recursos compartidos de %1 al salir" + +#: smb4k/core/smb4ksettings.cpp:291 +#, fuzzy +msgid "Unmount all shares that belong to you when the program exits." +msgstr "Desmontar todos los recursos compartidos de %1 al salir" + +#: smb4k/core/smb4ksettings.cpp:294 +#, fuzzy +msgid "Remount shares" +msgstr "Recursos compartidos remotos" + +#: smb4k/core/smb4ksettings.cpp:295 +msgid "" +"Remount all your shares that were still mounted when you exited the program. " +"Shares that were mounted by other users are ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:298 +#, fuzzy +msgid "Allow the unmounting of shares owned by other users" +msgstr "" +"Permitir el desmontaje de recursos compartidos pertenecientes a otros " +"usuarios" + +#: smb4k/core/smb4ksettings.cpp:299 +msgid "" +"Allow the unmounting of shares that were mounted by other users. In most " +"cases you need super user privileges for this. Please think before you " +"enable this option!" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:304 +msgid "Interval between checks for new and inaccessible shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:305 +msgid "" +"This is the time that elapses until Smb4K checks again for new mounts and " +"unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note " +"that the smaller the interval gets the higher is your system load." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:311 +#, fuzzy +msgid "Use a wallet to store authentication data" +msgstr "Por favor, ingrese la información de autenticación para %1." + +#: smb4k/core/smb4ksettings.cpp:312 +msgid "" +"Use a wallet to store the authentication data. The login name and the " +"password name are stored encrypted on your hard drive. If this setting is " +"disabled, the authentication data is not stored permanently but only " +"temporarily." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:315 +msgid "Remember passwords if no wallet is used" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:316 +msgid "" +"If you decided to store the login names and passwords only temporarily, " +"Smb4K will remember them until the program exits. If you disable this " +"setting, you will have to provide the authentication data everytime it is " +"needed." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:319 +#, fuzzy +msgid "Use a default login" +msgstr "Usar el usuario predeterminado" + +#: smb4k/core/smb4ksettings.cpp:320 +msgid "" +"Enable the usage of a default login name and password. The authentication " +"data provided below is then used by default to authenticate to a remote " +"server. This is very useful e.g. if you are working in an Active Directory " +"environment or an NT domain." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:326 +msgid "The NetBIOS name of this computer" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:327 +msgid "" +"This is the NetBIOS name of this computer that is used by Smb4K. By default, " +"it is either the NetBIOS name that is defined in the smb.conf file or the " +"host name." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:330 +msgid "The name of the workgroup/domain this computer is in" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:331 +msgid "" +"This is the workgroup or domain this computer is or should be in. By " +"default, it is the workgroup that is defined in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:334 +#, fuzzy +msgid "The socket options" +msgstr "Opciones de socket:" + +#: smb4k/core/smb4ksettings.cpp:335 +msgid "" +"These are the TCP socket options that are used by nmblookup, smbmount and " +"smbclient. Socket options are controls on the networking layer of the " +"operating systems which allow the connection to be tuned. See the manual " +"page of smb.conf for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:338 +#, fuzzy +msgid "The NetBIOS scope" +msgstr "Nombre NetBIOS:" + +#: smb4k/core/smb4ksettings.cpp:339 +msgid "" +"This sets the NetBIOS scope that nmblookup, smbmount and smbclient will " +"operate under. It should not be set unless every machine on your network " +"neighborhood sets this value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:344 +#, fuzzy +msgid "The remote SMB port" +msgstr "Puerto SMB remoto:" + +#: smb4k/core/smb4ksettings.cpp:345 +msgid "" +"This is the port that is to be used for connecting to remote servers. Please " +"note that this is independent of the settings in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:348 +msgid "Use Kerberos for authentication" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:349 +msgid "" +"Try to authenticate with Kerberos. This is only useful in an Active " +"Directory environment. The setting affects the smbmount and smbclient " +"command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:352 +#, fuzzy +msgid "Use machine account for login" +msgstr "Usar el usuario predeterminado" + +#: smb4k/core/smb4ksettings.cpp:353 +msgid "" +"Make queries to the remote server using the machine account of the local " +"server. The setting affects the net and the smbclient command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:367 +msgid "The file system that is used for mounting remote shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:368 +msgid "" +"This is the file system that will be used to mount the remote shares. The " +"Common Internet File System (CIFS) is supported by Windows 2000 and above as " +"well as by Samba. It offers many improvements and advancements compared to " +"the Server Message Block File System (SMBFS) which is used by Windows 9x and " +"below." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:487 +msgid "The charset used by the client" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:488 +msgid "" +"This is the charset that is used by the client side (i.e. your side) either " +"to convert local path names to and from Unicode in case of the CIFS file " +"system or for codepage to charset translations (NLS) in case of the SMBFS " +"file system. If you keep the default setting, Smb4K will try to " +"automatically determine the charset by looking up the \"unix charset\" " +"option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:657 +msgid "The codepage used by the server" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:658 +msgid "" +"This is the codepage that is used by the server. The setting is only " +"available with the SMBFS file system. If you keep the default setting, Smb4K " +"will try to automatically determine the codepage by looking up the \"dos " +"charset\" option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:661 +msgid "The user ID that is to be used for mounting" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:662 +msgid "" +"Here you can enter the user ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:665 +msgid "The group ID that is to be used for mounting" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:666 +msgid "" +"Here you can enter the group ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:669 +msgid "The file mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:670 +msgid "" +"This is the mask that will be used for creating files. It must be defined in " +"octal. In case the CIFS file system is used, this setting only takes effect " +"if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:673 +msgid "The directory mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:674 +msgid "" +"This is the mask that will be used for creating directories. It must be " +"defined in octal. In case the CIFS file system is used, this setting only " +"takes effect if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:688 +msgid "The write access granted for the share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:689 +msgid "" +"Here you can choose if the shares should be mounted in read and write mode " +"or only read-only." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:693 +msgid "" +"The client side (i.e. your side) will check if you have the right UID/GID to " +"manipulate a file or directory. You might want to switch this feature off if " +"the server(s) support the CIFS Unix Extensions and you are not allowed to " +"access the files and directories. This setting does not affect the normal " +"ACL check." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:696 +msgid "Set UID and GID" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:697 +msgid "" +"In case the server supports the CIFS Unix Extensions, the client side (i.e. " +"your side) attempts to set the effective UID and GID of the current process " +"on newly created files, directories and devices. If this feature is turned " +"off, the default UID and GID defined for the share will be used. It is " +"recommended that you read the manual page of mount.cifs before you change " +"this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:701 +msgid "" +"Use inode numbers (unique persistent file identifiers) returned by the " +"server instead of automatically generating temporary inode numbers on the " +"client side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:705 +msgid "" +"Directly read from and write to files opened on the share. In some cases " +"this can provide better performance than the default behavior which caches " +"reads and writes." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:709 +msgid "" +"Translate six of the seven reserved characters (including the colon, " +"question mark, pipe, asterisk, greater than and less than characters but not " +"the backslash) to remap range (above 0xF000). This allows you to open files " +"that were created with such characters. This has no effect if the server " +"does not support Unicode." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:713 +msgid "Do not use locking. Do not start lockd." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:716 +msgid "Advanced custom options for the CIFS file system" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:717 +msgid "" +"Here you can enter advanced options for the CIFS file system in a comma-" +"separated list (refer to the manual page of mount.cifs to learn more). The " +"list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not " +"enter options that have already been defined in the configuration dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:720 +msgid "Determines how long directory listings are cached" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:721 +msgid "" +"This setting determines how long a directory listing is cached in " +"milliseconds. A high value means it takes longer until changes on the server " +"are noticed on the client side (i.e. your side), but it can also give you an " +"increase in performance on large directories, especially on long distances. " +"You need Linux kernel 2.4.2 or later to take advantage of this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:724 +msgid "Unicode support" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:725 +msgid "" +"Use Unicode when communicating with the server. This will give you better " +"support for non-ASCII character sets with the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:728 +#, fuzzy +msgid "Long file support" +msgstr "Utilizar el soporte para grandes sistemas de archivos" + +#: smb4k/core/smb4ksettings.cpp:729 +msgid "" +"Large file support (LFS) enables you to read and write \n" +"files bigger than 2 GB on shares that were mounted with the SMBFS file " +"system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:754 +msgid "The protocol that is used with the net command" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:755 +msgid "" +"Here you can choose the protocol that will be used by the net command for " +"the communication with remote servers if appropriate. In most cases the " +"automatic detection will work fine and you should not need to change the " +"default setting. However, if you experience problems, use the RPC protocol " +"for newer operating systems (Windows NT4 and above) and the RAP protocol for " +"older ones (Windows 98/NT3 and below). Functions that need the ADS protocol " +"(for Active Directory environments) have not been implemented yet, so you " +"can ignore that one for now." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:758 +msgid "Name resolve order used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:759 +msgid "" +"This option is used to determine what naming services and in what order are " +"used to resolve host names and IP addresses. It takes a space-separated list " +"of up to four different name resolution options. Those are: lmhost, host, " +"wins, bcast. See the manual page of smbclient for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:763 +msgid "Transmit/send buffer size used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:764 +msgid "" +"This option changes the transmit/send buffer size when getting or putting a " +"file from/to the server. The default is 65520 bytes. Setting this value " +"smaller has been observed to speed up file transfers to and from Windows 9x " +"servers." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:788 +msgid "Signing state" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:789 +msgid "Set the signing state for smbclient." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:792 +msgid "The broadcast address used by nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:793 +msgid "" +"Queries performed with nmblookup will be send to the given broadcast " +"address. Without this option the default behavior is to send the queries to " +"the broadcast address of the network interface that was either auto-detected " +"or defined in the \"interfaces\" parameter of the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:796 +msgid "Use UDP port 137 with nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:797 +msgid "" +"Try and bind to UDP port 137 to send and receive UDP datagrams. The reason " +"for this option is a bug in Windows 95 where it ignores the source port of " +"the requesting packet and only replies to UDP port 137. Unfortunately, on " +"most Unix systems super user privileges are needed to bind to this port. " +"Please read the manual page of nmblookup for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:803 +#, fuzzy +msgid "Prefix for synchronization" +msgstr "Destino predeterminado" + +#: smb4k/core/smb4ksettings.cpp:804 +msgid "" +"This is the path where Smb4K will store the files and directories during " +"synchronization. If you plan to synchronize only with one remote share, then " +"you can put the data directly in this directory. If you want to synchronize " +"with several remote shares, then you should create a subdirectory for each " +"share and choose the appropriate one in the synchronization dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:807 +#, fuzzy +msgid "Use archive mode" +msgstr "Modo archivar" + +#: smb4k/core/smb4ksettings.cpp:808 +msgid "Use archive mode (-a, --archive). This is a short form of -rlptgoD." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:811 +#, fuzzy +msgid "Recurse into subdirectories" +msgstr "Entrar recursivamente en directorios" + +#: smb4k/core/smb4ksettings.cpp:812 +#, fuzzy +msgid "Recurse into directories (-r, --recursive)." +msgstr "Entrar recursivamente en directorios" + +#: smb4k/core/smb4ksettings.cpp:815 +#, fuzzy +msgid "Skip files that are newer in the target directory" +msgstr "Saltear archivos más nuevos en el directorio destino" + +#: smb4k/core/smb4ksettings.cpp:816 +msgid "" +"Update files in the destination directory that are older than in the source " +"directory (-u, --update)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:820 +msgid "" +"Update destination files in-place (--inplace). By default, rsync first " +"creates a new copy of a file and moves it into place after its transfer " +"finished. If you enable this feature, no copy will be created but the " +"destination file will immediately be overwritten instead. An exception to " +"this is if you combine this option with --backup." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:824 +msgid "" +"Use relative paths (-R, --relative). This means that the full path names " +"specified on the command line are sent to the server rather than just the " +"last parts of the file names." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:827 +#, fuzzy +msgid "Don't send implied directories with --relative" +msgstr "No enviar directorios implicados con -R" + +#: smb4k/core/smb4ksettings.cpp:828 +msgid "" +"Don't send implied directories with --relative (--no-implied-dirs). This " +"means that the corresponding path elements on the destination system are " +"left unchanged if they exist, and any missing implied directories are " +"created with default attributes. This even allows these implied path " +"elements to have big differences, such as being a symlink to a directory on " +"one side of the transfer, and a real directory on the other side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:832 +msgid "" +"Transfer directories without recursing (-d, --dirs). This means that all top-" +"level subdirectories are transferred but without their contents." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:836 +msgid "" +"Compress data during transfer (-z, --compress). This significantly reduces " +"the amount of data that is being transferred. You may want to use this " +"option, if you have a slow connection." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:840 +msgid "Copy symlinks as symlinks (-l, --links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:844 +msgid "Transform symlinks into the items they are pointing to (-L, --copy-links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:848 +msgid "" +"Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-" +"links). This means that only those symlinks are transformed that point to " +"items that are outside the copied tree. Absolute symlinks are treated the " +"same way. This option has no additional effect if --copy-links has also been " +"specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:852 +msgid "" +"Ignore symlinks that point outside the copied tree (--safe-links). All " +"absolute symlinks are also ignored. If you use this option in conjunction " +"with --relative you might get unexpected results." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:856 +msgid "" +"Preserve hard links (-H, --hard-links). This options causes rsync to " +"preserve the hard links that are found during the transfer. Without it, hard " +"links are treated as though they were separate files." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:860 +msgid "" +"Treat symlinked directories on the receiving side as though they were real " +"ones (-K, --keep-dirlinks). This only works if the symlink matches a real " +"directory from the sending side. Without this option, the receiver's symlink " +"will be deleted and replaced with a real directory." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:864 +msgid "" +"Preserve permissions (-p, --perms). The permissions of the destination file " +"will be same as the source file. For what happens if this option is switched " +"off, please read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:868 +msgid "" +"Preserve the group (-g, --group). The group of the destination file will be " +"set to the same value as the source file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:871 +#, fuzzy +msgid "Preserve owner (super user only)" +msgstr "Preservar dueño (sólo root)" + +#: smb4k/core/smb4ksettings.cpp:872 +msgid "" +"Preserve the owner (-o, --owner). The owner of the destination file will be " +"set to the same value as the source file, but only if the receiving rsync is " +"run as the super user. Without this option, the owner is set to the invoking " +"user on the receiving side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:876 +msgid "" +"Preserve device and special files (-D, --devices --specials). This option " +"causes rsync to transfer character and block devices as well as special " +"files such as named sockets and fifos. It works only partially if rsync is " +"not run as super user and the --super option is not specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:880 +msgid "" +"Preserve times (-t, --times). The modification times are transferred along " +"with the files. For what happens if this option is switched off, please read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:884 +msgid "" +"Omit directories when preserving times (-O, --omit-dir-times). This means " +"that directories are omitted when modification times are being preserved. " +"Thus, this feature only works in conjunction with --times." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:888 +msgid "" +"Remove all synchronized source files (--remove-source-files). This tells " +"rsync to remove from the sending side the non-directory items that are a " +"part of the transfer and have been successfully duplicated on the receiving " +"side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:892 +msgid "" +"Delete extraneous files from destination (--delete). This tells rsync to " +"delete all files from the receiving side that are not present on the sending " +"side, but only for the directories that are being synchronized." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:896 +msgid "" +"Delete files on the receiving side before the transfer starts (--delete-" +"before). This is the default behavior if --delete or --delete-excluded is " +"specified without one of the --delete-WHEN options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:900 +msgid "" +"Delete files on the receiving side after the transfer has completed (--" +"delete-after, --del)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:904 +msgid "" +"Delete files on the receiving side during the transfer (--delete-during). " +"This method is faster than --delete-before or --delete-after, but it is only " +"supported with rsync 2.6.4 or later." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:907 +#, fuzzy +msgid "Also delete excluded files from destination directory" +msgstr "Eliminar también los archivos excluídos en el destino" + +#: smb4k/core/smb4ksettings.cpp:908 +msgid "" +"Also delete excluded files from destination directory (--delete-excluded). " +"In addition to deleting the files on the receiving side that are not on the " +"sending side, this tells rsync to also delete any files on the receiving " +"side that are excluded. Refer to rsync's manual page for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:912 +msgid "" +"Delete even if I/O errors occur (--ignore-errors). This option has to be " +"specified in conjunction with --delete to take effect." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:916 +msgid "" +"Force deletion of directories even if they are not empty (--force). This " +"option tells rsync to delete a non-empty directory when it is to be replaced " +"by a non-directory. This is only relevant if deletions are not active." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:919 +msgid "Only delete a maximum number of files" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:920 +msgid "" +"Only delete as many files as defined here (--max-delete=NUM). This tells " +"rsync not to delete more than NUM files or directories (NUM must be non-" +"zero). This is useful when mirroring very large trees to prevent disasters." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:924 +msgid "Value for DeleteMaximum config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:927 smb4k/core/smb4ksettings.cpp:935 +#, fuzzy +msgid "Don't transfer any file smaller than SIZE" +msgstr "No transferir ningún archivo de menos de" + +#: smb4k/core/smb4ksettings.cpp:928 +msgid "" +"This option causes rsync to not transfer any file that is smaller than the " +"specified size (--min-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:932 +msgid "Value for MinimalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:936 +msgid "" +"This option causes rsync to not transfer any file that is larger than the " +"specified size (--max-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:940 +msgid "Value for MamximalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:944 +msgid "" +"Keep partially transferred files (--partial). The default behavor is that " +"any partially transferred file is deleted if the transfer is interrupted." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:947 +#, fuzzy +msgid "The directory where to put a partially transferred file into." +msgstr "Poner los archivos parcialmente transferidos en" + +#: smb4k/core/smb4ksettings.cpp:948 +msgid "" +"Put a partially transferred file into this directory (--partial-dir=DIR). " +"This is a better way than the --partial option to keep partial files, " +"because the partially transferred file is kept in a different directory and " +"the destination file is not overwritten." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:951 +msgid "The data for the UsePartialDirectory option" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:955 +msgid "" +"Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a " +"useful shorthand for excluding a broad range of files that you often do not " +"want to transfer between systems. This option uses the same algorithm that " +"CVS uses to determine if a file should be ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:958 +#, fuzzy +msgid "Exclude files that match a certain pattern" +msgstr "Excluir archivos que concuerdan con este patrón:" + +#: smb4k/core/smb4ksettings.cpp:959 +msgid "" +"Exclude files that match a certain pattern (--exclude=PATTERN). This is a " +"special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:962 +msgid "Pattern that is used for file exclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:965 +#, fuzzy +msgid "Read exclude patterns from a file" +msgstr "Leer patrones de exclusión desde" + +#: smb4k/core/smb4ksettings.cpp:966 +msgid "" +"Read exclude patterns from a file (--exclude-from=FILE). This option is " +"similar to the --exclude=PATTERN option except that the exclude patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:969 +msgid "The file from which the exclude patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:972 +#, fuzzy +msgid "Do not exclude files matching a certain pattern" +msgstr "No excluir archivos que concuerdan con este patrón:" + +#: smb4k/core/smb4ksettings.cpp:973 +msgid "" +"Do not exclude files matching a certain pattern (--include=PATTERN). This is " +"a special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:976 +msgid "Pattern that is used for file inclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:979 +#, fuzzy +msgid "Read include patterns from a file" +msgstr "Leer patrones de inclusión desde" + +#: smb4k/core/smb4ksettings.cpp:980 +msgid "" +"Read include patterns from a file (--include-from=FILE). This option is " +"similar to the --include=PATTERN option except that the include patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:983 +msgid "The file from which the include patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:986 +msgid "Add custom file-filtering rules" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:987 +msgid "" +"Add custom file-filtering rules (-f, --filter=RULE). This option allows you " +"to add rules to selectively exclude certain files from the list of files to " +"be transferred." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:990 +#, fuzzy +msgid "Use -F filter rule" +msgstr "Reglas de filtrado" + +#: smb4k/core/smb4ksettings.cpp:991 +msgid "" +"This filter rule tells rsync to look for per-directory .rsync-filter files " +"that have been sprinkled through the hierarchy and use their rules to filter " +"the files in the transfer. It has no effect, if you also choose to use the --" +"filter='exclude .rsync-filter' rule." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:994 +#, fuzzy +msgid "Use -FF filter rule" +msgstr "Reglas de filtrado" + +#: smb4k/core/smb4ksettings.cpp:995 +msgid "" +"This rule filters out the .rsync-filter files from the transfer. These files " +"normally contain filter rules that can be activated by choosing the --" +"filter='dir-merge /.rsync-filter' rule and deselecting this one." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:999 +msgid "" +"Handle sparse files efficiently (-S, --sparse) so that they take up less " +"space on the destination. This option conflicts with --inplace. For further " +"information read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1003 +msgid "" +"Copy files whole (-W, --whole-file). With this option the incremental rsync " +"algorithm is not used and the whole file is sent as-is instead." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1006 +#, fuzzy +msgid "Do not cross file system boundaries" +msgstr "No cruzar límites del sistema de archivos" + +#: smb4k/core/smb4ksettings.cpp:1007 +msgid "" +"Do not cross file system boundaries (-x, --one-file-system). This tells " +"rsync to avoid crossing a filesystem boundary when recursing. For further " +"information on this option, read the manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1010 +msgid "Skip creating new files on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1011 +msgid "" +"Skip creating new files on the receiving side (--existing). This tells rsync " +"to skip creating files (including directories) that do not exist yet on the " +"destination. If this option is combined with the --ignore-existing option, " +"no files will be updated (which can be useful if all you want to do is to " +"delete extraneous files)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1014 +msgid "Skip updating files that exist on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1015 +msgid "" +"Skip updating files that already exist on the receiving side (--ignore-" +"existing). Existing directories are not ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1018 +#, fuzzy +msgid "Delay updates until the end of the transfer" +msgstr "Eliminar archivos en el destino después de tranferir" + +#: smb4k/core/smb4ksettings.cpp:1019 +msgid "" +"Delay updates until the end of the transfer (--delay-updates). This option " +"puts the temporary file from each updated file into a holding directory " +"until the end of the transfer, at which time all the files are renamed and " +"copied into place in rapid succession." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1023 +msgid "" +"Make backups (-b, --backup). With this option, preexisting destination files " +"are renamed as each file is transferred or deleted. You can control where " +"the backup file goes and what (if any) suffix gets appended using the --" +"backup-dir=DIR and --suffix=SUFFIX options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1026 +msgid "Use a suffix for backups" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1027 +msgid "Use this suffix for backups (--suffix=SUFFIX)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1030 +#, fuzzy +msgid "Backup suffix" +msgstr "Sufijo de respaldo:" + +#: smb4k/core/smb4ksettings.cpp:1033 +msgid "Put backups into a certain directory" +msgstr "Poner las copias de respaldo en un directorio" + +#: smb4k/core/smb4ksettings.cpp:1034 +msgid "Store backups in this directory (--backup-dir=DIR)." +msgstr "Guardar las copias de respaldo en este directorio (--backup-dir=DIR)." + +#: smb4k/core/smb4ksettings.cpp:1037 +#, fuzzy +msgid "Backup directory" +msgstr "Directorio de respaldo:" + +#: smb4k/core/smb4ksettings.cpp:1040 +#, fuzzy +msgid "Force a fixed checksum block-size" +msgstr "Forzar tamaño fijo de bloque de verificación:" + +#: smb4k/core/smb4ksettings.cpp:1041 +msgid "" +"Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the " +"block size used in the rsync algorithm to a fixed value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1045 +msgid "The block size" +msgstr "El tamaño de bloque" + +#: smb4k/core/smb4ksettings.cpp:1048 +#, fuzzy +msgid "Set block/file checksum seed" +msgstr "Fijar semilla de verificación de bloque/archivo:" + +#: smb4k/core/smb4ksettings.cpp:1049 +msgid "" +"Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum " +"seed to this integer. This 4 byte checksum seed is included in each block " +"and file MD4 checksum calculation. By default the checksum seed is generated " +"by the server and defaults to the current time." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1053 +#, fuzzy +msgid "The checksum seed" +msgstr "Fijar semilla de verificación de bloque/archivo:" + +#: smb4k/core/smb4ksettings.cpp:1056 +#, fuzzy +msgid "Skip files based on a checksum" +msgstr "Saltear basado en la verificación" + +#: smb4k/core/smb4ksettings.cpp:1057 +msgid "" +"Skip files based on a checksum and not based on modification time and size (-" +"c, --checksum). For further information on how this feature works read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1074 +#, fuzzy +msgid "The program that should be used to gain super user privileges" +msgstr "Usar el siguiente programa para obtener permisos de superusuario:" + +#: smb4k/core/smb4ksettings.cpp:1075 +msgid "" +"Choose the program that will grant you limited super user privileges for " +"mounting and unmounting remote shares. You can either select sudo, the " +"standard tool for this purpose on most distributions, or super." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1078 +#, fuzzy +msgid "Use super user privileges to unmount inaccessible shares" +msgstr "" +"Utilizar los permisos de superusuario para montar y desmontar recursos " +"compartidos" + +#: smb4k/core/smb4ksettings.cpp:1079 +msgid "" +"Unmount a share under Linux by force. This even works if the file system is " +"\"busy\", because it is immediately detached from the file system hierarchy " +"and all references to it are cleaned up later when it is not busy anymore. " +"Linux kernel 2.4.11 or later is needed to take advantage of this feature. " +"Use with case! Note, that you will need the root password to write the " +"necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1083 +msgid "" +"Use super user privileges for mounting and unmounting remote shares. This " +"feature is only needed, if you are not allowed to use smbmount, smbumount, " +"mount.cifs and umount.cifs as normal user. Note, that you will need the root " +"password to write the necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:42 +msgid "" +"The browse list could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"La lista de navegación no ha podido ser recuperada.
No se puede proveer " +"información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:46 +#, fuzzy +msgid "" +"The browse list could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La lista de navegación no ha podido ser recuperada.
Lea el mensaje de " +"error que aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:55 +msgid "" +"The list of servers could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"La lista de servidores no ha podido ser recuperada.
No se puede proveer " +"información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:59 +#, fuzzy +msgid "" +"The list of servers could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La lista de servidores no ha podido ser recuperada.
Lea el mensaje de " +"error que aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:68 +msgid "" +"The list of shares could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"La lista de recursos compartidos no ha podido ser recuperada.
No se " +"puede proveer información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:72 +#, fuzzy +msgid "" +"The list of shares could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La lista de recursos compartidos no ha podido ser recuperada.
Lea el " +"mensaje de error que aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:81 +msgid "" +"The preview could not be compiled.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"La vista previa no pudo ser compilada.
No se puede proveer información " +"detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:85 +#, fuzzy +msgid "" +"The preview could not be compiled.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La vista previa no pudo ser compilada.
Lea el mensaje de error que " +"aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:92 +#, fuzzy +msgid "" +"The wallet \"%1\" could not be opened. KWallet support will be disabled for " +"this session." +msgstr "" +"La cartera '%1' no pudo ser abierta. El soporte para KWallet será " +"deshabilitado." + +#: smb4k/core/smb4kerror.cpp:100 +msgid "" +"Some file permissions could not be determined.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Los permisos de algunos archivos no pudieron ser determinados.
No se " +"puede proveer información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:104 +#, fuzzy +msgid "" +"Some file permissions could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Los permisos de algunos archivos no pudieron ser determinados.
Lea el " +"mensaje de error que aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:111 +msgid "" +"You are not allowed to unmount this share, because it is owned by another " +"user." +msgstr "" +"No tiene permisos para desmontar este recurso compartido, porque es " +"propiedad de otro usuario." + +#: smb4k/core/smb4kerror.cpp:119 +#, fuzzy +msgid "" +"The share \"%1\" could not be mounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"El recurso compartido '%1' no pudo ser montado.
No se puede proveer " +"información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:123 +#, fuzzy +msgid "" +"The share \"%1\" could not be mounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El recurso compartido '%1' no pudo ser montado.
Lea el mensaje de error " +"que aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:132 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"El recurso compartido '%1' no pudo ser desmontado.
No se puede proveer " +"información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:136 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El recurso '%1' no pudo ser desmontado.
Lea el mensaje de error que " +"aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:143 +#, fuzzy +msgid "The file \"%1\" could not be found." +msgstr "El archivo %1 no pudo ser encontrado." + +#: smb4k/core/smb4kerror.cpp:151 +#, fuzzy +msgid "The file \"%1\" could not be read." +msgstr "El archivo %1 no pudo ser leído." + +#: smb4k/core/smb4kerror.cpp:155 +#, fuzzy +msgid "" +"The file \"%1\" could not be read.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El archivo '%1' no pudo ser impreso.
Lea el mensaje de error que aparece " +"debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:164 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"El nombre de su computadora no pudo ser determinado usando la llamada al " +"sistema gethostname().
No se puede proveer información detallada porque " +"no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:168 +#, fuzzy +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El nombre de su computadora no pudo ser determinado usando la llamada al " +"sistema gethostname().
Lea el mensaje de error que aparece debajo en " +"'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:175 +msgid "" +"Either your PATH environment variable is not set properly or there are the " +"following programs missing on your system:\n" +"%1\n" +"Please correct this and restart Smb4K." +msgstr "" +"Su variable PATH no está definida correctamente, o falta en su sistema " +"alguno de los siguientes programas:
%1
Por favor, corrija esto y " +"reinicie Smb4K." + +#: smb4k/core/smb4kerror.cpp:181 +#, fuzzy +msgid "" +"The file \"%1\" is currently being edited by user %2. To avoid any problems, " +"access to this file is denied at the moment. Please try again later." +msgstr "" +"El archivo %1 está siendo editado por el usuario %2. Para evitar problemas, " +"el acceso a este archivo es negado por el momento. Por favor, inténtelo " +"nuevamente más tarde." + +#: smb4k/core/smb4kerror.cpp:187 +#, fuzzy +msgid "The directory \"%1\" could not be created." +msgstr "El directorio '%1' no pudo ser creado." + +#: smb4k/core/smb4kerror.cpp:193 +#, fuzzy +msgid "The file \"%1\" could not be written." +msgstr "El archivo '%1' no pudo ser escrito." + +#: smb4k/core/smb4kerror.cpp:199 +#, fuzzy +msgid "The share could not be unmounted, because the mount point string was empty." +msgstr "" +"No se ha podido desmontar este recurso compartido porque la cadena de punto " +"de montaje está vacía." + +#: smb4k/core/smb4kerror.cpp:205 +msgid "This feature has not been enabled." +msgstr "Esta funcionalidad no ha sido habilitada." + +#: smb4k/core/smb4kerror.cpp:211 +msgid "Printers cannot be bookmarked." +msgstr "Las impresoras no se pueden añadir a favoritos." + +#: smb4k/core/smb4kerror.cpp:217 +msgid "" +"IP addresses are not supported with this search method. Please choose \"Use " +"nmblookup\" in the configuration dialog and try again." +msgstr "" +"No pueden usarse direcciones IP en este método de búsqueda. Por favor, elija " +"\"Utilizar nmblookup\" en la ventana de configuración e inténtelo de nuevo." + +#: smb4k/core/smb4kerror.cpp:225 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"La lista de recursos montados SMBFS y CIFS no pudo ser importada.
No se " +"puede proveer información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:229 +#, fuzzy +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La lista de recursos montados SMBFS y CIFS no pudo ser importada.
Lea " +"el mensaje de error que aparece debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:236 +#, fuzzy +msgid "The command \"%1\" could not be found." +msgstr "No se ha encontrado el comando '%1'." + +#: smb4k/core/smb4kerror.cpp:244 +#, fuzzy +msgid "" +"The file \"%1\" could not be printed.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"El archivo '%1' no pudo ser impreso.
No se puede proveer información " +"detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:248 +#, fuzzy +msgid "" +"The file \"%1\" could not be printed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El archivo '%1' no pudo ser impreso.
Lea el mensaje de error que aparece " +"debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:257 +#, fuzzy +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"El directorio temporal '%1' no pudo ser creado.
No se puede proveer " +"información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:261 +#, fuzzy +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El directorio temporal '%1' no pudo ser creado.
Lea el mensaje de error " +"que aparece debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:270 +#, fuzzy +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"El archivo temporal '%1' no pudo ser creado.
No se puede proveer " +"información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:274 +#, fuzzy +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El archivo temporal '%1' no pudo ser creado.
Lea el mensaje de error que " +"aparece debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:281 +#, fuzzy +msgid "The directory \"%1\" could not be found." +msgstr "El directorio '%1' no pudo ser encontrado." + +#: smb4k/core/smb4kerror.cpp:287 +msgid "" +"The file \"%1\" is irregular. That means it is either a symlink, a fifo, or " +"something similar. This could indicate that someone is trying to exploit " +"your system. Please inform your system administrator." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:295 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"La sincronización no se pudo llevar a cabo exitosamente.
No se puede " +"proveer información detallada porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:299 +#, fuzzy +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La sincronización no se pudo llevar a cabo exitosamente.
Lea el mensaje " +"de error que aparece debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:308 +#, fuzzy +msgid "The file \"%1\" could not be opened." +msgstr "El archivo '%1' no pudo ser abierto." + +#: smb4k/core/smb4kerror.cpp:312 +#, fuzzy +msgid "" +"The file \"%1\" could not be opened.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El archivo '%1' no pudo ser impreso.
Lea el mensaje de error que aparece " +"debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:321 +#, fuzzy +msgid "The file \"%1\" could not be closed." +msgstr "El archivo '%1' no pudo ser abierto." + +#: smb4k/core/smb4kerror.cpp:325 +#, fuzzy +msgid "" +"The file \"%1\" could not be closed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"El archivo '%1' no pudo ser impreso.
Lea el mensaje de error que aparece " +"debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:332 +#, fuzzy +msgid "" +"The list of arguments for the \"net\" command could not be assembled.\n" +"At the moment it reads: %1" +msgstr "" +"La lista de argumentos para el comando 'net' no pudo ser reunida.
Al " +"momento la lista es: %1" + +#: smb4k/core/smb4kerror.cpp:340 +msgid "The list of supplementary group IDs could not be determined." +msgstr "La lista de IDs de grupos adicionales no ha podido ser determinada." + +#: smb4k/core/smb4kerror.cpp:344 +#, fuzzy +msgid "" +"The list of supplementary group IDs could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"La lista de servidores no ha podido ser recuperada.
Lea el mensaje de " +"error que aparece debajo en 'Detalles' para más información." + +#: smb4k/core/smb4kerror.cpp:354 +msgid "" +"An unknown error occurred.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Ocurrió un error desconocido.
No se puede proveer información detallada " +"porque no hubo mensaje de error." + +#: smb4k/core/smb4kerror.cpp:358 +#, fuzzy +msgid "" +"An unknown error occurred.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Ocurrió un error desconocido.
Lea el mensaje de error que aparece " +"debajo en 'Detalles' para más información. " + +#: smb4k/core/smb4kerror.cpp:385 +#, fuzzy +msgid "" +"The mimetype \"%1\" is not supported. Please convert the file to PostScript " +"or PDF." +msgstr "" +"El tipo MIME '%1' no puede utilizarse. Por favor, convierta este archivo a " +"PostScript o PDF." + +#: smb4k/core/smb4kerror.cpp:391 +#, fuzzy +msgid "" +"You previously chose to use \"%1\", but now it is missing on your system. " +"Smb4K will disable this feature." +msgstr "" +"Anteriormente eligió usar el programa '%1', pero ya no está presente en su " +"sistema. Smb4K deshabilitará esta funcionalidad." + +#: smb4k/core/smb4kerror.cpp:397 +msgid "" +"The label \"%1\" is used more than once. It will automatically be renamed " +"for bookmark \"%2\" to avoid confusion." +msgstr "" + +#: smb4k/core/smb4kpasswordhandler.cpp:258 +msgid "The access was denied. " +msgstr "El acceso fué denegado. " + +#: smb4k/core/smb4kpasswordhandler.cpp:261 +msgid "The password is not correct. " +msgstr "La contraseña es incorrecta. " + +#: smb4k/core/smb4kpasswordhandler.cpp:264 +msgid "The permission was denied. " +msgstr "El permiso fué denegado. " + +#: smb4k/core/smb4kpasswordhandler.cpp:267 +msgid "An authentication error occurred. " +msgstr "Se ha producido un error de autenticación." + +#: smb4k/core/smb4kpasswordhandler.cpp:270 +msgid "The logon failed. " +msgstr "El acceso ha fallado. " + +#: smb4k/core/smb4kpasswordhandler.cpp:278 +msgid "Please enter authentication data for server %1." +msgstr "Por favor, ingrese la información de autenticación para el servidor %1." + +#: smb4k/core/smb4kpasswordhandler.cpp:282 +msgid "Please enter authentication data for share %1." +msgstr "Por favor, ingrese la información de autenticación para el recurso %1." + +#: smb4k/core/smb4knetworkitems.cpp:202 +msgid "Disk" +msgstr "Disco" + +#: smb4k/core/smb4knetworkitems.cpp:206 smb4k/dialogs/smb4kprintdialog.cpp:71 +msgid "Printer" +msgstr "Impresora" + +#: smb4k/core/smb4khomesshareshandler.cpp:73 +msgid "Specify User" +msgstr "Especificar usuario" + +#: smb4k/core/smb4khomesshareshandler.cpp:74 +msgid "Clear List" +msgstr "Limpiar lista" + +#: smb4k/core/smb4khomesshareshandler.cpp:87 +msgid "Please specify a user name." +msgstr "Por favor especifique un nombre de usuario." + +#: smb4k/listview/smb4kshareslistview.cpp:52 +msgid "Owner" +msgstr "Dueño" + +#: smb4k/listview/smb4kshareslistview.cpp:54 +msgid "Login" +msgstr "Login" + +#: smb4k/listview/smb4kshareslistview.cpp:57 +msgid "Free" +msgstr "Libre" + +#: smb4k/listview/smb4kshareslistview.cpp:58 +msgid "Used" +msgstr "Usado" + +#: smb4k/listview/smb4kshareslistview.cpp:59 +msgid "Total" +msgstr "Total" + +#: smb4k/listview/smb4kshareslistview.cpp:60 +msgid "Usage" +msgstr "Uso" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:122 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:122 +msgid "Mount point:" +msgstr "Punto de montaje:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:211 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:211 +msgid "Free:" +msgstr "Libre:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:215 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:215 +msgid "Used:" +msgstr "Utilizado:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:219 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:219 +msgid "Total:" +msgstr "Total:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:223 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:223 +msgid "Usage:" +msgstr "Uso:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:229 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:388 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:229 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:388 +msgid "This share is inaccessible." +msgstr "El recurso compartido es inaccesible." + +#: smb4k/listview/smb4kshareslistview_part.cpp:115 +#: smb4k/smb4ksystemtray.cpp:794 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:112 +msgid "&Force Unmounting" +msgstr "&Forzar desmontado" + +#: smb4k/listview/smb4kshareslistview_part.cpp:119 +#: smb4k/smb4ksystemtray.cpp:446 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:116 +msgid "U&nmount All" +msgstr "Desmo&ntar todo" + +#: smb4k/listview/smb4kshareslistview_part.cpp:122 +#: smb4k/smb4ksystemtray.cpp:799 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:119 +msgid "S&ynchronize" +msgstr "S&incronizar" + +#: smb4k/listview/smb4kshareslistview_part.cpp:125 +#: smb4k/smb4ksystemtray.cpp:804 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:122 +msgid "Open with Konso&le" +msgstr "Abrir con &Konsole" + +#: smb4k/listview/smb4kshareslistview_part.cpp:128 +#: smb4k/smb4ksystemtray.cpp:809 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:125 +msgid "Open with &Konqueror" +msgstr "Abrir con K&onqueror" + +#: smb4k/listview/smb4kshareslistview_part.cpp:676 +msgid "Smb4KSharesListViewPart" +msgstr "Smb4KSharesListViewPart" + +#: smb4k/searchdlg/smb4ksearchdialog_part.cpp:254 +msgid "Smb4KSearchDialogPart" +msgstr "Smb4KSearchDialogPart" + +#: smb4k/searchdlg/smb4ksearchdialogitem.cpp:80 +msgid "The search failed." +msgstr "La búsqueda ha fallado." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:52 +msgid "Enter the search string here." +msgstr "Introduzca la cadena a buscar." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:57 plugin/smb4k_konqplugin.cpp:71 +msgid "Search" +msgstr "Buscar" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:63 +msgid "Search Results" +msgstr "Resultados de la búsqueda" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize" +msgstr "Sincronizar" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize the destination with the source" +msgstr "Sincronizar el destino con la fuente" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap Paths" +msgstr "Intercambiar caminos" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap source and destination" +msgstr "Intercambiar origen y destino" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:60 +msgid "Source:" +msgstr "Origen:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:65 +msgid "Destination:" +msgstr "Destino:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:85 +msgid "Files transferred:" +msgstr "Archivos transferidos:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:90 +msgid "Transfer rate:" +msgstr "Tasa de transferencia:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:46 +msgid "Print File" +msgstr "Imprimir el archivo" + +#: smb4k/dialogs/smb4kprintdialog.cpp:74 +msgid "Name:" +msgstr "Nombre:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:98 +msgid "File:" +msgstr "Archivo:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:107 +msgid "Copies:" +msgstr "Copias:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:155 +msgid "You haven't specified a file." +msgstr "No ha especificado un archivo." + +#: smb4k/dialogs/smb4kmountdialog.cpp:48 +msgid "Mount Share" +msgstr "Montar Recurso Compartido" + +#: smb4k/dialogs/smb4kmountdialog.cpp:75 +msgid "IP Address:" +msgstr "Dirección IP:" + +#: smb4k/dialogs/smb4kmountdialog.cpp:83 +msgid "Add this share to the bookmarks" +msgstr "Agregar este recurso compartido a los favoritos" + +#: smb4k/dialogs/smb4kmountdialog.cpp:140 +msgid "" +"The format of the share you entered is not correct. It must have the form //" +"HOST/SHARE." +msgstr "" +"El formato del ingreso es incorrecto. Debe ser de la forma //SERVIDOR/" +"NOMBRE_RECURSO" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:46 +msgid "Preview" +msgstr "Vista previa" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:111 +msgid "Forward" +msgstr "Adelante" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:112 +msgid "Up" +msgstr "Subir" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:93 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:106 +msgid "Custom Options" +msgstr "Opciones personalizadas" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:185 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:301 +msgid "Try to authenticate with Kerberos (Active Directory)" +msgstr "Intentar la autenticación con Kerberos (Directorio Activo)" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:52 +msgid "Bookmark Editor" +msgstr "Editor de marcadores" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:61 +msgid "Bookmark" +msgstr "Añadir marcador" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:62 +msgid "Workgroup" +msgstr "Grupo de trabajo" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:64 +msgid "Label" +msgstr "Etiqueta" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:76 +msgid "Remove &All" +msgstr "Eliminar &todos" + +#: smb4k/smb4ksystemtray.cpp:59 smb4k/main.cpp:64 +msgid "Smb4K" +msgstr "Smb4K" + +#: smb4k/main.cpp:51 +msgid "" +"Smb4K is an advanced network neighborhood browser and a\n" +"front end to the programs of the Samba software suite." +msgstr "" +"Smb4k es un navegador avanzado del entorno de red y una\n" +"interfaz para los programas de la suite de programas Samba." + +#: smb4k/main.cpp:66 +#, fuzzy +msgid "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" +msgstr "" +"(c) 2003-2007, Alexander Reinholdt\n" +"(c) 2004-2007, Massimo Callegari\n" +"(c) 2004, Franck Babin" + +#: smb4k/main.cpp:69 smb4k/main.cpp:70 smb4k/main.cpp:71 +msgid "Developer" +msgstr "Desarrollador" + +#: smb4k/main.cpp:74 +msgid "Catalan translation" +msgstr "Traducción al catalán" + +#: smb4k/main.cpp:75 smb4k/main.cpp:100 +msgid "Polish translation" +msgstr "Traducción al polaco" + +#: smb4k/main.cpp:76 +msgid "Chinese Simplified translation" +msgstr "Traducción al chino simplificado" + +#: smb4k/main.cpp:77 +msgid "Russian translation" +msgstr "Traducción al ruso" + +#: smb4k/main.cpp:78 +msgid "Swedish translation and intensive testing" +msgstr "Traducción al sueco y pruebas intensivas" + +#: smb4k/main.cpp:79 smb4k/main.cpp:96 +msgid "Brazilian Portuguese translation" +msgstr "Traducción al portugués brasileño" + +#: smb4k/main.cpp:80 +msgid "Ukrainian translation" +msgstr "Traducción al ucraniano" + +#: smb4k/main.cpp:81 +msgid "Hungarian translation" +msgstr "Traducción al húngaro" + +#: smb4k/main.cpp:82 smb4k/main.cpp:90 +msgid "Spanish translation" +msgstr "Traducción al castellano" + +#: smb4k/main.cpp:83 +msgid "Slovak translation" +msgstr "Traducción al eslovaco" + +#: smb4k/main.cpp:84 +msgid "French translation" +msgstr "Traducción al francés" + +#: smb4k/main.cpp:85 +msgid "Japanese translation" +msgstr "Traducción al japonés" + +#: smb4k/main.cpp:86 +msgid "Bulgarian translation" +msgstr "Traducción al búlgaro" + +#: smb4k/main.cpp:87 +msgid "Italian translation" +msgstr "Traducción al italiano" + +#: smb4k/main.cpp:88 +msgid "Norwegian translations" +msgstr "Traducción al noruego" + +#: smb4k/main.cpp:89 +msgid "Czech translation" +msgstr "Traducción al checo" + +#: smb4k/main.cpp:91 smb4k/main.cpp:97 +msgid "Turkish translation" +msgstr "Traducción al turco" + +#: smb4k/main.cpp:92 smb4k/main.cpp:98 +msgid "Chinese Traditional translation" +msgstr "Traducción al chino tradicional" + +#: smb4k/main.cpp:93 +msgid "Icelandic translation" +msgstr "Traducción al islandés" + +#: smb4k/main.cpp:94 +msgid "Danish translation" +msgstr "Traducción al danés" + +#: smb4k/main.cpp:95 +msgid "Dutch translation" +msgstr "Traducción al alemán" + +#: smb4k/main.cpp:99 +msgid "Testing of Smb4K under FreeBSD" +msgstr "Pruebas de Smb4K sobre FreeBSD" + +#: smb4k/main.cpp:129 +msgid "" +"Smb4K now uses a different configuration system. Thus, your old settings are " +"obsolete and you have to reconfigure the application.\n" +"To assure a clean transition, the current configuration file will be removed." +msgstr "" + +#: smb4k/iconview/smb4ksharesiconview_part.cpp:549 +msgid "Smb4KSharesIconViewPart" +msgstr "Smb4KSharesIconViewPart" + +#. i18n: file ./smb4k/smb4k_shell.rc line 7 +#. i18n: file ./smb4k/browser/smb4knetworkbrowser_part.rc line 4 +#: rc.cpp:6 rc.cpp:27 +#, no-c-format +msgid "&Network" +msgstr "&Red" + +#. i18n: file ./smb4k/smb4k_shell.rc line 9 +#: rc.cpp:9 +#, no-c-format +msgid "Sh&ares" +msgstr "Recursos comp&artidos" + +#. i18n: file ./smb4k/smb4k_shell.rc line 27 +#: rc.cpp:18 +#, no-c-format +msgid "Network ToolBar" +msgstr "Barra de herramientas de redes" + +#. i18n: file ./smb4k/smb4k_shell.rc line 29 +#: rc.cpp:21 +#, no-c-format +msgid "Shares View ToolBar" +msgstr "Barra de herramientas de vistas de recursos compartidos" + +#. i18n: file ./smb4k/smb4k_shell.rc line 31 +#: rc.cpp:24 +#, no-c-format +msgid "Main ToolBar" +msgstr "Barra de herramientas principal" + +#. i18n: file ./smb4k/listview/smb4kshareslistview_part.rc line 4 +#. i18n: file ./smb4k/iconview/smb4ksharesiconview_part.rc line 4 +#: rc.cpp:30 rc.cpp:33 +#, no-c-format +msgid "&Shares" +msgstr "&Recursos compartidos" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Quique, Martín Carr" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "quique@sindominio.net, tincarr@gmail.com" + +#: plugin/smb4k_konqplugin.cpp:70 +msgid "Scan Network" +msgstr "Buscar Red" + +#: plugin/smb4k_konqplugin.cpp:122 +msgid "Samba Browser" +msgstr "Navegador Samba" + diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..3e8baac --- /dev/null +++ b/po/it.po @@ -0,0 +1,3624 @@ +# translation of it.po to +# Isidoro Russo , 2004. +msgid "" +msgstr "" +"Project-Id-Version: it\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-20 08:48+0200\n" +"PO-Revision-Date: 2007-12-15 19:18+0100\n" +"Last-Translator: dragon\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: smb4k/smb4k.cpp:84 +msgid "&Dock Widgets" +msgstr "&Pannelli" + +#: smb4k/smb4k.cpp:108 smb4k/smb4k.cpp:112 smb4k/smb4k.cpp:287 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:170 +msgid "Network Browser" +msgstr "Browser di rete" + +#: smb4k/smb4k.cpp:118 smb4k/smb4k.cpp:122 smb4k/smb4k.cpp:316 +#: plugin/smb4k_konqplugin.cpp:149 +msgid "Search Dialog" +msgstr "Finestra di Ricerca" + +#: smb4k/smb4k.cpp:156 +msgid "Shares Vie&w" +msgstr "Visualizzazion&e delle Condivisioni" + +#: smb4k/smb4k.cpp:159 +msgid "&Icon View" +msgstr "Vista a &Icone" + +#: smb4k/smb4k.cpp:163 +msgid "List Vie&w" +msgstr "Vista a &Lista" + +#: smb4k/smb4k.cpp:203 smb4k/smb4k.cpp:771 +msgid "Ready." +msgstr "Pronto." + +#: smb4k/smb4k.cpp:264 +#, fuzzy +msgid "Jump to shares view" +msgstr "Passa alla Visualizzazione delle Condivisioni" + +#: smb4k/smb4k.cpp:293 +#, fuzzy +msgid "Jump to network browser" +msgstr "Passa al Browser di Rete" + +#: smb4k/smb4k.cpp:332 +#, fuzzy +msgid "Jump to search dialog" +msgstr "Passa alla Finestra di Ricerca" + +#: smb4k/smb4k.cpp:463 +#, fuzzy +msgid "" +"Closing the main window will keep Smb4K running in the system tray. Use " +"\"Quit\" from the \"File\" menu to quit the application." +msgstr "" +"Smb4K è ancora attivo nella barra di sistema anche se è stata chiusa la sua " +"finestra principale. Per uscire completamente dal programma selezionare " +"'Esci' nel menù 'File'." + +#: smb4k/smb4k.cpp:465 +msgid "Docking in System Tray" +msgstr "Ancoraggio nella barra di sistema" + +#: smb4k/smb4k.cpp:496 +msgid "Exiting..." +msgstr "Uscita...." + +#: smb4k/smb4k.cpp:649 +msgid "Looking up workgroups and domains..." +msgstr "Ricerca gruppi e domini..." + +#: smb4k/smb4k.cpp:655 +msgid "Querying current master browser..." +msgstr "Interrogazione master browser corrente..." + +#: smb4k/smb4k.cpp:661 +msgid "Querying master browser %1..." +msgstr "Interrogazione master browser %1..." + +#: smb4k/smb4k.cpp:667 +msgid "Scanning broadcast areas..." +msgstr "Scansione indirizzi di broadcast..." + +#: smb4k/smb4k.cpp:681 +msgid "Opening workgroup..." +msgstr "Apertura del gruppo di lavoro...." + +#: smb4k/smb4k.cpp:687 +msgid "Retrieving list of shares..." +msgstr "Ricezione elenco delle condivisioni..." + +#: smb4k/smb4k.cpp:693 +msgid "Retrieving additional information..." +msgstr "Ricezione informazioni aggiuntive..." + +#: smb4k/smb4k.cpp:699 +msgid "Searching..." +msgstr "Ricerca...." + +#: smb4k/smb4k.cpp:705 +msgid "Retrying to retrieve list of shares..." +msgstr "Ritento la ricezione dell'elenco delle condivisioni..." + +#: smb4k/smb4k.cpp:711 smb4k/smb4k.cpp:729 smb4k/smb4k.cpp:741 +#: smb4k/smb4k.cpp:753 smb4k/smb4k.cpp:765 +msgid "Done." +msgstr "Fatto" + +#: smb4k/smb4k.cpp:717 +msgid "Mounting share..." +msgstr "Montaggio della condivisione..." + +#: smb4k/smb4k.cpp:723 +msgid "Unmounting share..." +msgstr "Smontaggio della condivisione..." + +#: smb4k/smb4k.cpp:735 +msgid "Printing file..." +msgstr "Stampa del file..." + +#: smb4k/smb4k.cpp:747 +msgid "Synchronizing data..." +msgstr "Sincronizzazione dei dati..." + +#: smb4k/smb4k.cpp:759 +msgid "Generating preview..." +msgstr "Generazione dell'anteprima..." + +#: smb4k/smb4k.cpp:819 smb4k/smb4ksystemtray.cpp:236 +msgid "&Edit Bookmarks" +msgstr "Gestione dei s&egnalibri" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:55 +msgid "Default Destination" +msgstr "Destinazione Predefinita" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:59 +msgid "Rsync prefix:" +msgstr "Prefisso Rsync:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:63 +#: smb4k/configdlg/smb4krsyncoptions.cpp:166 +#: smb4k/configdlg/smb4krsyncoptions.cpp:209 +msgid "General" +msgstr "Generale" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:67 +msgid "Archive mode" +msgstr "Modalità Archivio" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:68 +msgid "Recurse into directories" +msgstr "Ricorsione delle directory" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:69 +msgid "Skip files that are newer in target directory" +msgstr "Salta i file che sono più recenti nella destinazione" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:70 smb4k/core/smb4ksettings.cpp:819 +msgid "Update destination files in place" +msgstr "Aggiorna i file di destinazione sul posto" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:71 smb4k/core/smb4ksettings.cpp:823 +msgid "Use relative path names" +msgstr "Usa nomi percorsi relativi" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:72 +msgid "Don't send implied directories" +msgstr "Non inviare le directory sottintese" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:73 smb4k/core/smb4ksettings.cpp:831 +msgid "Transfer directories without recursing" +msgstr "Trasferisci le directory senza ricorsione" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:74 smb4k/core/smb4ksettings.cpp:835 +msgid "Compress data during transfer" +msgstr "Comprimi i dati durante il trasferimento" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:76 +msgid "Links" +msgstr "Collegamenti" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:79 smb4k/core/smb4ksettings.cpp:839 +msgid "Preserve symlinks" +msgstr "Preserva i collegamenti simbolici" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:80 smb4k/core/smb4ksettings.cpp:843 +msgid "Transform symlinks" +msgstr "Trasforma i collegamenti simbolici" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:81 smb4k/core/smb4ksettings.cpp:847 +msgid "Only transform unsafe symlinks" +msgstr "Trasforma solo i collegamenti non sicuri" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:82 smb4k/core/smb4ksettings.cpp:851 +msgid "Ignore unsafe symlinks" +msgstr "Ignora i collegamenti simbolici non sicuri" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:83 smb4k/core/smb4ksettings.cpp:855 +msgid "Preserve hard links" +msgstr "Preserva gli hard link" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:84 smb4k/core/smb4ksettings.cpp:859 +msgid "Keep directory symlinks" +msgstr "Mantieni i collegamenti alle directory" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:86 +msgid "File Permissions, etc." +msgstr "Permessi dei file, ecc." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:90 smb4k/core/smb4ksettings.cpp:863 +msgid "Preserve permissions" +msgstr "Mantieni i permessi" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:91 smb4k/core/smb4ksettings.cpp:867 +msgid "Preserve group" +msgstr "Mantieni il gruppo" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:92 +#, fuzzy +msgid "Preserve owner" +msgstr "Mantieni il gruppo" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:93 smb4k/core/smb4ksettings.cpp:875 +msgid "Preserve device and special files" +msgstr "Preserva le device e i file speciali" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:94 smb4k/core/smb4ksettings.cpp:879 +msgid "Preserve times" +msgstr "Mantieni gli orari" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:95 smb4k/core/smb4ksettings.cpp:883 +msgid "Omit directories when preserving times" +msgstr "Ometti le directory quando mantieni gli orari" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:105 +msgid "Copying" +msgstr "Copia" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:115 +msgid "File Deletion" +msgstr "Eliminazione del File" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:118 smb4k/core/smb4ksettings.cpp:887 +msgid "Remove synchronized source files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:119 smb4k/core/smb4ksettings.cpp:891 +msgid "Delete extraneous files" +msgstr "Cancella file estranei" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:120 smb4k/core/smb4ksettings.cpp:895 +msgid "Delete files before transfer" +msgstr "Elimina i file prima del trasferimento" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:121 smb4k/core/smb4ksettings.cpp:899 +msgid "Delete files after transfer" +msgstr "Elimina i file dopo il trasferimento" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:122 smb4k/core/smb4ksettings.cpp:903 +msgid "Delete files during transfer" +msgstr "Elimina i file durante il trasferimento" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:123 +#, fuzzy +msgid "Also delete excluded files" +msgstr "Elimina anche i file nella destinazione esclusi" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:124 smb4k/core/smb4ksettings.cpp:911 +msgid "Delete even if I/O errors occur" +msgstr "Elimina anche in caso di errori di I/O" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:125 smb4k/core/smb4ksettings.cpp:915 +msgid "Force deletion of non-void directories" +msgstr "Forza l'eliminazione delle directory non nulle" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:127 +msgid "Restrictions" +msgstr "Restrizioni" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:130 +msgid "Don't delete more than this many files:" +msgstr "Non eliminare più di # file:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:133 +msgid "File Transfer" +msgstr "Trasferimento dei File" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:137 +#, fuzzy +msgid "Don't transfer any file smaller than:" +msgstr "Non trasferire file più piccoli di" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:140 +#, fuzzy +msgid "Don't transfer any file larger than:" +msgstr "Non trasferire file più grandi di" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:143 smb4k/core/smb4ksettings.cpp:943 +msgid "Keep partially transferred files" +msgstr "Mantieni i file parzialmente trasferiti" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:145 +#, fuzzy +msgid "Put a partially transferred file into:" +msgstr "Conserva i file parzialmente trasferiti in" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:156 +msgid "File Deletion && Transfer" +msgstr "Eliminazione && Trasferimento dei File" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:170 smb4k/core/smb4ksettings.cpp:954 +msgid "Auto-ignore files in the same way CVS does" +msgstr "Ignora automaticamente i file come accade in CVS" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:172 +msgid "Exclude files matching this pattern:" +msgstr "Escludi i file che corrispondono a questo schema:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:174 +#, fuzzy +msgid "Read exclude patterns from:" +msgstr "Preleva gli schemi di esclusione da" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:177 +msgid "Don't exclude files matching this pattern:" +msgstr "NOn escludere i file che corrispondono a questo schema:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:179 +#, fuzzy +msgid "Read include patterns from:" +msgstr "Preleva gli schemi di inclusione da" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:183 +msgid "Filter Rules" +msgstr "Regole di filtraggio" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:186 +#, fuzzy +msgid "" +"The rules defined below will be added to the \"rsync\" command as they are. " +"Thus, you have to start with the --filter=... argument." +msgstr "" +"Le regole definite sopra saranno aggiunte al comando rsync così come " +"appaiono. Per questo motivo, è necessario iniziare con l'argomento '--" +"filter'. Per maggiori informazioni, leggere la prima pagina del manuale di " +"rsync." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:189 +#, fuzzy +msgid "Special filter rules:" +msgstr "Regole di filtraggio" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:190 +#, fuzzy +msgid "Use --filter='dir-merge /.rsync-filter' filter rule" +msgstr "Usa la regola \"--filter='- .rsync-filter'\"" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:191 +#, fuzzy +msgid "Use --filter='exclude .rsync-filter' filter rule" +msgstr "Usa la regola \"--filter='- .rsync-filter'\"" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:199 +msgid "Filtering" +msgstr "Filtraggio" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:213 smb4k/core/smb4ksettings.cpp:998 +msgid "Handle sparse files efficiently" +msgstr "Gestisci in maniera efficiente i file scarsi" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:214 smb4k/core/smb4ksettings.cpp:1002 +msgid "Copy files whole (no rsync algorithm)" +msgstr "Copia i file per intero (non usare l'algoritmo rsync)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:215 +msgid "Don't cross file system boundaries" +msgstr "Non attraversare i limiti del file system" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:216 +msgid "Only update files that already exist" +msgstr "Aggiorna solo i file già esistenti" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:217 +msgid "Ignore files that already exist" +msgstr "Ignora i file già esistenti" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:218 +#, fuzzy +msgid "Delay updates until the end of transfer" +msgstr "Elimina i file nella destinazione dopo il trasferimento" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:220 +msgid "Backup" +msgstr "Backup" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:223 smb4k/core/smb4ksettings.cpp:1022 +msgid "Make backups" +msgstr "Crea backup" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:225 +msgid "Backup suffix:" +msgstr "Suffisso di backup:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:227 +msgid "Backup directory:" +msgstr "Directory di Backup:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:231 +msgid "Checksums" +msgstr "Checksum" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:234 +msgid "Force fixed checksum block size:" +msgstr "Dimensione fissata dei blocchi per il checksum:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:236 +msgid "Set block/file checksum seed:" +msgstr "Imposta il seme per il checksum del blocco/file:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:238 +#, fuzzy +msgid "Skip files based on checksum" +msgstr "Salta basandoti sul checksum" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:248 +msgid "Advanced" +msgstr "Avanzate" + +#: smb4k/configdlg/smb4kshareoptions.cpp:53 +msgid "Directories" +msgstr "Cartelle" + +#: smb4k/configdlg/smb4kshareoptions.cpp:59 +msgid "Mount prefix:" +msgstr "Prefisso di montaggio:" + +#: smb4k/configdlg/smb4kshareoptions.cpp:66 +msgid "Force generated subdirectories to be lower case" +msgstr "Forza l'uso di caratteri minuscoli nei nomi delle sottocartelle" + +#: smb4k/configdlg/smb4kshareoptions.cpp:69 +msgid "Mounting and Unmounting" +msgstr "Montaggio e smontaggio" + +#: smb4k/configdlg/smb4kshareoptions.cpp:70 +msgid "Unmount all shares of user %1 on exit" +msgstr "Smonta tutte le condivisioni dell'utente %1 quando esci" + +#: smb4k/configdlg/smb4kshareoptions.cpp:72 +msgid "Remount recently used shares on program start" +msgstr "Monta le condivisioni usate di recente all'avvio" + +#: smb4k/configdlg/smb4kshareoptions.cpp:74 +msgid "Allow the unmounting of shares that are owned by other users" +msgstr "Consenti lo smontaggio di condivisioni di altri utenti" + +#: smb4k/configdlg/smb4kshareoptions.cpp:77 +msgid "Checks" +msgstr "Controlli" + +#: smb4k/configdlg/smb4kshareoptions.cpp:79 +msgid "Interval between checks:" +msgstr "Intervallo fra i controlli:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:50 +msgid "Browse List" +msgstr "Elenco degli host" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:53 +msgid "Scan the network neighborhood for available workgroups and domains" +msgstr "Analizza la rete per gruppi e domini disponibili" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:55 +msgid "Query the current workgroup master browser" +msgstr "Interroga il master browser del gruppo di lavoro corrente" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:62 +msgid "Query this master browser:" +msgstr "Interroga questo master browser:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:65 +msgid "Scan broadcast areas:" +msgstr "Interroga indirizzo di broadcast:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:80 +msgid "Network Search" +msgstr "Ricerca in rete" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:85 +msgid "" +"Smb4K uses \"nmblookup\" by default to search for remote hosts. This method " +"is very reliable but fails sometimes if your network neighborhood is " +"configured uncommonly. In this case you should try to use \"smbclient\"." +msgstr "" +"Smb4K utilizza \"nmblookup\" come impostazione predefinita per le ricerche " +"in rete. Questo metodo, solitamente affidabile, può non funzionare se alcune " +"macchine nella rete hanno configurazioni non comuni. In questo caso, " +"utilizzare il metodo \"smbclient\"." + +#: smb4k/configdlg/smb4knetworkoptions.cpp:88 +msgid "Use nmblookup (recommended)" +msgstr "Usa nmblookup (raccomandato)" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:91 +msgid "Use smbclient" +msgstr "Usa smbclient" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:162 +msgid "User Interface" +msgstr "Interfaccia utente" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:163 +#: smb4k/browser/smb4knetworkbrowser.cpp:50 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:186 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:319 +msgid "Network" +msgstr "Rete" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:164 +#: smb4k/listview/smb4kshareslistview_part.cpp:144 +#: smb4k/listview/smb4kshareslistview_part.cpp:346 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:141 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:232 +msgid "Shares" +msgstr "Condivisioni" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:165 +#: smb4k/configdlg/smb4ksambaoptions.cpp:89 +#: smb4k/core/smb4kpasswordhandler.cpp:237 +msgid "Authentication" +msgstr "Autenticazione" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:166 +msgid "Samba" +msgstr "Samba" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:167 +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47 +msgid "Synchronization" +msgstr "Sincronizzazione" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:168 +msgid "Super User" +msgstr "Amministratore" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:327 +#: smb4k/configdlg/smb4kconfigdialog.cpp:328 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1039 +#: smb4k/configdlg/smb4ksambaoptions.cpp:400 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:970 +msgid "auto" +msgstr "auto" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:331 +#: smb4k/configdlg/smb4kconfigdialog.cpp:352 +#: smb4k/configdlg/smb4kconfigdialog.cpp:441 +#: smb4k/configdlg/smb4kconfigdialog.cpp:451 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1098 +#: smb4k/configdlg/smb4ksambaoptions.cpp:428 +msgid "yes" +msgstr "si" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:332 +#: smb4k/configdlg/smb4kconfigdialog.cpp:353 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1099 +#: smb4k/configdlg/smb4ksambaoptions.cpp:427 +msgid "no" +msgstr "no" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:360 +#: smb4k/configdlg/smb4kconfigdialog.cpp:458 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1060 +#: smb4k/configdlg/smb4ksambaoptions.cpp:215 +#: smb4k/configdlg/smb4ksambaoptions.cpp:418 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:913 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-write" +msgstr "lettura-scrittura" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:361 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1061 +#: smb4k/configdlg/smb4ksambaoptions.cpp:216 +#: smb4k/configdlg/smb4ksambaoptions.cpp:419 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-only" +msgstr "solo lettura" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:460 +#: smb4k/configdlg/smb4kconfigdialog.cpp:465 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1072 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1082 +#: smb4k/configdlg/smb4ksambaoptions.cpp:141 +#: smb4k/configdlg/smb4ksambaoptions.cpp:167 +msgid "default" +msgstr "predefinito" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:707 +msgid "[Network] The custom master browser has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:722 +msgid "[Network] The broadcast areas have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:733 +msgid "[Shares] The mount prefix is empty.\n" +msgstr "[Condivisioni] Il percorso di montaggio è vuoto.\n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:748 +msgid "[Authentication] The default user name has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:759 +msgid "[Samba] The file mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:770 +msgid "[Samba] The directory mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:781 +msgid "[Samba] The UID is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:792 +msgid "[Samba] The GID is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:803 +msgid "[Synchronization] The rsync prefix is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:816 +#, fuzzy +msgid "" +"[Synchronization] The directory where partially transferred files should be " +"stored is empty.\n" +msgstr "Conserva i file parzialmente trasferiti in" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:829 +msgid "[Synchronization] The exclude patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:842 +msgid "[Synchronization] The path of the exclude file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:855 +msgid "[Synchronization] The include patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:868 +msgid "[Synchronization] The path of the include file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:887 +msgid "[Synchronization] The backup suffix has not been defined.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:900 +msgid "[Synchronization] The backup directory is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:908 +msgid "" +"The configuration could not be written, because one setting is incomplete:\n" +"%1Please correct this issue." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:912 +msgid "" +"The configuration could not be written, because %1 settings are incomplete:\n" +"%1Please correct these issues." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:1191 +#, fuzzy +msgid "Smb4KConfigDialog" +msgstr "Smb4KMontaggio" + +#: smb4k/configdlg/smb4kauthoptions.cpp:52 +msgid "Password Storage" +msgstr "Archiviazione Password" + +#: smb4k/configdlg/smb4kauthoptions.cpp:53 +msgid "Save the authentication data in a wallet" +msgstr "Salva le informazioni di autenticazione in un portafogli" + +#: smb4k/configdlg/smb4kauthoptions.cpp:55 +msgid "If no wallet is used, remember authentication data during run time" +msgstr "" +"Se non si utilizza alcun portafogli, conserva le password durante " +"l'esecuzione" + +#: smb4k/configdlg/smb4kauthoptions.cpp:58 +msgid "Default Login" +msgstr "Nome utente predefinito" + +#: smb4k/configdlg/smb4kauthoptions.cpp:62 +msgid "Use default login" +msgstr "Usa il nome utente predefinito" + +#: smb4k/configdlg/smb4kauthoptions.cpp:69 +#: smb4k/core/smb4kpasswordhandler.cpp:291 +#: smb4k/core/smb4khomesshareshandler.cpp:89 +msgid "User:" +msgstr "Utente:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:72 +msgid "This login name is used by default to authenticate to a remote server." +msgstr "" +"Questo nome utente sarà utilizzato di default per l'autenticazione ad un " +"server remoto" + +#: smb4k/configdlg/smb4kauthoptions.cpp:73 +#: smb4k/core/smb4kpasswordhandler.cpp:311 +msgid "Password:" +msgstr "Password:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:77 +msgid "" +"This password is used by default to authenticate to a remote server. It may " +"be empty." +msgstr "" +"Questa password sarà utilizzata di default per l'autenticazione ad un server " +"remoto. Può essere vuota." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:70 +msgid "General Options" +msgstr "Opzioni generali" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:73 +msgid "NetBIOS name:" +msgstr "Nome NetBIOS:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:76 +#, fuzzy +msgid "Domain:" +msgstr "Collocazione:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:79 +msgid "Socket options:" +msgstr "Opzioni del socket:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:82 +#, fuzzy +msgid "NetBIOS scope:" +msgstr "Nome NetBIOS:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:85 +msgid "Remote SMB port:" +msgstr "Porta SMB remota:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:91 +msgid "Try to authenticate with Kerberos" +msgstr "Tenta l'autenticazione con Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:92 +msgid "Authenticate as machine account" +msgstr "Autentica come account del sistema" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:100 +#, fuzzy +msgid "General Settings" +msgstr "Opzioni generali" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:110 +#: smb4k/configdlg/smb4ksambaoptions.cpp:384 +#: smb4k/listview/smb4kshareslistview.cpp:56 +msgid "File System" +msgstr "File System" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:120 +#, fuzzy +msgid "" +"NOTE: You might need to enable support for either \"super\" or \"sudo\" in " +"the Super User page." +msgstr "" +"Scegliendo il file system CIFS, potrebbe essere necessario abilitare il " +"supporto a super o sudo nella scheda Amministratore." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:124 +msgid "User and Group" +msgstr "Utente e Gruppo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:127 +#: smb4k/configdlg/smb4ksambaoptions.cpp:430 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:292 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:317 +msgid "User ID:" +msgstr "ID Utente:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:131 +#: smb4k/configdlg/smb4ksambaoptions.cpp:435 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:296 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:321 +msgid "Group ID:" +msgstr "ID Gruppo:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:136 +msgid "Charset and Codepage" +msgstr "Set di caratteri e Codici di pagina" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:139 +#, fuzzy +msgid "Client charset:" +msgstr "Set di caratteri Linux:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:165 +msgid "Server codepage:" +msgstr "Codice di pagina del server:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:202 +msgid "Permissions" +msgstr "Permessi" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:205 +msgid "File mask:" +msgstr "Maschera file:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:209 +msgid "Directory mask:" +msgstr "Directory mask:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:213 +#: smb4k/configdlg/smb4ksambaoptions.cpp:414 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:286 +msgid "Write access:" +msgstr "Accesso in scrittura:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:220 +msgid "Advanced CIFS Options" +msgstr "Opzioni CIFS avanzate" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:227 smb4k/core/smb4ksettings.cpp:692 +msgid "Do permission checks" +msgstr "Esegui controllo sui permessi" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:229 +msgid "Attempt to set UID and GID" +msgstr "Tenta l'impstazione di UID e GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:231 smb4k/core/smb4ksettings.cpp:700 +msgid "Use server inode numbers" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:233 smb4k/core/smb4ksettings.cpp:704 +msgid "Do not cache inode data" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:235 smb4k/core/smb4ksettings.cpp:708 +msgid "Translate reserved characters" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:237 smb4k/core/smb4ksettings.cpp:712 +msgid "Do not use locking" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:244 +msgid "Additional options:" +msgstr "Opzioni addizionali:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:248 +msgid "Advanced SMBFS Options" +msgstr "Opzioni avanzate di SMBFS" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:251 +msgid "Use Unicode when communicating with the server" +msgstr "Usa Unicode per comunicare con il server" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:252 +#, fuzzy +msgid "Use large file support" +msgstr "Attiva il supporto ai filesystem estesi" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:258 +msgid "Caching time of directory listings:" +msgstr "Tempo di caching degli elenchi delle cartelle:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:289 +msgid "Protocol Hint" +msgstr "Suggerimento Protocollo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:291 +msgid "Automatic detection" +msgstr "Decisione automatica" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:293 +msgid "RPC: Modern operating systems" +msgstr "RPC: Sistema Operativo moderno" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:295 +msgid "RAP: Older operating systems" +msgstr "RAP: Sistema Operativo vecchio" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:297 +msgid "ADS: Active Directory environment (LDAP/Kerberos)" +msgstr "ADS: Ambiente Active Directory (LDAP/Kerberos)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:318 +#, fuzzy +msgid "Name resolve order:" +msgstr "Ordine di risoluzione:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:321 +msgid "Buffer size:" +msgstr "Dimensione del buffer:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:323 +msgid " Bytes" +msgstr "Bytes" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:325 +msgid "Signing state:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:327 +#, fuzzy +msgid "none" +msgstr "Nessuno" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:328 +msgid "on" +msgstr "attivo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:329 +msgid "off" +msgstr "disattivo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:330 +msgid "required" +msgstr "richiesto" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:354 +msgid "Broadcast address:" +msgstr "Indirizzo broadcast:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:357 +msgid "Try and bind to UDP port 137 to send and receive UDP datagrams" +msgstr "" +"Tenta di connetterti alla porta UDP 137 per l'invio e la ricezione di " +"datagrammi UDP" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:381 +#: smb4k/listview/smb4kshareslistview.cpp:51 +msgid "Item" +msgstr "Elemento" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:382 +msgid "Protocol" +msgstr "Protocollo" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:385 +msgid "Write Access" +msgstr "Accesso iin scrittura" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:387 +msgid "Kerberos" +msgstr "Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:388 +msgid "UID" +msgstr "UID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:389 +msgid "GID" +msgstr "GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:390 +msgid "Port" +msgstr "Porta" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:396 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:177 +msgid "Protocol:" +msgstr "Protocollo:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:407 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:136 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:279 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:136 +msgid "File system:" +msgstr "File System:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:423 +msgid "Kerberos:" +msgstr "Kerberos:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:440 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:164 +msgid "Port:" +msgstr "Porta:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:451 +msgid "Remove All" +msgstr "Rimuovi tutti" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:493 +msgid "Custom" +msgstr "Personalizzato" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:52 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:171 +msgid "Shares View" +msgstr "Visualizzazione delle Condivisioni" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:55 +msgid "Show mounted shares in an icon view" +msgstr "Mostra le condivisioni montate come icone" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:57 +msgid "Show mounted shares in a list view" +msgstr "Mostra le condivisioni montate come elenco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:62 +#: smb4k/core/smb4ksettings.cpp:117 +msgid "Show custom bookmark label if available" +msgstr "Mostra etichetta personalizzata del segnalibro se disponibile" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:64 +#, fuzzy +msgid "System Tray" +msgstr "Ancoraggio nella barra di sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:67 +msgid "Embed application into the system tray" +msgstr "Includi l'applicazione nella barra di sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:83 +msgid "Remote Shares" +msgstr "Condivisioni remote" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:85 +#: smb4k/core/smb4ksettings.cpp:144 +msgid "Show printer shares" +msgstr "Mostra le stampanti condivise" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:86 +#: smb4k/core/smb4ksettings.cpp:148 +msgid "Show hidden shares" +msgstr "Mostra le condivisioni nascoste" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:87 +msgid "Show IPC$ shares" +msgstr "Mostra le condivisioni IPC$" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:88 +msgid "Show ADMIN$ shares" +msgstr "Mostra le condivisioni ADMIN$" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:90 +msgid "Columns" +msgstr "Colonne" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:92 +msgid "Show type" +msgstr "Mostra il tipo" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:93 +msgid "Show IP address" +msgstr "Mostra l'indirizzo IP" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:94 +msgid "Show comment" +msgstr "Mostra il commento" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:96 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:124 +msgid "Tooltips" +msgstr "Suggerimenti" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:98 +msgid "Show tooltip with information about a network item" +msgstr "Mostra i suggerimenti circa gli elementi della rete" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:114 +#: smb4k/smb4ksystemtray.cpp:67 +#, fuzzy +msgid "Mounted Shares" +msgstr "Condivi&sioni montate" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:116 +msgid "Show mount point instead of share name" +msgstr "Mostra il punto di montaggio anziché il nome della condivisione" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:117 +#: smb4k/core/smb4ksettings.cpp:180 +msgid "Show all shares that are mounted on the system" +msgstr "Mostra tutte le condivisioni montate nel sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:119 +msgid "Drag and Drop" +msgstr "Trascinamento" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:121 +msgid "Allow dropping of files and directories onto shares" +msgstr "Consenti trascinamento di file e directory sulle condivisioni" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:122 +msgid "Allow dragging of shares" +msgstr "Consenti trascinamento delle condivisioni" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:126 +msgid "Show tooltip with information about a share" +msgstr "Mostra i suggerimenti circa le condivisioni" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:128 +msgid "List View" +msgstr "Visualizzazione a lista" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:132 +#: smb4k/core/smb4ksettings.cpp:200 +msgid "Show owner and group (SMBFS only)" +msgstr "Mostra proprietario e gruppo (solo SMBFS)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:133 +#: smb4k/core/smb4ksettings.cpp:204 +msgid "Show login (CIFS only)" +msgstr "Mostra login (solo CIFS)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:135 +msgid "Show owner and group" +msgstr "Mostra utente e gruppo" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:137 +#: smb4k/core/smb4ksettings.cpp:208 +msgid "Show file system" +msgstr "Mostra file system" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:138 +#: smb4k/core/smb4ksettings.cpp:212 +msgid "Show free disk space" +msgstr "Mostra spazio libero su disco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:139 +#: smb4k/core/smb4ksettings.cpp:216 +msgid "Show used disk space" +msgstr "Mostra spazio libero su disco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:140 +#: smb4k/core/smb4ksettings.cpp:220 +msgid "Show total disk space" +msgstr "Mostra spazio totale sul disco" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:141 +#: smb4k/core/smb4ksettings.cpp:224 +msgid "Show disk usage" +msgstr "Mostra spazio del disco utilizzato" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:158 +msgid "Hidden Files and Directories" +msgstr "File e directory nascosti" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:159 +msgid "Preview hidden files and directories" +msgstr "Anteprima di file e directory nascosti" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:169 +msgid "Main Window && System Tray" +msgstr "Finestra principale e barra di sistema" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:172 +msgid "Preview Dialog" +msgstr "Finestra Anteprima" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:52 +msgid "Programs" +msgstr "Programmi" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:55 +msgid "Use the following program to gain super user privileges:" +msgstr "" +"Utilizza il seguente programma per ottenere i privilegi di amministratore:" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:59 +msgid "Actions" +msgstr "Azioni" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:62 +msgid "" +"Use super user privileges to force the unmounting of (inaccessible) shares" +msgstr "" +"Usa i privilegi di Amministratore per smontare le condivisioni " +"(inaccessibili)" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:64 +#: smb4k/core/smb4ksettings.cpp:1082 +msgid "Use super user privileges to mount and unmount shares" +msgstr "" +"Usa i privilegi di Amministratore per montare e smontare le condivisioni" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:67 +msgid "Remove Entries" +msgstr "Rimuovi le voci" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:68 +msgid "Remove entries from the configuration file" +msgstr "" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:69 +msgid "" +"Depending on your choice under \"Programs\", all entries that were written " +"by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. " +"Additionally, all your choices under \"Actions\" will be cleared." +msgstr "" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:109 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:154 +#: smb4k/dialogs/smb4kprintdialog.cpp:92 smb4k/dialogs/smb4kmountdialog.cpp:79 +msgid "Workgroup:" +msgstr "Gruppo di lavoro:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +msgid "Pseudo master browser:" +msgstr "Pseudo master browser:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:158 +msgid "Master browser:" +msgstr "Master browser:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:116 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:136 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:140 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:144 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:160 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:213 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:292 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:301 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:310 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:331 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:335 +#: smb4k/dialogs/smb4kprintdialog.cpp:88 +msgid "Unknown" +msgstr "Sconosciuto" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:129 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:207 +#: smb4k/dialogs/smb4kprintdialog.cpp:83 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +msgid "Host:" +msgstr "Host:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:132 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:185 +msgid "Comment:" +msgstr "Commento:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:135 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:211 +#: smb4k/dialogs/smb4kprintdialog.cpp:86 +msgid "IP address:" +msgstr "Indirizzo IP:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:139 +msgid "Operating system:" +msgstr "Sistema Operativo:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:143 +msgid "Server string:" +msgstr "Stringa del server:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:182 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:120 +#: smb4k/dialogs/smb4kmountdialog.cpp:70 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:120 +msgid "Share:" +msgstr "Condivisione:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:188 +msgid "Type:" +msgstr "Tipo:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:196 +msgid "Mounted:" +msgstr "Montata:" + +#: smb4k/browser/smb4knetworkbrowser.cpp:51 +msgid "Type" +msgstr "Tipo" + +#: smb4k/browser/smb4knetworkbrowser.cpp:52 +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:63 +msgid "IP Address" +msgstr "Indirizzo IP" + +#: smb4k/browser/smb4knetworkbrowser.cpp:53 +msgid "Comment" +msgstr "Commento" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:141 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:532 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:552 +msgid "Scan Netwo&rk" +msgstr "Analizza &Rete" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:144 +msgid "&Abort" +msgstr "&Annulla" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:149 smb4k/smb4ksystemtray.cpp:72 +msgid "M&ount Manually" +msgstr "M&onta Manualmente" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:154 +msgid "Au&thentication" +msgstr "Au&tenticazione" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:157 +#, fuzzy +msgid "&Custom Options" +msgstr "Opzioni Personalizzate" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:160 +msgid "Add &Bookmark" +msgstr "Aggiungi un segnali&bro" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:163 +msgid "Pre&view" +msgstr "A&nteprima" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:166 +msgid "&Print File" +msgstr "Stam&pa il file" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:169 +msgid "&Mount" +msgstr "&Monta" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:203 +#: smb4k/listview/smb4kshareslistview_part.cpp:111 +#: smb4k/smb4ksystemtray.cpp:790 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:108 +msgid "&Unmount" +msgstr "&Smonta" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:345 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:370 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:400 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:462 +msgid "Scan Compute&r" +msgstr "Analizza Compute&r" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:383 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:486 +msgid "Scan Wo&rkgroup" +msgstr "Analizza G&ruppo di lavoro" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:1905 +#, fuzzy +msgid "Smb4KNetworkBrowserPart" +msgstr "Browser di rete" + +#: smb4k/core/smb4kcore.cpp:248 +msgid "" +"Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will " +"hang if you try to access it.\n" +"Do you want to continue?" +msgstr "" +"Fino alla versione 3.3.x di KDE, KIO e Konqueror non supportano le " +"condivisioni CIFS. Konqueror andrà in blocco se si tenta di accedere ad una " +"di esse.\n" +"Si desidera continuare?" + +#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057 +msgid "Buffer size exceeded" +msgstr "Dimensione del buffer superata" + +#: smb4k/core/smb4kmounter.cpp:815 smb4k/core/smb4kmounter.cpp:862 +msgid "Do you really want to force the unmounting of this share?" +msgstr "Si desidera forzare lo smontaggio della condivisione?" + +#: smb4k/core/smb4ksettings.cpp:30 +msgid "The path to the program \"grep\"" +msgstr "Percorso del programma \"grep\"" + +#: smb4k/core/smb4ksettings.cpp:33 +msgid "The path to the program \"awk\"" +msgstr "Percorso del programma \"awk\"" + +#: smb4k/core/smb4ksettings.cpp:36 +msgid "The path to the program \"sed\"" +msgstr "Percorso del programma \"sed\"" + +#: smb4k/core/smb4ksettings.cpp:39 +msgid "The path to the program \"xargs\"" +msgstr "Percorso del programma \"xargs\"" + +#: smb4k/core/smb4ksettings.cpp:42 +msgid "The path to the program \"rmdir\"" +msgstr "Percorso del programma \"rmdir\"" + +#: smb4k/core/smb4ksettings.cpp:45 +msgid "The path to the program \"nmblookup\"" +msgstr "Percorso del programma \"nmblookup\"" + +#: smb4k/core/smb4ksettings.cpp:48 +msgid "The path to the program \"smbclient\"" +msgstr "Percorso del programma \"smbclient\"" + +#: smb4k/core/smb4ksettings.cpp:51 +msgid "The path to the program \"smbspool\"" +msgstr "Percorso del programma \"smbspool\"" + +#: smb4k/core/smb4ksettings.cpp:54 +msgid "The path to the program \"net\"" +msgstr "Percorso del programma \"net\"" + +#: smb4k/core/smb4ksettings.cpp:57 +msgid "The path to the program \"mount.cifs\"" +msgstr "Percorso del programma \"mount.cifs\"" + +#: smb4k/core/smb4ksettings.cpp:60 +msgid "The path to the program \"umount.cifs\"" +msgstr "Percorso del programma \"umount.cifs\"" + +#: smb4k/core/smb4ksettings.cpp:63 +msgid "The path to the program \"smbmount\"" +msgstr "Percorso del programma \"smbmount\"" + +#: smb4k/core/smb4ksettings.cpp:66 +msgid "The path to the program \"smbumount\"" +msgstr "Percorso del programma \"smbumount\"" + +#: smb4k/core/smb4ksettings.cpp:69 +msgid "The path to the program \"mount\"" +msgstr "Percorso del programma \"mount\"" + +#: smb4k/core/smb4ksettings.cpp:72 +msgid "The path to the program \"mount_smbfs\" (FreeBSD only)" +msgstr "Percorso del programma \"mount_smbfs\" (solo FreeBSD)" + +#: smb4k/core/smb4ksettings.cpp:75 +msgid "The path to the program \"smbutil\" (FreeBSD only)" +msgstr "Percorso del programma \"smbutil\" (solo FreeBSD)" + +#: smb4k/core/smb4ksettings.cpp:78 +msgid "The path to the program \"umount\"" +msgstr "Percorso del programma \"umount\"" + +#: smb4k/core/smb4ksettings.cpp:81 +msgid "The path to the program \"smb4k_mount\"" +msgstr "Percorso del programma \"smb4k_mount\"" + +#: smb4k/core/smb4ksettings.cpp:84 +msgid "The path to the program \"smb4k_umount\"" +msgstr "Percorso del programma \"smb4k_umount\"" + +#: smb4k/core/smb4ksettings.cpp:87 +msgid "The path to the program \"smb4k_kill\"" +msgstr "Percorso del programma \"smb4k_kill\"" + +#: smb4k/core/smb4ksettings.cpp:90 +msgid "The path to the program \"smb4k_cat\"" +msgstr "Percorso del programma \"smb4k_cat\"" + +#: smb4k/core/smb4ksettings.cpp:93 +msgid "The path to the program \"smb4k_mv\"" +msgstr "Percorso del programma \"smb4k_mv\"" + +#: smb4k/core/smb4ksettings.cpp:96 +msgid "The path to the program \"super\" (optional)" +msgstr "Percorso del programma \"super\" (opzionale)" + +#: smb4k/core/smb4ksettings.cpp:99 +msgid "The path to the program \"sudo\" (optional)" +msgstr "Percorso del programma \"sudo\" (opzionale)" + +#: smb4k/core/smb4ksettings.cpp:102 +msgid "The path to the program \"dvips\" (optional)" +msgstr "Percorso del programma \"dvips\" (opzionale)" + +#: smb4k/core/smb4ksettings.cpp:105 +msgid "The path to the program \"enscript\" (optional)" +msgstr "Percorso del programma \"enscript\" (opzionale)" + +#: smb4k/core/smb4ksettings.cpp:108 +msgid "The path to the program \"rsync\" (optional)" +msgstr "Percorso del programma \"rsync\" (opzionale)" + +#: smb4k/core/smb4ksettings.cpp:111 +msgid "The path to the program \"konsole\" (optional)" +msgstr "Percorso del programma \"konsole\" (opzionale)" + +#: smb4k/core/smb4ksettings.cpp:118 +msgid "" +"Do not show the name of the share that is represented by the bookmark but " +"the custom label that was defined in the bookmark editor." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:121 +msgid "Embed application into system tray" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:122 +msgid "" +"Embed the application into the system tray. The system tray widget provides " +"a popup menu with several commonly used tasks so that you do not need to " +"bring up the main window everytime. If this setting is chosen you have to " +"use \"Quit\" from the \"File\" menu or the system tray widget to exit the " +"application." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:125 +msgid "Start docked" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:126 +msgid "" +"Start the application docked to the system tray, i.e. only the system tray " +"widget is shown and the main window is hidden. You can bring the main window " +"up by clicking on the system tray widget or by choosing \"Restore\" from its " +"popup menu." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:140 +msgid "How the shares should be displayed" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:141 +msgid "" +"Choose the kind of view you prefer for displaying the mounted shares. There " +"is an icon view or a list view available." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:145 +msgid "Printer shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:149 +msgid "" +"Hidden shares will be displayed in the network browser. Hidden shares are " +"ending with a $ sign, e.g. Musik$ or IPC$." +msgstr "" +"Le condivisioni nascoste verranno visualizzate nel browser di rete. Le " +"condivisioni nascoste terminano con $, es. Music$ o IPC$" + +#: smb4k/core/smb4ksettings.cpp:152 +msgid "Show hidden IPC$ shares" +msgstr "Mostra le condivisioni IPC$ nascoste" + +#: smb4k/core/smb4ksettings.cpp:153 +msgid "Hidden IPC$ shares will be displayed in the network browser." +msgstr "" +"Le condivisioni IPC$ nascoste verranno visualizzate nel browser di rete" + +#: smb4k/core/smb4ksettings.cpp:156 +msgid "Show hidden ADMIN$ shares" +msgstr "Mostra le condivisioni ADMIN$ nascoste" + +#: smb4k/core/smb4ksettings.cpp:157 +msgid "Hidden ADMIN$ shares will be displayed in the network browser." +msgstr "" +"Le condivisioni ADMIN$ nascoste verranno visualizzate nel browser di rete" + +#: smb4k/core/smb4ksettings.cpp:160 +msgid "Show the type of a share" +msgstr "Mostra il tipo di condivisione" + +#: smb4k/core/smb4ksettings.cpp:161 +msgid "" +"The type of a share will be displayed in a separate column in the network " +"browser. It can either be Disk, Print or IPC." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:164 +msgid "Show the IP address of a server" +msgstr "Mostra l'indirizzo IP del server" + +#: smb4k/core/smb4ksettings.cpp:165 +msgid "" +"The IP address of the server will be displayed in a separate column in the " +"network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:168 +msgid "Show the comment of a share" +msgstr "Mostra il commento di una condivisioni" + +#: smb4k/core/smb4ksettings.cpp:169 +msgid "" +"The comment describing the server or share will be displayed in a separate " +"column in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:172 +msgid "Show a tooltip with information about the network item" +msgstr "Mostra i suggerimenti circa gli elementi della rete" + +#: smb4k/core/smb4ksettings.cpp:173 +#, fuzzy +msgid "The tooltip shows various information about the current network item." +msgstr "Mostra i suggerimenti circa gli elementi della rete" + +#: smb4k/core/smb4ksettings.cpp:176 +#, fuzzy +msgid "Show the mount point of a share instead of its name" +msgstr "Mostra il punto di montaggio anziché il nome della condivisione" + +#: smb4k/core/smb4ksettings.cpp:177 +msgid "" +"A share is normally displayed with its name in the shares view. Choosing " +"this feature will cause the exchange of the share name by the mount point." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:181 +msgid "" +"You will not only see the shares that were mounted and are owned by you, but " +"also all other mounts using the SMBFS and CIFS file system that are present " +"on the system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:184 +#, fuzzy +msgid "Allow the dropping of files and directories onto share icons" +msgstr "Mostra le stampanti condivise" + +#: smb4k/core/smb4ksettings.cpp:185 +msgid "" +"This setting allows you to drop files or whole directories onto the share " +"icons, which will cause them to be copied." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:188 +#, fuzzy +msgid "Allow the dragging of share icons" +msgstr "Mostra le stampanti condivise" + +#: smb4k/core/smb4ksettings.cpp:189 +msgid "" +"This setting allows you to drag a share item out of Smb4K and onto the " +"desktop or into a file manager. Only enable it if you think you absolutely " +"need it and read the handbook before you mark this checkbox." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:192 +#, fuzzy +msgid "Show a tooltip with information about the share" +msgstr "Mostra i suggerimenti circa le condivisioni" + +#: smb4k/core/smb4ksettings.cpp:193 +#, fuzzy +msgid "The tooltip shows various information about the current share." +msgstr "Mostra i suggerimenti circa le condivisioni" + +#: smb4k/core/smb4ksettings.cpp:196 +#, fuzzy +msgid "Show hidden files and directories when previewing a share" +msgstr "Forza l'eliminazione delle directory non nulle" + +#: smb4k/core/smb4ksettings.cpp:197 +msgid "" +"Display hidden files and directories in the preview dialog. The names of " +"hidden files and directories are beginning with a period and are usually " +"needed for very specific purposes (configuration file of an application, " +"etc.). Since they are not of any importance for your regular work, you " +"normally do not need to enable this feature." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:201 +msgid "" +"Show the UID and GID that own all files on the mounted file system. At the " +"moment the column will only contain an entry if the share was mounted with " +"the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:205 +msgid "" +"Show the login that was used to authenticate to the server. The column will " +"only contain an entry if the share was mounted with the CIFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:209 +#, fuzzy +msgid "Show the file system that was used for mounting the share." +msgstr "Utilizza il seguente file system per montare le condivisioni remote:" + +#: smb4k/core/smb4ksettings.cpp:213 +msgid "Show the free disk space that is left on the share." +msgstr "Mostra lo spazio libero che è rimasto nel disco della condivisione." + +#: smb4k/core/smb4ksettings.cpp:217 +#, fuzzy +msgid "Show the disk space that is already used on the share." +msgstr "Mostra tutte le condivisioni montate nel sistema" + +#: smb4k/core/smb4ksettings.cpp:221 +msgid "Show the total disk space of the share." +msgstr "Mostra spazio totale sul disco della condivisione" + +#: smb4k/core/smb4ksettings.cpp:225 +msgid "Show the space that is used on the share in percent." +msgstr "" +"Mostra lo spazio del disco in percentuale utilizzato nella condivisione" + +#: smb4k/core/smb4ksettings.cpp:252 +#, fuzzy +msgid "Method how to retrieve the browse list" +msgstr "Esamina la rete e recupera l'elenco degli host" + +#: smb4k/core/smb4ksettings.cpp:253 +msgid "" +"Choose the method how to compile the initial browse list. There are four " +"options available: The first one is the default one and employs \"nmblookup -" +"M -- -\" to discover all workgroups, domains, and their master browsers on " +"your network neighborhood. The second one instructs Smb4K to query the " +"current master browser of your workgroup or domain to retrieve the browse " +"list. The third is similar to the second one except that you can define the " +"master browser that should be queried. If you choose the last option, the " +"provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x." +"x -- '*'\"." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:256 +msgid "A custom master browser that is to be queried" +msgstr "Il master browser da interrogare" + +#: smb4k/core/smb4ksettings.cpp:257 +msgid "" +"Enter the name or IP address of a master browser here that should be queried " +"to compile the initial browse list." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:260 +msgid "A custom list of broadcast addresses" +msgstr "Una lista personalizzata di indirizzi di broadcast" + +#: smb4k/core/smb4ksettings.cpp:261 +msgid "" +"Enter a comma-separated list of broadcast addresses here (e.g. " +"192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the " +"respective broadcast areas." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:275 +msgid "Method for searching for remote hosts" +msgstr "Metodo per la ricerca degli host" + +#: smb4k/core/smb4ksettings.cpp:276 +msgid "" +"Smb4K is able to search for remote hosts either using nmblookup or " +"smbclient. The nmblookup method is very reliable and works well. However, if " +"your network is configured uncommonly and you experience problems when " +"searching, you should try the smbclient method. But please note that you " +"lose the ability to search for IP addresses in that case." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:282 +msgid "The mount prefix" +msgstr "Prefisso di montaggio" + +#: smb4k/core/smb4ksettings.cpp:283 +msgid "" +"This is the prefix where Smb4K will create the mount points and mount the " +"remote shares." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:286 +msgid "Force the subdirectories created by Smb4K to be lowercase" +msgstr "" +"Forza l'uso di caratteri minuscoli nei nomi delle sottocartelle create da " +"Smb4K" + +#: smb4k/core/smb4ksettings.cpp:287 +#, fuzzy +msgid "" +"All names of the subdirectories created by Smb4K below the mount prefix will " +"be lowercase." +msgstr "Forza l'uso di caratteri minuscoli nei nomi delle sottocartelle" + +#: smb4k/core/smb4ksettings.cpp:290 +msgid "Unmount the shares owned by the user on exit" +msgstr "Smonta tutte le condivisioni dell'utente quando esci" + +#: smb4k/core/smb4ksettings.cpp:291 +#, fuzzy +msgid "Unmount all shares that belong to you when the program exits." +msgstr "Smonta tutte le condivisioni dell'utente %1 quando esci" + +#: smb4k/core/smb4ksettings.cpp:294 +msgid "Remount shares" +msgstr "Condivisioni montate" + +#: smb4k/core/smb4ksettings.cpp:295 +msgid "" +"Remount all your shares that were still mounted when you exited the program. " +"Shares that were mounted by other users are ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:298 +#, fuzzy +msgid "Allow the unmounting of shares owned by other users" +msgstr "Consenti lo smontaggio di condivisioni di altri utenti" + +#: smb4k/core/smb4ksettings.cpp:299 +msgid "" +"Allow the unmounting of shares that were mounted by other users. In most " +"cases you need super user privileges for this. Please think before you " +"enable this option!" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:304 +msgid "Interval between checks for new and inaccessible shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:305 +msgid "" +"This is the time that elapses until Smb4K checks again for new mounts and " +"unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note " +"that the smaller the interval gets the higher is your system load." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:311 +msgid "Use a wallet to store authentication data" +msgstr "Usa un portafogli per salvare le informazioni di autenticazione." + +#: smb4k/core/smb4ksettings.cpp:312 +msgid "" +"Use a wallet to store the authentication data. The login name and the " +"password name are stored encrypted on your hard drive. If this setting is " +"disabled, the authentication data is not stored permanently but only " +"temporarily." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:315 +msgid "Remember passwords if no wallet is used" +msgstr "Ricorda la password se non viene usato un portafogli" + +#: smb4k/core/smb4ksettings.cpp:316 +msgid "" +"If you decided to store the login names and passwords only temporarily, " +"Smb4K will remember them until the program exits. If you disable this " +"setting, you will have to provide the authentication data everytime it is " +"needed." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:319 +#, fuzzy +msgid "Use a default login" +msgstr "Usa il nome utente predefinito" + +#: smb4k/core/smb4ksettings.cpp:320 +msgid "" +"Enable the usage of a default login name and password. The authentication " +"data provided below is then used by default to authenticate to a remote " +"server. This is very useful e.g. if you are working in an Active Directory " +"environment or an NT domain." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:326 +msgid "The NetBIOS name of this computer" +msgstr "Nome NetBIOS di questo computer" + +#: smb4k/core/smb4ksettings.cpp:327 +msgid "" +"This is the NetBIOS name of this computer that is used by Smb4K. By default, " +"it is either the NetBIOS name that is defined in the smb.conf file or the " +"host name." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:330 +msgid "The name of the workgroup/domain this computer is in" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:331 +msgid "" +"This is the workgroup or domain this computer is or should be in. By " +"default, it is the workgroup that is defined in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:334 +msgid "The socket options" +msgstr "Opzioni del socket" + +#: smb4k/core/smb4ksettings.cpp:335 +msgid "" +"These are the TCP socket options that are used by nmblookup, smbmount and " +"smbclient. Socket options are controls on the networking layer of the " +"operating systems which allow the connection to be tuned. See the manual " +"page of smb.conf for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:338 +msgid "The NetBIOS scope" +msgstr "Scope di NetBIOS" + +#: smb4k/core/smb4ksettings.cpp:339 +msgid "" +"This sets the NetBIOS scope that nmblookup, smbmount and smbclient will " +"operate under. It should not be set unless every machine on your network " +"neighborhood sets this value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:344 +msgid "The remote SMB port" +msgstr "Porta SMB remota" + +#: smb4k/core/smb4ksettings.cpp:345 +msgid "" +"This is the port that is to be used for connecting to remote servers. Please " +"note that this is independent of the settings in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:348 +msgid "Use Kerberos for authentication" +msgstr "Usa Kerberos per l'autenticazione" + +#: smb4k/core/smb4ksettings.cpp:349 +msgid "" +"Try to authenticate with Kerberos. This is only useful in an Active " +"Directory environment. The setting affects the smbmount and smbclient " +"command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:352 +#, fuzzy +msgid "Use machine account for login" +msgstr "Usa il nome utente predefinito" + +#: smb4k/core/smb4ksettings.cpp:353 +msgid "" +"Make queries to the remote server using the machine account of the local " +"server. The setting affects the net and the smbclient command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:367 +#, fuzzy +msgid "The file system that is used for mounting remote shares" +msgstr "Utilizza il seguente file system per montare le condivisioni remote:" + +#: smb4k/core/smb4ksettings.cpp:368 +msgid "" +"This is the file system that will be used to mount the remote shares. The " +"Common Internet File System (CIFS) is supported by Windows 2000 and above as " +"well as by Samba. It offers many improvements and advancements compared to " +"the Server Message Block File System (SMBFS) which is used by Windows 9x and " +"below." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:487 +msgid "The charset used by the client" +msgstr "Set di caratteri usato dal client" + +#: smb4k/core/smb4ksettings.cpp:488 +msgid "" +"This is the charset that is used by the client side (i.e. your side) either " +"to convert local path names to and from Unicode in case of the CIFS file " +"system or for codepage to charset translations (NLS) in case of the SMBFS " +"file system. If you keep the default setting, Smb4K will try to " +"automatically determine the charset by looking up the \"unix charset\" " +"option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:657 +msgid "The codepage used by the server" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:658 +msgid "" +"This is the codepage that is used by the server. The setting is only " +"available with the SMBFS file system. If you keep the default setting, Smb4K " +"will try to automatically determine the codepage by looking up the \"dos " +"charset\" option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:661 +#, fuzzy +msgid "The user ID that is to be used for mounting" +msgstr "Utilizza il seguente file system per montare le condivisioni remote:" + +#: smb4k/core/smb4ksettings.cpp:662 +msgid "" +"Here you can enter the user ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:665 +#, fuzzy +msgid "The group ID that is to be used for mounting" +msgstr "Utilizza il seguente file system per montare le condivisioni remote:" + +#: smb4k/core/smb4ksettings.cpp:666 +msgid "" +"Here you can enter the group ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:669 +msgid "The file mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:670 +msgid "" +"This is the mask that will be used for creating files. It must be defined in " +"octal. In case the CIFS file system is used, this setting only takes effect " +"if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:673 +msgid "The directory mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:674 +msgid "" +"This is the mask that will be used for creating directories. It must be " +"defined in octal. In case the CIFS file system is used, this setting only " +"takes effect if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:688 +msgid "The write access granted for the share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:689 +msgid "" +"Here you can choose if the shares should be mounted in read and write mode " +"or only read-only." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:693 +msgid "" +"The client side (i.e. your side) will check if you have the right UID/GID to " +"manipulate a file or directory. You might want to switch this feature off if " +"the server(s) support the CIFS Unix Extensions and you are not allowed to " +"access the files and directories. This setting does not affect the normal " +"ACL check." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:696 +msgid "Set UID and GID" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:697 +msgid "" +"In case the server supports the CIFS Unix Extensions, the client side (i.e. " +"your side) attempts to set the effective UID and GID of the current process " +"on newly created files, directories and devices. If this feature is turned " +"off, the default UID and GID defined for the share will be used. It is " +"recommended that you read the manual page of mount.cifs before you change " +"this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:701 +msgid "" +"Use inode numbers (unique persistent file identifiers) returned by the " +"server instead of automatically generating temporary inode numbers on the " +"client side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:705 +msgid "" +"Directly read from and write to files opened on the share. In some cases " +"this can provide better performance than the default behavior which caches " +"reads and writes." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:709 +msgid "" +"Translate six of the seven reserved characters (including the colon, " +"question mark, pipe, asterisk, greater than and less than characters but not " +"the backslash) to remap range (above 0xF000). This allows you to open files " +"that were created with such characters. This has no effect if the server " +"does not support Unicode." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:713 +msgid "Do not use locking. Do not start lockd." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:716 +msgid "Advanced custom options for the CIFS file system" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:717 +msgid "" +"Here you can enter advanced options for the CIFS file system in a comma-" +"separated list (refer to the manual page of mount.cifs to learn more). The " +"list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not " +"enter options that have already been defined in the configuration dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:720 +msgid "Determines how long directory listings are cached" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:721 +msgid "" +"This setting determines how long a directory listing is cached in " +"milliseconds. A high value means it takes longer until changes on the server " +"are noticed on the client side (i.e. your side), but it can also give you an " +"increase in performance on large directories, especially on long distances. " +"You need Linux kernel 2.4.2 or later to take advantage of this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:724 +msgid "Unicode support" +msgstr "Supporto Unicode" + +#: smb4k/core/smb4ksettings.cpp:725 +msgid "" +"Use Unicode when communicating with the server. This will give you better " +"support for non-ASCII character sets with the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:728 +msgid "Long file support" +msgstr "Supporto file lunghi" + +#: smb4k/core/smb4ksettings.cpp:729 +msgid "" +"Large file support (LFS) enables you to read and write \n" +"files bigger than 2 GB on shares that were mounted with the SMBFS file " +"system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:754 +msgid "The protocol that is used with the net command" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:755 +msgid "" +"Here you can choose the protocol that will be used by the net command for " +"the communication with remote servers if appropriate. In most cases the " +"automatic detection will work fine and you should not need to change the " +"default setting. However, if you experience problems, use the RPC protocol " +"for newer operating systems (Windows NT4 and above) and the RAP protocol for " +"older ones (Windows 98/NT3 and below). Functions that need the ADS protocol " +"(for Active Directory environments) have not been implemented yet, so you " +"can ignore that one for now." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:758 +#, fuzzy +msgid "Name resolve order used by smbclient" +msgstr "Ordine di risoluzione:" + +#: smb4k/core/smb4ksettings.cpp:759 +msgid "" +"This option is used to determine what naming services and in what order are " +"used to resolve host names and IP addresses. It takes a space-separated list " +"of up to four different name resolution options. Those are: lmhost, host, " +"wins, bcast. See the manual page of smbclient for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:763 +msgid "Transmit/send buffer size used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:764 +msgid "" +"This option changes the transmit/send buffer size when getting or putting a " +"file from/to the server. The default is 65520 bytes. Setting this value " +"smaller has been observed to speed up file transfers to and from Windows 9x " +"servers." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:788 +msgid "Signing state" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:789 +msgid "Set the signing state for smbclient." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:792 +msgid "The broadcast address used by nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:793 +msgid "" +"Queries performed with nmblookup will be send to the given broadcast " +"address. Without this option the default behavior is to send the queries to " +"the broadcast address of the network interface that was either auto-detected " +"or defined in the \"interfaces\" parameter of the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:796 +msgid "Use UDP port 137 with nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:797 +msgid "" +"Try and bind to UDP port 137 to send and receive UDP datagrams. The reason " +"for this option is a bug in Windows 95 where it ignores the source port of " +"the requesting packet and only replies to UDP port 137. Unfortunately, on " +"most Unix systems super user privileges are needed to bind to this port. " +"Please read the manual page of nmblookup for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:803 +msgid "Prefix for synchronization" +msgstr "Prefisso per la sincronizzazione" + +#: smb4k/core/smb4ksettings.cpp:804 +msgid "" +"This is the path where Smb4K will store the files and directories during " +"synchronization. If you plan to synchronize only with one remote share, then " +"you can put the data directly in this directory. If you want to synchronize " +"with several remote shares, then you should create a subdirectory for each " +"share and choose the appropriate one in the synchronization dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:807 +msgid "Use archive mode" +msgstr "Utilizza modalità archivio" + +#: smb4k/core/smb4ksettings.cpp:808 +msgid "Use archive mode (-a, --archive). This is a short form of -rlptgoD." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:811 +msgid "Recurse into subdirectories" +msgstr "Ricorsione selle sottodirectory" + +#: smb4k/core/smb4ksettings.cpp:812 +msgid "Recurse into directories (-r, --recursive)." +msgstr "Ricorsione nelle directory (-r, --recursive)." + +#: smb4k/core/smb4ksettings.cpp:815 +#, fuzzy +msgid "Skip files that are newer in the target directory" +msgstr "Salta i file che sono più recenti nella destinazione" + +#: smb4k/core/smb4ksettings.cpp:816 +msgid "" +"Update files in the destination directory that are older than in the source " +"directory (-u, --update)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:820 +msgid "" +"Update destination files in-place (--inplace). By default, rsync first " +"creates a new copy of a file and moves it into place after its transfer " +"finished. If you enable this feature, no copy will be created but the " +"destination file will immediately be overwritten instead. An exception to " +"this is if you combine this option with --backup." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:824 +msgid "" +"Use relative paths (-R, --relative). This means that the full path names " +"specified on the command line are sent to the server rather than just the " +"last parts of the file names." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:827 +msgid "Don't send implied directories with --relative" +msgstr "Non inviare le directory sottintese con --relative" + +#: smb4k/core/smb4ksettings.cpp:828 +msgid "" +"Don't send implied directories with --relative (--no-implied-dirs). This " +"means that the corresponding path elements on the destination system are " +"left unchanged if they exist, and any missing implied directories are " +"created with default attributes. This even allows these implied path " +"elements to have big differences, such as being a symlink to a directory on " +"one side of the transfer, and a real directory on the other side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:832 +msgid "" +"Transfer directories without recursing (-d, --dirs). This means that all top-" +"level subdirectories are transferred but without their contents." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:836 +msgid "" +"Compress data during transfer (-z, --compress). This significantly reduces " +"the amount of data that is being transferred. You may want to use this " +"option, if you have a slow connection." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:840 +msgid "Copy symlinks as symlinks (-l, --links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:844 +msgid "" +"Transform symlinks into the items they are pointing to (-L, --copy-links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:848 +msgid "" +"Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-" +"links). This means that only those symlinks are transformed that point to " +"items that are outside the copied tree. Absolute symlinks are treated the " +"same way. This option has no additional effect if --copy-links has also been " +"specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:852 +msgid "" +"Ignore symlinks that point outside the copied tree (--safe-links). All " +"absolute symlinks are also ignored. If you use this option in conjunction " +"with --relative you might get unexpected results." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:856 +msgid "" +"Preserve hard links (-H, --hard-links). This options causes rsync to " +"preserve the hard links that are found during the transfer. Without it, hard " +"links are treated as though they were separate files." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:860 +msgid "" +"Treat symlinked directories on the receiving side as though they were real " +"ones (-K, --keep-dirlinks). This only works if the symlink matches a real " +"directory from the sending side. Without this option, the receiver's symlink " +"will be deleted and replaced with a real directory." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:864 +msgid "" +"Preserve permissions (-p, --perms). The permissions of the destination file " +"will be same as the source file. For what happens if this option is switched " +"off, please read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:868 +msgid "" +"Preserve the group (-g, --group). The group of the destination file will be " +"set to the same value as the source file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:871 +msgid "Preserve owner (super user only)" +msgstr "Mantieni il proprietario (solo Amministratore)" + +#: smb4k/core/smb4ksettings.cpp:872 +msgid "" +"Preserve the owner (-o, --owner). The owner of the destination file will be " +"set to the same value as the source file, but only if the receiving rsync is " +"run as the super user. Without this option, the owner is set to the invoking " +"user on the receiving side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:876 +msgid "" +"Preserve device and special files (-D, --devices --specials). This option " +"causes rsync to transfer character and block devices as well as special " +"files such as named sockets and fifos. It works only partially if rsync is " +"not run as super user and the --super option is not specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:880 +msgid "" +"Preserve times (-t, --times). The modification times are transferred along " +"with the files. For what happens if this option is switched off, please read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:884 +msgid "" +"Omit directories when preserving times (-O, --omit-dir-times). This means " +"that directories are omitted when modification times are being preserved. " +"Thus, this feature only works in conjunction with --times." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:888 +msgid "" +"Remove all synchronized source files (--remove-source-files). This tells " +"rsync to remove from the sending side the non-directory items that are a " +"part of the transfer and have been successfully duplicated on the receiving " +"side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:892 +msgid "" +"Delete extraneous files from destination (--delete). This tells rsync to " +"delete all files from the receiving side that are not present on the sending " +"side, but only for the directories that are being synchronized." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:896 +msgid "" +"Delete files on the receiving side before the transfer starts (--delete-" +"before). This is the default behavior if --delete or --delete-excluded is " +"specified without one of the --delete-WHEN options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:900 +msgid "" +"Delete files on the receiving side after the transfer has completed (--" +"delete-after, --del)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:904 +msgid "" +"Delete files on the receiving side during the transfer (--delete-during). " +"This method is faster than --delete-before or --delete-after, but it is only " +"supported with rsync 2.6.4 or later." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:907 +#, fuzzy +msgid "Also delete excluded files from destination directory" +msgstr "Elimina anche i file nella destinazione esclusi" + +#: smb4k/core/smb4ksettings.cpp:908 +msgid "" +"Also delete excluded files from destination directory (--delete-excluded). " +"In addition to deleting the files on the receiving side that are not on the " +"sending side, this tells rsync to also delete any files on the receiving " +"side that are excluded. Refer to rsync's manual page for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:912 +msgid "" +"Delete even if I/O errors occur (--ignore-errors). This option has to be " +"specified in conjunction with --delete to take effect." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:916 +msgid "" +"Force deletion of directories even if they are not empty (--force). This " +"option tells rsync to delete a non-empty directory when it is to be replaced " +"by a non-directory. This is only relevant if deletions are not active." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:919 +msgid "Only delete a maximum number of files" +msgstr "Cancella solo un numero massimo di file" + +#: smb4k/core/smb4ksettings.cpp:920 +msgid "" +"Only delete as many files as defined here (--max-delete=NUM). This tells " +"rsync not to delete more than NUM files or directories (NUM must be non-" +"zero). This is useful when mirroring very large trees to prevent disasters." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:924 +msgid "Value for DeleteMaximum config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:927 smb4k/core/smb4ksettings.cpp:935 +msgid "Don't transfer any file smaller than SIZE" +msgstr "Non trasferire file più piccoli di SIZE" + +#: smb4k/core/smb4ksettings.cpp:928 +msgid "" +"This option causes rsync to not transfer any file that is smaller than the " +"specified size (--min-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:932 +msgid "Value for MinimalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:936 +msgid "" +"This option causes rsync to not transfer any file that is larger than the " +"specified size (--max-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:940 +msgid "Value for MamximalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:944 +msgid "" +"Keep partially transferred files (--partial). The default behavor is that " +"any partially transferred file is deleted if the transfer is interrupted." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:947 +#, fuzzy +msgid "The directory where to put a partially transferred file into." +msgstr "Conserva i file parzialmente trasferiti in" + +#: smb4k/core/smb4ksettings.cpp:948 +msgid "" +"Put a partially transferred file into this directory (--partial-dir=DIR). " +"This is a better way than the --partial option to keep partial files, " +"because the partially transferred file is kept in a different directory and " +"the destination file is not overwritten." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:951 +msgid "The data for the UsePartialDirectory option" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:955 +msgid "" +"Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a " +"useful shorthand for excluding a broad range of files that you often do not " +"want to transfer between systems. This option uses the same algorithm that " +"CVS uses to determine if a file should be ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:958 +msgid "Exclude files that match a certain pattern" +msgstr "Escludi i file che corrispondono a questo schema" + +#: smb4k/core/smb4ksettings.cpp:959 +msgid "" +"Exclude files that match a certain pattern (--exclude=PATTERN). This is a " +"special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:962 +msgid "Pattern that is used for file exclusion" +msgstr "Schema usato per l'esclusione di file" + +#: smb4k/core/smb4ksettings.cpp:965 +msgid "Read exclude patterns from a file" +msgstr "Preleva gli schemi di esclusione da un file" + +#: smb4k/core/smb4ksettings.cpp:966 +msgid "" +"Read exclude patterns from a file (--exclude-from=FILE). This option is " +"similar to the --exclude=PATTERN option except that the exclude patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:969 +msgid "The file from which the exclude patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:972 +msgid "Do not exclude files matching a certain pattern" +msgstr "Non escludere i file che corrispondono a questo schema" + +#: smb4k/core/smb4ksettings.cpp:973 +msgid "" +"Do not exclude files matching a certain pattern (--include=PATTERN). This is " +"a special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:976 +msgid "Pattern that is used for file inclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:979 +msgid "Read include patterns from a file" +msgstr "Preleva gli schemi di inclusione da un file" + +#: smb4k/core/smb4ksettings.cpp:980 +msgid "" +"Read include patterns from a file (--include-from=FILE). This option is " +"similar to the --include=PATTERN option except that the include patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:983 +msgid "The file from which the include patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:986 +msgid "Add custom file-filtering rules" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:987 +msgid "" +"Add custom file-filtering rules (-f, --filter=RULE). This option allows you " +"to add rules to selectively exclude certain files from the list of files to " +"be transferred." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:990 +msgid "Use -F filter rule" +msgstr "Usa la regola di filtraggio -F" + +#: smb4k/core/smb4ksettings.cpp:991 +msgid "" +"This filter rule tells rsync to look for per-directory .rsync-filter files " +"that have been sprinkled through the hierarchy and use their rules to filter " +"the files in the transfer. It has no effect, if you also choose to use the --" +"filter='exclude .rsync-filter' rule." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:994 +msgid "Use -FF filter rule" +msgstr "Usa la regola di filtraggio -FF" + +#: smb4k/core/smb4ksettings.cpp:995 +msgid "" +"This rule filters out the .rsync-filter files from the transfer. These files " +"normally contain filter rules that can be activated by choosing the --" +"filter='dir-merge /.rsync-filter' rule and deselecting this one." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:999 +msgid "" +"Handle sparse files efficiently (-S, --sparse) so that they take up less " +"space on the destination. This option conflicts with --inplace. For further " +"information read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1003 +msgid "" +"Copy files whole (-W, --whole-file). With this option the incremental rsync " +"algorithm is not used and the whole file is sent as-is instead." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1006 +msgid "Do not cross file system boundaries" +msgstr "Non oltrepassare i limiti del file system" + +#: smb4k/core/smb4ksettings.cpp:1007 +msgid "" +"Do not cross file system boundaries (-x, --one-file-system). This tells " +"rsync to avoid crossing a filesystem boundary when recursing. For further " +"information on this option, read the manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1010 +msgid "Skip creating new files on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1011 +msgid "" +"Skip creating new files on the receiving side (--existing). This tells rsync " +"to skip creating files (including directories) that do not exist yet on the " +"destination. If this option is combined with the --ignore-existing option, " +"no files will be updated (which can be useful if all you want to do is to " +"delete extraneous files)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1014 +msgid "Skip updating files that exist on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1015 +msgid "" +"Skip updating files that already exist on the receiving side (--ignore-" +"existing). Existing directories are not ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1018 +msgid "Delay updates until the end of the transfer" +msgstr "Ritarda l'aggiornamento alla fine del trasferimento" + +#: smb4k/core/smb4ksettings.cpp:1019 +msgid "" +"Delay updates until the end of the transfer (--delay-updates). This option " +"puts the temporary file from each updated file into a holding directory " +"until the end of the transfer, at which time all the files are renamed and " +"copied into place in rapid succession." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1023 +msgid "" +"Make backups (-b, --backup). With this option, preexisting destination files " +"are renamed as each file is transferred or deleted. You can control where " +"the backup file goes and what (if any) suffix gets appended using the --" +"backup-dir=DIR and --suffix=SUFFIX options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1026 +msgid "Use a suffix for backups" +msgstr "Usa un suffisso per i backup" + +#: smb4k/core/smb4ksettings.cpp:1027 +msgid "Use this suffix for backups (--suffix=SUFFIX)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1030 +msgid "Backup suffix" +msgstr "Suffisso di backup" + +#: smb4k/core/smb4ksettings.cpp:1033 +msgid "Put backups into a certain directory" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1034 +msgid "Store backups in this directory (--backup-dir=DIR)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1037 +msgid "Backup directory" +msgstr "Directory di Backup" + +#: smb4k/core/smb4ksettings.cpp:1040 +msgid "Force a fixed checksum block-size" +msgstr "Forza una dimensione fissa dei blocchi per il checksum" + +#: smb4k/core/smb4ksettings.cpp:1041 +msgid "" +"Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the " +"block size used in the rsync algorithm to a fixed value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1045 +msgid "The block size" +msgstr "Dimensione del blocco" + +#: smb4k/core/smb4ksettings.cpp:1048 +msgid "Set block/file checksum seed" +msgstr "Imposta il seme per il checksum del blocco/file" + +#: smb4k/core/smb4ksettings.cpp:1049 +msgid "" +"Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum " +"seed to this integer. This 4 byte checksum seed is included in each block " +"and file MD4 checksum calculation. By default the checksum seed is generated " +"by the server and defaults to the current time." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1053 +msgid "The checksum seed" +msgstr "Seme per il checksum" + +#: smb4k/core/smb4ksettings.cpp:1056 +msgid "Skip files based on a checksum" +msgstr "Salta file basati su un checksum" + +#: smb4k/core/smb4ksettings.cpp:1057 +msgid "" +"Skip files based on a checksum and not based on modification time and size (-" +"c, --checksum). For further information on how this feature works read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1074 +msgid "The program that should be used to gain super user privileges" +msgstr "Programma utilizzato per ottenere i privilegi di amministratore" + +#: smb4k/core/smb4ksettings.cpp:1075 +msgid "" +"Choose the program that will grant you limited super user privileges for " +"mounting and unmounting remote shares. You can either select sudo, the " +"standard tool for this purpose on most distributions, or super." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1078 +msgid "Use super user privileges to unmount inaccessible shares" +msgstr "" +"Usa i privilegi di Amministratore per smontare le condivisioni inaccessibili" + +#: smb4k/core/smb4ksettings.cpp:1079 +msgid "" +"Unmount a share under Linux by force. This even works if the file system is " +"\"busy\", because it is immediately detached from the file system hierarchy " +"and all references to it are cleaned up later when it is not busy anymore. " +"Linux kernel 2.4.11 or later is needed to take advantage of this feature. " +"Use with case! Note, that you will need the root password to write the " +"necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1083 +msgid "" +"Use super user privileges for mounting and unmounting remote shares. This " +"feature is only needed, if you are not allowed to use smbmount, smbumount, " +"mount.cifs and umount.cifs as normal user. Note, that you will need the root " +"password to write the necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:42 +msgid "" +"The browse list could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:46 +#, fuzzy +msgid "" +"The browse list could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:55 +msgid "" +"The list of servers could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:59 +#, fuzzy +msgid "" +"The list of servers could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:68 +msgid "" +"The list of shares could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:72 +#, fuzzy +msgid "" +"The list of shares could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:81 +msgid "" +"The preview could not be compiled.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:85 +#, fuzzy +msgid "" +"The preview could not be compiled.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:92 +#, fuzzy +msgid "" +"The wallet \"%1\" could not be opened. KWallet support will be disabled for " +"this session." +msgstr "" +"Il portafogli \"%1\" non può essere aperto. Il supporto a KWallet verrà " +"disabilitato." + +#: smb4k/core/smb4kerror.cpp:100 +msgid "" +"Some file permissions could not be determined.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:104 +#, fuzzy +msgid "" +"Some file permissions could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:111 +#, fuzzy +msgid "" +"You are not allowed to unmount this share, because it is owned by another " +"user." +msgstr "Non è consentito smontare questa condivisione." + +#: smb4k/core/smb4kerror.cpp:119 +msgid "" +"The share \"%1\" could not be mounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:123 +#, fuzzy +msgid "" +"The share \"%1\" could not be mounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:132 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:136 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:143 +msgid "The file \"%1\" could not be found." +msgstr "Non è stato possibile trovare il file \"%1\"." + +#: smb4k/core/smb4kerror.cpp:151 +msgid "The file \"%1\" could not be read." +msgstr "Non è stato possibile leggere il file \"%1\"." + +#: smb4k/core/smb4kerror.cpp:155 +#, fuzzy +msgid "" +"The file \"%1\" could not be read.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:164 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:168 +#, fuzzy +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:175 +#, fuzzy +msgid "" +"Either your PATH environment variable is not set properly or there are the " +"following programs missing on your system:\n" +"%1\n" +"Please correct this and restart Smb4K." +msgstr "" +"La variabile di ambiente PATH non è impostata correttamente o i seguenti " +"programmi non sono installati nel sistema:\n" +"%1\n" +"Per favore, risolvere il problema e riavviare Smb4K." + +#: smb4k/core/smb4kerror.cpp:181 +#, fuzzy +msgid "" +"The file \"%1\" is currently being edited by user %2. To avoid any problems, " +"access to this file is denied at the moment. Please try again later." +msgstr "" +"Il file %1 è in questo momento aperto dall'utente %2. Riprovare più tardi." + +#: smb4k/core/smb4kerror.cpp:187 +#, fuzzy +msgid "The directory \"%1\" could not be created." +msgstr "Non è stato possibile creare la cartella %1." + +#: smb4k/core/smb4kerror.cpp:193 +#, fuzzy +msgid "The file \"%1\" could not be written." +msgstr "Non è stato possibile leggere il file %1." + +#: smb4k/core/smb4kerror.cpp:199 +#, fuzzy +msgid "" +"The share could not be unmounted, because the mount point string was empty." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:205 +msgid "This feature has not been enabled." +msgstr "Questa funzionalità non è stata attivata." + +#: smb4k/core/smb4kerror.cpp:211 +msgid "Printers cannot be bookmarked." +msgstr "Le stampanti non possono essere aggiunte ai segnalibri." + +#: smb4k/core/smb4kerror.cpp:217 +#, fuzzy +msgid "" +"IP addresses are not supported with this search method. Please choose \"Use " +"nmblookup\" in the configuration dialog and try again." +msgstr "" +"Il metodo di ricerca selezionato (smbclient) non può gestire correttamente " +"gli indirizzi IP. Per favore, scegliere \"Usa nmblookup\" nella finestra di " +"configurazione e ritentare." + +#: smb4k/core/smb4kerror.cpp:225 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:229 +#, fuzzy +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:236 +#, fuzzy +msgid "The command \"%1\" could not be found." +msgstr "Non è stato possibile trovare il comando %1." + +#: smb4k/core/smb4kerror.cpp:244 +msgid "" +"The file \"%1\" could not be printed.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:248 +#, fuzzy +msgid "" +"The file \"%1\" could not be printed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:257 +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:261 +#, fuzzy +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:270 +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:274 +#, fuzzy +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:281 +#, fuzzy +msgid "The directory \"%1\" could not be found." +msgstr "Non è stato possibile trovare la directory %1." + +#: smb4k/core/smb4kerror.cpp:287 +msgid "" +"The file \"%1\" is irregular. That means it is either a symlink, a fifo, or " +"something similar. This could indicate that someone is trying to exploit " +"your system. Please inform your system administrator." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:295 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:299 +#, fuzzy +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:308 +#, fuzzy +msgid "The file \"%1\" could not be opened." +msgstr "Non è stato possibile aprire il file %1." + +#: smb4k/core/smb4kerror.cpp:312 +#, fuzzy +msgid "" +"The file \"%1\" could not be opened.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:321 +#, fuzzy +msgid "The file \"%1\" could not be closed." +msgstr "Non è stato possibile aprire il file %1." + +#: smb4k/core/smb4kerror.cpp:325 +#, fuzzy +msgid "" +"The file \"%1\" could not be closed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:332 +msgid "" +"The list of arguments for the \"net\" command could not be assembled.\n" +"At the moment it reads: %1" +msgstr "" + +#: smb4k/core/smb4kerror.cpp:340 +#, fuzzy +msgid "The list of supplementary group IDs could not be determined." +msgstr "Non è stato possibile determinare l'utilizzazione del disco." + +#: smb4k/core/smb4kerror.cpp:344 +#, fuzzy +msgid "" +"The list of supplementary group IDs could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:354 +msgid "" +"An unknown error occurred.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:358 +#, fuzzy +msgid "" +"An unknown error occurred.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Non è stato possibile smontare questa condivisione, la stringa del punto di " +"montaggio è vuota." + +#: smb4k/core/smb4kerror.cpp:385 +#, fuzzy +msgid "" +"The mimetype \"%1\" is not supported. Please convert the file to PostScript " +"or PDF." +msgstr "" +"Il tipo MIME \"%1\" non è supportato. Per favore, convertire il file in " +"Postscript o PDF." + +#: smb4k/core/smb4kerror.cpp:391 +#, fuzzy +msgid "" +"You previously chose to use \"%1\", but now it is missing on your system. " +"Smb4K will disable this feature." +msgstr "" +"E' stato precedentemente scelto di utilizzare il programma %1 ma questo non " +"risulta installato sul sistema. Smb4K disabiliterà questa funzionalità." + +#: smb4k/core/smb4kerror.cpp:397 +msgid "" +"The label \"%1\" is used more than once. It will automatically be renamed " +"for bookmark \"%2\" to avoid confusion." +msgstr "" + +#: smb4k/core/smb4kpasswordhandler.cpp:258 +msgid "The access was denied. " +msgstr "L'accesso è stato negato." + +#: smb4k/core/smb4kpasswordhandler.cpp:261 +msgid "The password is not correct. " +msgstr "La password non è corretta.\t" + +#: smb4k/core/smb4kpasswordhandler.cpp:264 +msgid "The permission was denied. " +msgstr "Il permesso è stato negato." + +#: smb4k/core/smb4kpasswordhandler.cpp:267 +msgid "An authentication error occurred. " +msgstr "Si è verificato un errore di autenticazione." + +#: smb4k/core/smb4kpasswordhandler.cpp:270 +msgid "The logon failed. " +msgstr "L'accesso non è riuscito." + +#: smb4k/core/smb4kpasswordhandler.cpp:278 +msgid "Please enter authentication data for server %1." +msgstr "Inserire le informazioni di autenticazione per il server %1." + +#: smb4k/core/smb4kpasswordhandler.cpp:282 +msgid "Please enter authentication data for share %1." +msgstr "Inserire le informazioni di autenticazione per la condivisione %1." + +#: smb4k/core/smb4knetworkitems.cpp:202 +msgid "Disk" +msgstr "Disco" + +#: smb4k/core/smb4knetworkitems.cpp:206 smb4k/dialogs/smb4kprintdialog.cpp:71 +msgid "Printer" +msgstr "Stampante" + +#: smb4k/core/smb4khomesshareshandler.cpp:73 +msgid "Specify User" +msgstr "Specificare un utente" + +#: smb4k/core/smb4khomesshareshandler.cpp:74 +msgid "Clear List" +msgstr "Cancella" + +#: smb4k/core/smb4khomesshareshandler.cpp:87 +msgid "Please specify a user name." +msgstr "Per favore, specificare un nome utente." + +#: smb4k/listview/smb4kshareslistview.cpp:52 +msgid "Owner" +msgstr "Proprietario" + +#: smb4k/listview/smb4kshareslistview.cpp:54 +msgid "Login" +msgstr "Login" + +#: smb4k/listview/smb4kshareslistview.cpp:57 +msgid "Free" +msgstr "Libero" + +#: smb4k/listview/smb4kshareslistview.cpp:58 +msgid "Used" +msgstr "Utilizzato" + +#: smb4k/listview/smb4kshareslistview.cpp:59 +msgid "Total" +msgstr "Totale" + +#: smb4k/listview/smb4kshareslistview.cpp:60 +msgid "Usage" +msgstr "Utilizzo" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:122 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:122 +msgid "Mount point:" +msgstr "Punto di montaggio:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:211 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:211 +msgid "Free:" +msgstr "Libero:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:215 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:215 +msgid "Used:" +msgstr "Utilizzato:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:219 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:219 +msgid "Total:" +msgstr "Totale:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:223 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:223 +msgid "Usage:" +msgstr "Utilizzo:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:229 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:388 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:229 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:388 +msgid "This share is inaccessible." +msgstr "Condivisione inaccessbile." + +#: smb4k/listview/smb4kshareslistview_part.cpp:115 +#: smb4k/smb4ksystemtray.cpp:794 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:112 +msgid "&Force Unmounting" +msgstr "&Forza smontaggio" + +#: smb4k/listview/smb4kshareslistview_part.cpp:119 +#: smb4k/smb4ksystemtray.cpp:446 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:116 +#, fuzzy +msgid "U&nmount All" +msgstr "Smonta tutto" + +#: smb4k/listview/smb4kshareslistview_part.cpp:122 +#: smb4k/smb4ksystemtray.cpp:799 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:119 +msgid "S&ynchronize" +msgstr "S&incronizza" + +#: smb4k/listview/smb4kshareslistview_part.cpp:125 +#: smb4k/smb4ksystemtray.cpp:804 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:122 +msgid "Open with Konso&le" +msgstr "Apri con Konso&le" + +#: smb4k/listview/smb4kshareslistview_part.cpp:128 +#: smb4k/smb4ksystemtray.cpp:809 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:125 +msgid "Open with &Konqueror" +msgstr "Apri con &Konqueror" + +#: smb4k/listview/smb4kshareslistview_part.cpp:676 +msgid "Smb4KSharesListViewPart" +msgstr "" + +#: smb4k/searchdlg/smb4ksearchdialog_part.cpp:254 +#, fuzzy +msgid "Smb4KSearchDialogPart" +msgstr "Finestra di Ricerca" + +#: smb4k/searchdlg/smb4ksearchdialogitem.cpp:80 +msgid "The search failed." +msgstr "La ricerca è fallita." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:52 +msgid "Enter the search string here." +msgstr "Inserire qui l'host da cercare." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:57 plugin/smb4k_konqplugin.cpp:71 +msgid "Search" +msgstr "Cerca" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:63 +msgid "Search Results" +msgstr "Risultati della ricerca." + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize" +msgstr "Sincronizza" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize the destination with the source" +msgstr "Sincronizza destinazione con sorgente" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap Paths" +msgstr "Scambia i percorsi" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap source and destination" +msgstr "Scambia l'origine con la destinazione" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:60 +msgid "Source:" +msgstr "Sorgente:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:65 +msgid "Destination:" +msgstr "Destinazione:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:85 +msgid "Files transferred:" +msgstr "File trasferiti:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:90 +msgid "Transfer rate:" +msgstr "Velocità di trasferimento:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:46 +msgid "Print File" +msgstr "Stampa il file" + +#: smb4k/dialogs/smb4kprintdialog.cpp:74 +msgid "Name:" +msgstr "Nome:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:98 +msgid "File:" +msgstr "File:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:107 +msgid "Copies:" +msgstr "Copie:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:155 +msgid "You haven't specified a file." +msgstr "Non è stato specificato alcun file." + +#: smb4k/dialogs/smb4kmountdialog.cpp:48 +msgid "Mount Share" +msgstr "Monta condivisione" + +#: smb4k/dialogs/smb4kmountdialog.cpp:75 +msgid "IP Address:" +msgstr "Indirizzo IP:" + +#: smb4k/dialogs/smb4kmountdialog.cpp:83 +msgid "Add this share to the bookmarks" +msgstr "Aggiungi questa condivisione ai segnalibri" + +#: smb4k/dialogs/smb4kmountdialog.cpp:140 +msgid "" +"The format of the share you entered is not correct. It must have the form //" +"HOST/SHARE." +msgstr "" +"La condivisione inserita non è valida. È necessario usare la forma //HOST/" +"CONDIVISIONE." + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:46 +msgid "Preview" +msgstr "Anteprima" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:111 +msgid "Forward" +msgstr "Avanti" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:112 +msgid "Up" +msgstr "Su" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:93 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:106 +msgid "Custom Options" +msgstr "Opzioni Personalizzate" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:185 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:301 +msgid "Try to authenticate with Kerberos (Active Directory)" +msgstr "Tenta l'autenticazione con Kerberos (Active Directory)" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:52 +msgid "Bookmark Editor" +msgstr "Gestore dei segnalibri" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:61 +msgid "Bookmark" +msgstr "Segnalibro" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:62 +msgid "Workgroup" +msgstr "Gruppo di lavoro" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:64 +msgid "Label" +msgstr "Etichetta" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:76 +msgid "Remove &All" +msgstr "Rimuovi tutti" + +#: smb4k/smb4ksystemtray.cpp:59 smb4k/main.cpp:64 +msgid "Smb4K" +msgstr "Smb4K" + +#: smb4k/main.cpp:51 +msgid "" +"Smb4K is an advanced network neighborhood browser and a\n" +"front end to the programs of the Samba software suite." +msgstr "" +"Smb4K è un browser di rete avanzato e un'interfaccia alle applicazioni del " +"pacchetto software Samba." + +#: smb4k/main.cpp:66 +msgid "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" +msgstr "" + +#: smb4k/main.cpp:69 smb4k/main.cpp:70 smb4k/main.cpp:71 +msgid "Developer" +msgstr "Sviluppatore" + +#: smb4k/main.cpp:74 +msgid "Catalan translation" +msgstr "Traduzione catalana" + +#: smb4k/main.cpp:75 smb4k/main.cpp:100 +msgid "Polish translation" +msgstr "Traduzione polacca" + +#: smb4k/main.cpp:76 +msgid "Chinese Simplified translation" +msgstr "Traduzione cinese (semplificato)" + +#: smb4k/main.cpp:77 +msgid "Russian translation" +msgstr "Traduzione russa" + +#: smb4k/main.cpp:78 +msgid "Swedish translation and intensive testing" +msgstr "Traduzione svedese e testing intensivo" + +#: smb4k/main.cpp:79 smb4k/main.cpp:96 +msgid "Brazilian Portuguese translation" +msgstr "Traduzione portoghese-brasiliana" + +#: smb4k/main.cpp:80 +msgid "Ukrainian translation" +msgstr "Traduzione ucraina" + +#: smb4k/main.cpp:81 +msgid "Hungarian translation" +msgstr "Traduzione ungherese" + +#: smb4k/main.cpp:82 smb4k/main.cpp:90 +msgid "Spanish translation" +msgstr "Traduzione spagnola" + +#: smb4k/main.cpp:83 +msgid "Slovak translation" +msgstr "Traduzione slovacca" + +#: smb4k/main.cpp:84 +msgid "French translation" +msgstr "Traduzione francese" + +#: smb4k/main.cpp:85 +msgid "Japanese translation" +msgstr "Traduzione giapponese" + +#: smb4k/main.cpp:86 +msgid "Bulgarian translation" +msgstr "Traduzione bulgara" + +#: smb4k/main.cpp:87 +msgid "Italian translation" +msgstr "Traduzione italiana" + +#: smb4k/main.cpp:88 +msgid "Norwegian translations" +msgstr "Traduzione norvegese" + +#: smb4k/main.cpp:89 +msgid "Czech translation" +msgstr "Traduzione ceca" + +#: smb4k/main.cpp:91 smb4k/main.cpp:97 +msgid "Turkish translation" +msgstr "Traduzione turca" + +#: smb4k/main.cpp:92 smb4k/main.cpp:98 +msgid "Chinese Traditional translation" +msgstr "Traduzione cinese tradizionale" + +#: smb4k/main.cpp:93 +msgid "Icelandic translation" +msgstr "Traduzione islandese" + +#: smb4k/main.cpp:94 +msgid "Danish translation" +msgstr "Traduzione danese" + +#: smb4k/main.cpp:95 +msgid "Dutch translation" +msgstr "Traduzione olandese" + +#: smb4k/main.cpp:99 +msgid "Testing of Smb4K under FreeBSD" +msgstr "Testing di Smb4K con FreeBSD" + +#: smb4k/main.cpp:129 +msgid "" +"Smb4K now uses a different configuration system. Thus, your old settings are " +"obsolete and you have to reconfigure the application.\n" +"To assure a clean transition, the current configuration file will be removed." +msgstr "" + +#: smb4k/iconview/smb4ksharesiconview_part.cpp:549 +msgid "Smb4KSharesIconViewPart" +msgstr "" + +#. i18n: file ./smb4k/smb4k_shell.rc line 7 +#. i18n: file ./smb4k/browser/smb4knetworkbrowser_part.rc line 4 +#: rc.cpp:6 rc.cpp:27 +#, no-c-format +msgid "&Network" +msgstr "&Rete" + +#. i18n: file ./smb4k/smb4k_shell.rc line 9 +#: rc.cpp:9 +#, no-c-format +msgid "Sh&ares" +msgstr "Co&ndivisioni" + +#. i18n: file ./smb4k/smb4k_shell.rc line 27 +#: rc.cpp:18 +#, no-c-format +msgid "Network ToolBar" +msgstr "Barra strumenti di rete" + +#. i18n: file ./smb4k/smb4k_shell.rc line 29 +#: rc.cpp:21 +#, no-c-format +msgid "Shares View ToolBar" +msgstr "Barra visualizzazione condivisioni" + +#. i18n: file ./smb4k/smb4k_shell.rc line 31 +#: rc.cpp:24 +#, no-c-format +msgid "Main ToolBar" +msgstr "Barra principale" + +#. i18n: file ./smb4k/listview/smb4kshareslistview_part.rc line 4 +#. i18n: file ./smb4k/iconview/smb4ksharesiconview_part.rc line 4 +#: rc.cpp:30 rc.cpp:33 +#, no-c-format +msgid "&Shares" +msgstr "Condivi&sioni" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Massimo Callegari" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "massimocallegari@yahoo.it" + +#: plugin/smb4k_konqplugin.cpp:70 +msgid "Scan Network" +msgstr "Analizza Rete" + +#: plugin/smb4k_konqplugin.cpp:122 +msgid "Samba Browser" +msgstr "Browser Samba" diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 0000000..ca7b0ef --- /dev/null +++ b/po/ja.po @@ -0,0 +1,3850 @@ +# translation of ja.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Toyohiro Asukai , 2004, 2005, 2006, 2007. +msgid "" +msgstr "" +"Project-Id-Version: ja\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-20 08:48+0200\n" +"PO-Revision-Date: 2007-12-15 15:05+0900\n" +"Last-Translator: Toyohiro Asukai \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.2\n" + +#: smb4k/smb4k.cpp:84 +msgid "&Dock Widgets" +msgstr "ドック・ウィジェット(&D)" + +#: smb4k/smb4k.cpp:108 smb4k/smb4k.cpp:112 smb4k/smb4k.cpp:287 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:170 +msgid "Network Browser" +msgstr "ネットワーク・ブラウザー" + +#: smb4k/smb4k.cpp:118 smb4k/smb4k.cpp:122 smb4k/smb4k.cpp:316 +#: plugin/smb4k_konqplugin.cpp:149 +msgid "Search Dialog" +msgstr "検索ダイアログ" + +#: smb4k/smb4k.cpp:156 +msgid "Shares Vie&w" +msgstr "共有表示(&w)" + +#: smb4k/smb4k.cpp:159 +msgid "&Icon View" +msgstr "アイコン表示(&I)" + +#: smb4k/smb4k.cpp:163 +msgid "List Vie&w" +msgstr "リスト表示(&w)" + +#: smb4k/smb4k.cpp:203 smb4k/smb4k.cpp:771 +msgid "Ready." +msgstr "待機中." + +#: smb4k/smb4k.cpp:264 +msgid "Jump to shares view" +msgstr "共有表示へ" + +#: smb4k/smb4k.cpp:293 +msgid "Jump to network browser" +msgstr "ネットワーク・ブラウザーへ" + +#: smb4k/smb4k.cpp:332 +msgid "Jump to search dialog" +msgstr "検索ダイアログへ" + +#: smb4k/smb4k.cpp:463 +msgid "" +"Closing the main window will keep Smb4K running in the system tray. Use " +"\"Quit\" from the \"File\" menu to quit the application." +msgstr "" +"メインウィンドウを閉じても Smb4K がシステム・トレーで実行し続けているでしょ" +"う。アプリケーションを終了するためには、 \"ファイル\" メニューから \"終了\" " +"を使用してください。" + +#: smb4k/smb4k.cpp:465 +msgid "Docking in System Tray" +msgstr "システムトレイにドック" + +#: smb4k/smb4k.cpp:496 +msgid "Exiting..." +msgstr "終了..." + +#: smb4k/smb4k.cpp:649 +msgid "Looking up workgroups and domains..." +msgstr "ワークグループとドメインを検索中..." + +#: smb4k/smb4k.cpp:655 +msgid "Querying current master browser..." +msgstr "現在のマスター・ブラウザーへ問い合わ中..." + +#: smb4k/smb4k.cpp:661 +msgid "Querying master browser %1..." +msgstr "マスター・ブラウザーへ問い合わ中 %1 ..." + +#: smb4k/smb4k.cpp:667 +msgid "Scanning broadcast areas..." +msgstr "ブロードキャスト・エリアを検索中..." + +#: smb4k/smb4k.cpp:681 +msgid "Opening workgroup..." +msgstr "ワークグループを開いています..." + +#: smb4k/smb4k.cpp:687 +msgid "Retrieving list of shares..." +msgstr "シェアのリストを検索中です..." + +#: smb4k/smb4k.cpp:693 +msgid "Retrieving additional information..." +msgstr "追加情報の検索中..." + +#: smb4k/smb4k.cpp:699 +msgid "Searching..." +msgstr "検索中..." + +#: smb4k/smb4k.cpp:705 +msgid "Retrying to retrieve list of shares..." +msgstr "シェアのリストを再検索中です..." + +#: smb4k/smb4k.cpp:711 smb4k/smb4k.cpp:729 smb4k/smb4k.cpp:741 +#: smb4k/smb4k.cpp:753 smb4k/smb4k.cpp:765 +msgid "Done." +msgstr "完了." + +#: smb4k/smb4k.cpp:717 +msgid "Mounting share..." +msgstr "共有をマウント中..." + +#: smb4k/smb4k.cpp:723 +msgid "Unmounting share..." +msgstr "共有をアンマウント中..." + +#: smb4k/smb4k.cpp:735 +msgid "Printing file..." +msgstr "ファイルを印刷..." + +#: smb4k/smb4k.cpp:747 +msgid "Synchronizing data..." +msgstr "データを同期させます..." + +#: smb4k/smb4k.cpp:759 +msgid "Generating preview..." +msgstr "プレビューの作成中..." + +#: smb4k/smb4k.cpp:819 smb4k/smb4ksystemtray.cpp:236 +msgid "&Edit Bookmarks" +msgstr "ブックマークを編集(&E)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:55 +msgid "Default Destination" +msgstr "デフォルト・先" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:59 +msgid "Rsync prefix:" +msgstr "Rsync プリフィックス:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:63 +#: smb4k/configdlg/smb4krsyncoptions.cpp:166 +#: smb4k/configdlg/smb4krsyncoptions.cpp:209 +msgid "General" +msgstr "一般" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:67 +msgid "Archive mode" +msgstr "アーカイブモード" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:68 +msgid "Recurse into directories" +msgstr "ディレクトリーを再帰" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:69 +msgid "Skip files that are newer in target directory" +msgstr "ターゲットディレクトリーで、新規のファイルをスキップします" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:70 smb4k/core/smb4ksettings.cpp:819 +msgid "Update destination files in place" +msgstr "その場所で、目的ファイルをアップデートしてください" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:71 smb4k/core/smb4ksettings.cpp:823 +msgid "Use relative path names" +msgstr "相対パス名を使用します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:72 +msgid "Don't send implied directories" +msgstr "暗黙のディレクトリ を送らないでください" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:73 smb4k/core/smb4ksettings.cpp:831 +msgid "Transfer directories without recursing" +msgstr "再帰なしで、ディレクトリを転送します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:74 smb4k/core/smb4ksettings.cpp:835 +msgid "Compress data during transfer" +msgstr "転送中にデータを圧縮します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:76 +msgid "Links" +msgstr "リンク" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:79 smb4k/core/smb4ksettings.cpp:839 +msgid "Preserve symlinks" +msgstr "シンボリックリンクを保つ" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:80 smb4k/core/smb4ksettings.cpp:843 +msgid "Transform symlinks" +msgstr "シンボリックリンクを変えます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:81 smb4k/core/smb4ksettings.cpp:847 +msgid "Only transform unsafe symlinks" +msgstr "危険なリンクを変えてください" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:82 smb4k/core/smb4ksettings.cpp:851 +msgid "Ignore unsafe symlinks" +msgstr "危険なシンボリックリンクを無視します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:83 smb4k/core/smb4ksettings.cpp:855 +msgid "Preserve hard links" +msgstr "ハードリンクを保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:84 smb4k/core/smb4ksettings.cpp:859 +msgid "Keep directory symlinks" +msgstr "ディレクトリのシンボリックリンクを保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:86 +msgid "File Permissions, etc." +msgstr "ファイル許可(パーミッション),etc." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:90 smb4k/core/smb4ksettings.cpp:863 +msgid "Preserve permissions" +msgstr "許可(パーミッション)を保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:91 smb4k/core/smb4ksettings.cpp:867 +msgid "Preserve group" +msgstr "グループを保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:92 +msgid "Preserve owner" +msgstr "領域のオーナ" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:93 smb4k/core/smb4ksettings.cpp:875 +msgid "Preserve device and special files" +msgstr "デバイスファイルおよび特別のファイルを保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:94 smb4k/core/smb4ksettings.cpp:879 +msgid "Preserve times" +msgstr "時間を保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:95 smb4k/core/smb4ksettings.cpp:883 +msgid "Omit directories when preserving times" +msgstr "時間を保つ時は、ディレクトリは除外します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:105 +msgid "Copying" +msgstr "複写" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:115 +msgid "File Deletion" +msgstr "ファイル削除" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:118 smb4k/core/smb4ksettings.cpp:887 +msgid "Remove synchronized source files" +msgstr "同期されたソース・ファイルを削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:119 smb4k/core/smb4ksettings.cpp:891 +msgid "Delete extraneous files" +msgstr "外来のファイルを削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:120 smb4k/core/smb4ksettings.cpp:895 +msgid "Delete files before transfer" +msgstr "転送前にファイルを削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:121 smb4k/core/smb4ksettings.cpp:899 +msgid "Delete files after transfer" +msgstr "転送後にファイルを削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:122 smb4k/core/smb4ksettings.cpp:903 +msgid "Delete files during transfer" +msgstr "転送中にファイルを削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:123 +msgid "Also delete excluded files" +msgstr "また、除外されたファイルを削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:124 smb4k/core/smb4ksettings.cpp:911 +msgid "Delete even if I/O errors occur" +msgstr "I/O エラーが発生しても、削除します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:125 smb4k/core/smb4ksettings.cpp:915 +msgid "Force deletion of non-void directories" +msgstr "無効なディレクトリの強制削除をします" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:127 +msgid "Restrictions" +msgstr "制限事項" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:130 +msgid "Don't delete more than this many files:" +msgstr "この多くのファイルを削除しないでください:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:133 +msgid "File Transfer" +msgstr "ファイル 転送" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:137 +msgid "Don't transfer any file smaller than:" +msgstr "より小さなどんなファイルも転送しないでください:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:140 +msgid "Don't transfer any file larger than:" +msgstr "より大きなどんなファイルも転送しないでください:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:143 smb4k/core/smb4ksettings.cpp:943 +msgid "Keep partially transferred files" +msgstr "部分的に転送したファイルを保ちます" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:145 +msgid "Put a partially transferred file into:" +msgstr "部分的に転送したファイルを入れます:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:156 +msgid "File Deletion && Transfer" +msgstr "ファイル削除 && 転送" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:170 smb4k/core/smb4ksettings.cpp:954 +msgid "Auto-ignore files in the same way CVS does" +msgstr "CVSがするのと同様に、自動的に無視するファイル" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:172 +msgid "Exclude files matching this pattern:" +msgstr "パターンに合うファイルを除外します:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:174 +msgid "Read exclude patterns from:" +msgstr "除外パターンを読み込みます:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:177 +msgid "Don't exclude files matching this pattern:" +msgstr "パターンに合うファイルを除外しません:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:179 +msgid "Read include patterns from:" +msgstr "包括するパターンを読み込みます:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:183 +msgid "Filter Rules" +msgstr "フィルタールール" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:186 +msgid "" +"The rules defined below will be added to the \"rsync\" command as they are. " +"Thus, you have to start with the --filter=... argument." +msgstr "" +"下で定義された規則は、 \"rsync\" コマンドに追加されます。このように、'-" +"filter=' 引数から始まらなければなりません" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:189 +msgid "Special filter rules:" +msgstr "特別なフィルタールール" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:190 +msgid "Use --filter='dir-merge /.rsync-filter' filter rule" +msgstr "使用方法--filter='dir-merge rsync-filter' フィルタールール" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:191 +msgid "Use --filter='exclude .rsync-filter' filter rule" +msgstr "使用方法 -filter='exclude rsync-filter' フィルタールール" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:199 +msgid "Filtering" +msgstr "フィルタリング" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:213 smb4k/core/smb4ksettings.cpp:998 +msgid "Handle sparse files efficiently" +msgstr "まばらなファイルを効率的に扱ってください" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:214 smb4k/core/smb4ksettings.cpp:1002 +msgid "Copy files whole (no rsync algorithm)" +msgstr "ファイル全体を複写(rsync アルゴリズムではありません)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:215 +msgid "Don't cross file system boundaries" +msgstr "ファイルの境界をまたがないでください" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:216 +msgid "Only update files that already exist" +msgstr "既に存在するファイルだけ、更新します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:217 +msgid "Ignore files that already exist" +msgstr "既に存在するファイルを無視します" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:218 +msgid "Delay updates until the end of transfer" +msgstr "転送終了まで、アップデートを遅延します " + +#: smb4k/configdlg/smb4krsyncoptions.cpp:220 +msgid "Backup" +msgstr "バックアップ" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:223 smb4k/core/smb4ksettings.cpp:1022 +msgid "Make backups" +msgstr "バックアップ作成" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:225 +msgid "Backup suffix:" +msgstr "バックアップ拡張子:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:227 +msgid "Backup directory:" +msgstr "バックアップ・ディレクトリ:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:231 +msgid "Checksums" +msgstr "チェックサム" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:234 +msgid "Force fixed checksum block size:" +msgstr "チェックサムブロック・サイズを固定しました:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:236 +msgid "Set block/file checksum seed:" +msgstr "ブロック/ファイル チェックサム 設定:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:238 +msgid "Skip files based on checksum" +msgstr "チェックサムに基づいて、ファイルをスキップ" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:248 +msgid "Advanced" +msgstr "アドバンス" + +#: smb4k/configdlg/smb4kshareoptions.cpp:53 +msgid "Directories" +msgstr "ディレクトリ" + +#: smb4k/configdlg/smb4kshareoptions.cpp:59 +msgid "Mount prefix:" +msgstr "マウント拡張子:" + +#: smb4k/configdlg/smb4kshareoptions.cpp:66 +msgid "Force generated subdirectories to be lower case" +msgstr "小文字で、強制的にサブディレクトリを作成しました" + +#: smb4k/configdlg/smb4kshareoptions.cpp:69 +msgid "Mounting and Unmounting" +msgstr "マウントおよびアンマウント" + +#: smb4k/configdlg/smb4kshareoptions.cpp:70 +msgid "Unmount all shares of user %1 on exit" +msgstr "終了時、 ユーザ %1 の全ての共有(シェア)を、アンマウントします" + +#: smb4k/configdlg/smb4kshareoptions.cpp:72 +msgid "Remount recently used shares on program start" +msgstr "" +"プログラム・スタート時に、最近使用している共有(シェア)を再びマウントします" + +#: smb4k/configdlg/smb4kshareoptions.cpp:74 +msgid "Allow the unmounting of shares that are owned by other users" +msgstr "他のユーザによって所有される共有(シェア)のアンマウントを許可する" + +#: smb4k/configdlg/smb4kshareoptions.cpp:77 +msgid "Checks" +msgstr "チェック" + +#: smb4k/configdlg/smb4kshareoptions.cpp:79 +msgid "Interval between checks:" +msgstr "チェックの間隔:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:50 +msgid "Browse List" +msgstr "閲覧リスト" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:53 +msgid "Scan the network neighborhood for available workgroups and domains" +msgstr "利用可能なワークグループとドメインのためにネットワークをスキャンします" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:55 +msgid "Query the current workgroup master browser" +msgstr "現在のワークグループマスターブラウザへ問い合わせします" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:62 +msgid "Query this master browser:" +msgstr "マスターブラウザへ問い合わせします" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:65 +msgid "Scan broadcast areas:" +msgstr "ブロードキャストの範囲を検索:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:80 +msgid "Network Search" +msgstr "ネットワーク検索" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:85 +msgid "" +"Smb4K uses \"nmblookup\" by default to search for remote hosts. This method " +"is very reliable but fails sometimes if your network neighborhood is " +"configured uncommonly. In this case you should try to use \"smbclient\"." +msgstr "" +"Smb4Kは、リモートホストを検索するためにデフォルトで \"nmblookup\"を使用しま" +"す。この方法非常に信頼できるが、あなたのネットワークの近隣が厳しく設定してい" +"る場合、時々失敗します。この場合、\"smbclient\"の使用を試してください。" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:88 +msgid "Use nmblookup (recommended)" +msgstr "nmblookup を使用(推奨)" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:91 +msgid "Use smbclient" +msgstr "smbclient を使用" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:162 +msgid "User Interface" +msgstr "ユーザインターフェイス" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:163 +#: smb4k/browser/smb4knetworkbrowser.cpp:50 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:186 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:319 +msgid "Network" +msgstr "ネットワーク" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:164 +#: smb4k/listview/smb4kshareslistview_part.cpp:144 +#: smb4k/listview/smb4kshareslistview_part.cpp:346 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:141 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:232 +msgid "Shares" +msgstr "共有" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:165 +#: smb4k/configdlg/smb4ksambaoptions.cpp:89 +#: smb4k/core/smb4kpasswordhandler.cpp:237 +msgid "Authentication" +msgstr "認証" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:166 +msgid "Samba" +msgstr "Samba" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:167 +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47 +msgid "Synchronization" +msgstr "同期化" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:168 +msgid "Super User" +msgstr "スーパー ユーザ" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:327 +#: smb4k/configdlg/smb4kconfigdialog.cpp:328 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1039 +#: smb4k/configdlg/smb4ksambaoptions.cpp:400 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:970 +msgid "auto" +msgstr "自動(オート)" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:331 +#: smb4k/configdlg/smb4kconfigdialog.cpp:352 +#: smb4k/configdlg/smb4kconfigdialog.cpp:441 +#: smb4k/configdlg/smb4kconfigdialog.cpp:451 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1098 +#: smb4k/configdlg/smb4ksambaoptions.cpp:428 +msgid "yes" +msgstr "はい" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:332 +#: smb4k/configdlg/smb4kconfigdialog.cpp:353 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1099 +#: smb4k/configdlg/smb4ksambaoptions.cpp:427 +msgid "no" +msgstr "いいえ" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:360 +#: smb4k/configdlg/smb4kconfigdialog.cpp:458 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1060 +#: smb4k/configdlg/smb4ksambaoptions.cpp:215 +#: smb4k/configdlg/smb4ksambaoptions.cpp:418 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:913 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-write" +msgstr "読出し-書込み" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:361 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1061 +#: smb4k/configdlg/smb4ksambaoptions.cpp:216 +#: smb4k/configdlg/smb4ksambaoptions.cpp:419 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-only" +msgstr "読み出し専用" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:460 +#: smb4k/configdlg/smb4kconfigdialog.cpp:465 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1072 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1082 +#: smb4k/configdlg/smb4ksambaoptions.cpp:141 +#: smb4k/configdlg/smb4ksambaoptions.cpp:167 +msgid "default" +msgstr "デフォルト" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:707 +msgid "[Network] The custom master browser has not been entered.\n" +msgstr "[ネットワーク] カスタム マスターブラウザーは入力されていません \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:722 +msgid "[Network] The broadcast areas have not been entered.\n" +msgstr "[ネットワーク] ブロードキャスト エリアは入力されていません \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:733 +msgid "[Shares] The mount prefix is empty.\n" +msgstr "[共有] マウントプレフィックスは空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:748 +msgid "[Authentication] The default user name has not been entered.\n" +msgstr "[認証] デフォルト・ユーザー名は入力されていません \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:759 +msgid "[Samba] The file mask is empty.\n" +msgstr "[Samba] ファイル マスク は空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:770 +msgid "[Samba] The directory mask is empty.\n" +msgstr "[Samba] ディレクトリ マスク は空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:781 +msgid "[Samba] The UID is empty.\n" +msgstr "[Samba] UID は空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:792 +msgid "[Samba] The GID is empty.\n" +msgstr "[Samba] GID は空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:803 +msgid "[Synchronization] The rsync prefix is empty.\n" +msgstr "[同期化] rsync サフィックスは空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:816 +msgid "" +"[Synchronization] The directory where partially transferred files should be " +"stored is empty.\n" +msgstr "" +"[同期化] 部分的に転送されるファイルが保存されるディレクトリーは空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:829 +msgid "[Synchronization] The exclude patterns have not been entered.\n" +msgstr "[同期化] 除外 パターンは入力されていません \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:842 +msgid "[Synchronization] The path of the exclude file is empty.\n" +msgstr "[同期化] 除外 ファイルのパスは空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:855 +msgid "[Synchronization] The include patterns have not been entered.\n" +msgstr "[同期化] 包括(インクルード) パターンは入力されていません \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:868 +msgid "[Synchronization] The path of the include file is empty.\n" +msgstr "[同期化] 包括(インクルード) ファイルのパスは空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:887 +msgid "[Synchronization] The backup suffix has not been defined.\n" +msgstr "[同期化] バックアップサフィックスは定義されていません \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:900 +msgid "[Synchronization] The backup directory is empty.\n" +msgstr "[同期化]バックアップ・ディレクトリーは空です \n" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:908 +msgid "" +"The configuration could not be written, because one setting is incomplete:\n" +"%1Please correct this issue." +msgstr "" +"ひとつの設定が不完全なので、構成(コンフィグレーション)ができません:\n" +"%1 この問題を修正してください" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:912 +msgid "" +"The configuration could not be written, because %1 settings are incomplete:\n" +"%1Please correct these issues." +msgstr "" +"%1 設定が不完全なので、設定ファイルに記述することができません。:\n" +"これら( %1 )の問題を修正してください" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:1191 +msgid "Smb4KConfigDialog" +msgstr "Smb4K設定・ダイアログ" + +#: smb4k/configdlg/smb4kauthoptions.cpp:52 +msgid "Password Storage" +msgstr "パスワード 保管" + +#: smb4k/configdlg/smb4kauthoptions.cpp:53 +msgid "Save the authentication data in a wallet" +msgstr "ワレットに認証データを保存します" + +#: smb4k/configdlg/smb4kauthoptions.cpp:55 +msgid "If no wallet is used, remember authentication data during run time" +msgstr "ワレットを使用していないなら、実行中パスワードを覚えていてください" + +#: smb4k/configdlg/smb4kauthoptions.cpp:58 +msgid "Default Login" +msgstr "デフォルト・ログイン" + +#: smb4k/configdlg/smb4kauthoptions.cpp:62 +msgid "Use default login" +msgstr "デフォルト・ログインを使用" + +#: smb4k/configdlg/smb4kauthoptions.cpp:69 +#: smb4k/core/smb4kpasswordhandler.cpp:291 +#: smb4k/core/smb4khomesshareshandler.cpp:89 +msgid "User:" +msgstr "ユーザー:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:72 +msgid "This login name is used by default to authenticate to a remote server." +msgstr "" +"このログイン名は遠隔のサーバーで認証するためのデフォルトとして使用されます" + +#: smb4k/configdlg/smb4kauthoptions.cpp:73 +#: smb4k/core/smb4kpasswordhandler.cpp:311 +msgid "Password:" +msgstr "パスワード:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:77 +msgid "" +"This password is used by default to authenticate to a remote server. It may " +"be empty." +msgstr "" +"このパスワードはリモート・サーバで認証するためにデフォルトで使用されます。そ" +"れは空かもしれません。" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:70 +msgid "General Options" +msgstr "一般的なオプション" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:73 +msgid "NetBIOS name:" +msgstr "NetBIOS名:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:76 +msgid "Domain:" +msgstr "ドメイン:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:79 +msgid "Socket options:" +msgstr "Socket・オプション:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:82 +msgid "NetBIOS scope:" +msgstr "NetBIOS 範囲:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:85 +msgid "Remote SMB port:" +msgstr "遠隔のSMBポート:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:91 +msgid "Try to authenticate with Kerberos" +msgstr "Kerberos で認証を試みます" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:92 +msgid "Authenticate as machine account" +msgstr "コンピュータ アカウントとして認証" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:100 +msgid "General Settings" +msgstr "一般的な設定" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:110 +#: smb4k/configdlg/smb4ksambaoptions.cpp:384 +#: smb4k/listview/smb4kshareslistview.cpp:56 +msgid "File System" +msgstr "ファイル システム" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:120 +msgid "" +"NOTE: You might need to enable support for either \"super\" or \"sudo\" in " +"the Super User page." +msgstr "" +"告知:スーパー ユーザ ページで、\"super\" か \"sudo\" のどちらかのサポートを有" +"効にする必要が あります" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:124 +msgid "User and Group" +msgstr "ユーザとグループ" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:127 +#: smb4k/configdlg/smb4ksambaoptions.cpp:430 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:292 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:317 +msgid "User ID:" +msgstr "ユーザーID:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:131 +#: smb4k/configdlg/smb4ksambaoptions.cpp:435 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:296 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:321 +msgid "Group ID:" +msgstr "グループID:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:136 +msgid "Charset and Codepage" +msgstr "キャラセットとコードページ" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:139 +msgid "Client charset:" +msgstr "クライアント キャラセット:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:165 +msgid "Server codepage:" +msgstr "サーバーコードページ:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:202 +msgid "Permissions" +msgstr "許可(パーミッション)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:205 +msgid "File mask:" +msgstr "ファイル マスク:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:209 +msgid "Directory mask:" +msgstr "ディレクトリ・マスク:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:213 +#: smb4k/configdlg/smb4ksambaoptions.cpp:414 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:286 +msgid "Write access:" +msgstr "書き込みアクセス:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:220 +msgid "Advanced CIFS Options" +msgstr "高度な CIFS オプション" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:227 smb4k/core/smb4ksettings.cpp:692 +msgid "Do permission checks" +msgstr "許可(パーミッション)チェックを行います" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:229 +msgid "Attempt to set UID and GID" +msgstr "set UID と GID を試みます" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:231 smb4k/core/smb4ksettings.cpp:700 +msgid "Use server inode numbers" +msgstr "サーバー inode 番号を使用します" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:233 smb4k/core/smb4ksettings.cpp:704 +msgid "Do not cache inode data" +msgstr "inode データをキャッシュしない" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:235 smb4k/core/smb4ksettings.cpp:708 +msgid "Translate reserved characters" +msgstr "予約されたキャラクタを解釈します" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:237 smb4k/core/smb4ksettings.cpp:712 +msgid "Do not use locking" +msgstr "ロックを使わない" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:244 +msgid "Additional options:" +msgstr "追加オプション:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:248 +msgid "Advanced SMBFS Options" +msgstr "高度な SMBFS オプション" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:251 +msgid "Use Unicode when communicating with the server" +msgstr "サーバーと通信する場合ユニコードを使用" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:252 +#, fuzzy +msgid "Use large file support" +msgstr "大きなファイルシステムサーポートを使用" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:258 +msgid "Caching time of directory listings:" +msgstr "ディレクトリー・リストの先読み時間:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:289 +msgid "Protocol Hint" +msgstr "プロトコル ヒント" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:291 +msgid "Automatic detection" +msgstr "自動認識" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:293 +msgid "RPC: Modern operating systems" +msgstr "RPC: 現代のオペレーティングシステム:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:295 +msgid "RAP: Older operating systems" +msgstr "RAP: 昔のオペレーティングシステム:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:297 +msgid "ADS: Active Directory environment (LDAP/Kerberos)" +msgstr "ADS: アクティブ・ディレクトリ (環境LDAP/Kerberos)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:318 +msgid "Name resolve order:" +msgstr "リゾルブ オーダー名:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:321 +msgid "Buffer size:" +msgstr "バッファー・サイズ:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:323 +msgid " Bytes" +msgstr " バイト" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:325 +msgid "Signing state:" +msgstr "署名の状況:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:327 +msgid "none" +msgstr "なし" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:328 +msgid "on" +msgstr "オン" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:329 +msgid "off" +msgstr "オフ" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:330 +msgid "required" +msgstr "必須" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:354 +msgid "Broadcast address:" +msgstr "ブロードキャスト・アドレス:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:357 +msgid "Try and bind to UDP port 137 to send and receive UDP datagrams" +msgstr "UDPデータグラムの送受信にUDPポート137へ試みてください" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:381 +#: smb4k/listview/smb4kshareslistview.cpp:51 +msgid "Item" +msgstr "アイテム" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:382 +msgid "Protocol" +msgstr "プロトコル" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:385 +msgid "Write Access" +msgstr "書き込みアクセス" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:387 +msgid "Kerberos" +msgstr "ケルベロス(暗号)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:388 +msgid "UID" +msgstr "UID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:389 +msgid "GID" +msgstr "GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:390 +msgid "Port" +msgstr "ポート" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:396 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:177 +msgid "Protocol:" +msgstr "プロトコル:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:407 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:136 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:279 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:136 +msgid "File system:" +msgstr "ファイル システム:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:423 +msgid "Kerberos:" +msgstr "ケルベロス:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:440 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:164 +msgid "Port:" +msgstr "ポート:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:451 +msgid "Remove All" +msgstr "全て削除" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:493 +msgid "Custom" +msgstr "カスタム" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:52 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:171 +msgid "Shares View" +msgstr "共有表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:55 +msgid "Show mounted shares in an icon view" +msgstr "マウントされた共有(シェア)をアイコンで表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:57 +msgid "Show mounted shares in a list view" +msgstr "マウントされた共有(シェア)をリストで表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:62 +#: smb4k/core/smb4ksettings.cpp:117 +msgid "Show custom bookmark label if available" +msgstr "利用可能な場合カスタムブックマークラベルを表示します" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:64 +msgid "System Tray" +msgstr "システムトレイ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:67 +msgid "Embed application into the system tray" +msgstr "システム・トレーへ埋め込みます" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:83 +msgid "Remote Shares" +msgstr "リモート共有" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:85 +#: smb4k/core/smb4ksettings.cpp:144 +msgid "Show printer shares" +msgstr "プリンター共有を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:86 +#: smb4k/core/smb4ksettings.cpp:148 +msgid "Show hidden shares" +msgstr "隠された共有(シェア)を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:87 +msgid "Show IPC$ shares" +msgstr "IPC$ 共有(シェア)を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:88 +msgid "Show ADMIN$ shares" +msgstr "ADMIN$ 共有(シェア)を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:90 +msgid "Columns" +msgstr "カラム" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:92 +msgid "Show type" +msgstr "タイプを表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:93 +msgid "Show IP address" +msgstr "IPアドレスを表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:94 +msgid "Show comment" +msgstr "コメントを表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:96 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:124 +msgid "Tooltips" +msgstr "ツールチップ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:98 +msgid "Show tooltip with information about a network item" +msgstr "ネットワーク項目に関する情報をツールチップで表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:114 +#: smb4k/smb4ksystemtray.cpp:67 +msgid "Mounted Shares" +msgstr "マウントされた共有" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:116 +msgid "Show mount point instead of share name" +msgstr "共有(シェア)名の代わりにマウントポイントを表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:117 +#: smb4k/core/smb4ksettings.cpp:180 +msgid "Show all shares that are mounted on the system" +msgstr "システムにマウントされた全ての共有(シェア)を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:119 +msgid "Drag and Drop" +msgstr "ドラッグ/ドロップ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:121 +msgid "Allow dropping of files and directories onto shares" +msgstr "ファイルとディレクトリを共有にドロップしてください" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:122 +msgid "Allow dragging of shares" +msgstr "共有をドラッグしてください" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:126 +msgid "Show tooltip with information about a share" +msgstr "共有に関する情報をツールチップで表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:128 +msgid "List View" +msgstr "リスト表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:132 +#: smb4k/core/smb4ksettings.cpp:200 +msgid "Show owner and group (SMBFS only)" +msgstr "オーナとグループを表示(SMBFSのみ)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:133 +#: smb4k/core/smb4ksettings.cpp:204 +msgid "Show login (CIFS only)" +msgstr "ログインを表示 (CIFS のみ)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:135 +#, fuzzy +msgid "Show owner and group" +msgstr "オーナとグループを表示(SMBFSのみ)" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:137 +#: smb4k/core/smb4ksettings.cpp:208 +msgid "Show file system" +msgstr "ファイル システムを表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:138 +#: smb4k/core/smb4ksettings.cpp:212 +msgid "Show free disk space" +msgstr "ディスクの空き容量を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:139 +#: smb4k/core/smb4ksettings.cpp:216 +msgid "Show used disk space" +msgstr "使用されたディスク容量を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:140 +#: smb4k/core/smb4ksettings.cpp:220 +msgid "Show total disk space" +msgstr "合計のディスク容量を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:141 +#: smb4k/core/smb4ksettings.cpp:224 +msgid "Show disk usage" +msgstr "ディスク使用量を表示" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:158 +msgid "Hidden Files and Directories" +msgstr "隠しファイルとディレクトリ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:159 +msgid "Preview hidden files and directories" +msgstr "隠しファイルとディレクトリのプレビュ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:169 +msgid "Main Window && System Tray" +msgstr "メインウィンドウ && システムトレイ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:172 +msgid "Preview Dialog" +msgstr "プレビュ ダイアログ" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:52 +msgid "Programs" +msgstr "プログラム" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:55 +msgid "Use the following program to gain super user privileges:" +msgstr "スーパーユーザー特権を獲得する下記プログラムを使用してください:" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:59 +msgid "Actions" +msgstr "動作" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:62 +msgid "" +"Use super user privileges to force the unmounting of (inaccessible) shares" +msgstr "" +"シェア(アクセスできない)のアンマウントを強制に行う為にスーパーユーザー特権を" +"使用します" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:64 +#: smb4k/core/smb4ksettings.cpp:1082 +msgid "Use super user privileges to mount and unmount shares" +msgstr "" +"共有(シェア)をマウント、アンマウントするために、スーパーユーザー特権を使用し" +"ます" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:67 +msgid "Remove Entries" +msgstr "エントリを削除" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:68 +msgid "Remove entries from the configuration file" +msgstr "構成(設定)ファイルからエントリを削除します" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:69 +msgid "" +"Depending on your choice under \"Programs\", all entries that were written " +"by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. " +"Additionally, all your choices under \"Actions\" will be cleared." +msgstr "" +"あなたが選択した下記の\"プログラム\"によって、Smb4Kで記述されたすべてのエント" +"リーは、 /etc/super.tabあるいは/etc/sudoersのいずれか から削除されるでしょ" +"う。" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:109 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:154 +#: smb4k/dialogs/smb4kprintdialog.cpp:92 smb4k/dialogs/smb4kmountdialog.cpp:79 +msgid "Workgroup:" +msgstr "ワークグループ:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +msgid "Pseudo master browser:" +msgstr "疑似マスターブラウザー." + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:158 +msgid "Master browser:" +msgstr "マスターブラウザー." + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:116 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:136 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:140 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:144 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:160 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:213 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:292 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:301 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:310 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:331 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:335 +#: smb4k/dialogs/smb4kprintdialog.cpp:88 +msgid "Unknown" +msgstr "未知" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:129 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:207 +#: smb4k/dialogs/smb4kprintdialog.cpp:83 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +msgid "Host:" +msgstr "ホスト:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:132 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:185 +msgid "Comment:" +msgstr "コメント:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:135 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:211 +#: smb4k/dialogs/smb4kprintdialog.cpp:86 +msgid "IP address:" +msgstr "IPアドレス:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:139 +msgid "Operating system:" +msgstr "オペレーティングシステム:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:143 +msgid "Server string:" +msgstr "サーバー:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:182 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:120 +#: smb4k/dialogs/smb4kmountdialog.cpp:70 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:120 +msgid "Share:" +msgstr "共有:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:188 +msgid "Type:" +msgstr "タイプ:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:196 +msgid "Mounted:" +msgstr "マウント:" + +#: smb4k/browser/smb4knetworkbrowser.cpp:51 +msgid "Type" +msgstr "タイプ" + +#: smb4k/browser/smb4knetworkbrowser.cpp:52 +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:63 +msgid "IP Address" +msgstr "IPアドレス" + +#: smb4k/browser/smb4knetworkbrowser.cpp:53 +msgid "Comment" +msgstr "コメント" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:141 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:532 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:552 +msgid "Scan Netwo&rk" +msgstr "ネットワークを検索(&r)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:144 +msgid "&Abort" +msgstr "中断(&A)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:149 smb4k/smb4ksystemtray.cpp:72 +msgid "M&ount Manually" +msgstr "手動で、マウント(&o)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:154 +msgid "Au&thentication" +msgstr "認証(&t)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:157 +msgid "&Custom Options" +msgstr "カスタムオプション(&C)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:160 +msgid "Add &Bookmark" +msgstr "ブックマークを追加(&B)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:163 +msgid "Pre&view" +msgstr "プレビュー(&v)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:166 +msgid "&Print File" +msgstr "ファイルを印刷(&P)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:169 +msgid "&Mount" +msgstr "マウント(&M)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:203 +#: smb4k/listview/smb4kshareslistview_part.cpp:111 +#: smb4k/smb4ksystemtray.cpp:790 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:108 +msgid "&Unmount" +msgstr "アンマウント(&U)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:345 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:370 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:400 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:462 +msgid "Scan Compute&r" +msgstr "コンピュータを検索(&r)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:383 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:486 +msgid "Scan Wo&rkgroup" +msgstr "ワークグループを検索(&r)" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:1905 +msgid "Smb4KNetworkBrowserPart" +msgstr "Smb4KNetworkBrowserPart" + +#: smb4k/core/smb4kcore.cpp:248 +msgid "" +"Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will " +"hang if you try to access it.\n" +"Do you want to continue?" +msgstr "" +"KDE 3.3.x にバージョンアップしてください。 KIO と Konquerorは、CIFS 共有を扱" +"うことができません。あなたが、CIFS にアクセスしようとすれば、konqueror は、ハ" +"ングするでしょう。\n" +"それでも、あなたは、続行しますか?" + +#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057 +msgid "Buffer size exceeded" +msgstr "バッファー・サイズが越えました" + +#: smb4k/core/smb4kmounter.cpp:815 smb4k/core/smb4kmounter.cpp:862 +msgid "Do you really want to force the unmounting of this share?" +msgstr "あなたは、本当にこの共有を強制アンマウントしますか?" + +#: smb4k/core/smb4ksettings.cpp:30 +msgid "The path to the program \"grep\"" +msgstr "\"grep\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:33 +msgid "The path to the program \"awk\"" +msgstr "\"awk\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:36 +msgid "The path to the program \"sed\"" +msgstr "\"sed\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:39 +msgid "The path to the program \"xargs\"" +msgstr "\"xargs\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:42 +msgid "The path to the program \"rmdir\"" +msgstr "\"rmdir\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:45 +msgid "The path to the program \"nmblookup\"" +msgstr "\"nmblookup\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:48 +msgid "The path to the program \"smbclient\"" +msgstr "\"smbclient\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:51 +msgid "The path to the program \"smbspool\"" +msgstr "\"smbspool\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:54 +msgid "The path to the program \"net\"" +msgstr "\"net\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:57 +msgid "The path to the program \"mount.cifs\"" +msgstr "\"mount.cifs\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:60 +msgid "The path to the program \"umount.cifs\"" +msgstr "\"umount.cifs\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:63 +msgid "The path to the program \"smbmount\"" +msgstr "\"smbmount\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:66 +msgid "The path to the program \"smbumount\"" +msgstr "\"smbumount\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:69 +msgid "The path to the program \"mount\"" +msgstr "\"mount\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:72 +msgid "The path to the program \"mount_smbfs\" (FreeBSD only)" +msgstr "\"mount_smbfs\" (FreeBSD only) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:75 +msgid "The path to the program \"smbutil\" (FreeBSD only)" +msgstr "\"smbutil\" (FreeBSD only) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:78 +msgid "The path to the program \"umount\"" +msgstr "\"umount\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:81 +msgid "The path to the program \"smb4k_mount\"" +msgstr "\"smb4k_mount\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:84 +msgid "The path to the program \"smb4k_umount\"" +msgstr "\"smb4k_umount\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:87 +msgid "The path to the program \"smb4k_kill\"" +msgstr "\"smb4k_kill\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:90 +msgid "The path to the program \"smb4k_cat\"" +msgstr "\"smb4k_cat\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:93 +msgid "The path to the program \"smb4k_mv\"" +msgstr "\"smb4k_mv\" プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:96 +msgid "The path to the program \"super\" (optional)" +msgstr "\"super\" (オプション) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:99 +msgid "The path to the program \"sudo\" (optional)" +msgstr "\"sudo\" (オプション) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:102 +msgid "The path to the program \"dvips\" (optional)" +msgstr " \"dvips\" (オプション) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:105 +msgid "The path to the program \"enscript\" (optional)" +msgstr "\"enscript\" (オプション) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:108 +msgid "The path to the program \"rsync\" (optional)" +msgstr " \"rsync\" (オプション) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:111 +msgid "The path to the program \"konsole\" (optional)" +msgstr "\"konsole\" (オプション) プログラムのパス" + +#: smb4k/core/smb4ksettings.cpp:118 +msgid "" +"Do not show the name of the share that is represented by the bookmark but " +"the custom label that was defined in the bookmark editor." +msgstr "" +"ブックマークエディタで定義されたカスタム・ラベル、ブックマークによって表され" +"るシェア(共有)名を表示しません" + +#: smb4k/core/smb4ksettings.cpp:121 +msgid "Embed application into system tray" +msgstr "システム・トレへアプリケーションを入れます" + +#: smb4k/core/smb4ksettings.cpp:122 +msgid "" +"Embed the application into the system tray. The system tray widget provides " +"a popup menu with several commonly used tasks so that you do not need to " +"bring up the main window everytime. If this setting is chosen you have to " +"use \"Quit\" from the \"File\" menu or the system tray widget to exit the " +"application." +msgstr "" +"システム・トレーへアプリケーションを埋め込みます。システムトレイウィジェット" +"は、いつもメインウィンドウに表示する 必要がないように、いくつかの一般に用いら" +"れているタスクのポップアップメニュとして提供します。この設定が選ばれ るとき、" +"アプリケーションを終了するには、\" ファイル \" メニューからのあるいはシステ" +"ム・トレイからの \"終了 \" を使 用しなければなりません" + +#: smb4k/core/smb4ksettings.cpp:125 +msgid "Start docked" +msgstr "ドック(システムトレイに入れること)を開始" + +#: smb4k/core/smb4ksettings.cpp:126 +msgid "" +"Start the application docked to the system tray, i.e. only the system tray " +"widget is shown and the main window is hidden. You can bring the main window " +"up by clicking on the system tray widget or by choosing \"Restore\" from its " +"popup menu." +msgstr "" +"アプリケーション起動はシステム・トレイに入ります。つまり、システム・トレイ" +"ウィジェットに表示され、メインウィンドウには表示しません。 システム・トレイ" +"ウィジェットをクリックするかポップアップメニュから \"戻す\" を選択することに" +"よりメイン・ウィンドウに表示します" + +#: smb4k/core/smb4ksettings.cpp:140 +msgid "How the shares should be displayed" +msgstr "どのようにシェアを表示するか" + +#: smb4k/core/smb4ksettings.cpp:141 +msgid "" +"Choose the kind of view you prefer for displaying the mounted shares. There " +"is an icon view or a list view available." +msgstr "" +"マウントされたシェアの表示を好きな表示の種類に選んでください。アイコン表示あ" +"るいは利用可能なリスト表示があります。" + +#: smb4k/core/smb4ksettings.cpp:145 +msgid "Printer shares will be displayed in the network browser." +msgstr "プリンタ・シェアはネットワーク・ブラウザに表示されるでしょう" + +#: smb4k/core/smb4ksettings.cpp:149 +msgid "" +"Hidden shares will be displayed in the network browser. Hidden shares are " +"ending with a $ sign, e.g. Musik$ or IPC$." +msgstr "" +"隠れたシェアは、ネットワーク・ブラウザに表示されるでしょう。隠れたシェアは、" +"$ サインで終わっています、例えば Musik$ または IPC$。" + +#: smb4k/core/smb4ksettings.cpp:152 +msgid "Show hidden IPC$ shares" +msgstr "隠された IPC$ 共有(シェア)を表示" + +#: smb4k/core/smb4ksettings.cpp:153 +msgid "Hidden IPC$ shares will be displayed in the network browser." +msgstr "隠された IPC$ シェアは、ネットワーク・ブラウザに表示されるでしょう" + +#: smb4k/core/smb4ksettings.cpp:156 +msgid "Show hidden ADMIN$ shares" +msgstr "隠された ADMIN$ 共有(シェア)を表示" + +#: smb4k/core/smb4ksettings.cpp:157 +msgid "Hidden ADMIN$ shares will be displayed in the network browser." +msgstr "隠された ADMIN$ シェアは、ネットワーク・ブラウザに表示されるでしょう" + +#: smb4k/core/smb4ksettings.cpp:160 +msgid "Show the type of a share" +msgstr "共有(シェア)のタイプを表示" + +#: smb4k/core/smb4ksettings.cpp:161 +msgid "" +"The type of a share will be displayed in a separate column in the network " +"browser. It can either be Disk, Print or IPC." +msgstr "" +"シェアのタイプは、ネットワーク・ブラウザで個別のカラムで表示されるでしょうそ" +"れは ディスク 、印刷 あるいは IPC でありえます" + +#: smb4k/core/smb4ksettings.cpp:164 +msgid "Show the IP address of a server" +msgstr "サーバのIPアドレスを表示" + +#: smb4k/core/smb4ksettings.cpp:165 +msgid "" +"The IP address of the server will be displayed in a separate column in the " +"network browser." +msgstr "" +"サーバーのIPアドレスは、ネットワーク・ブラウザ中の個別のカラムで表示されるで" +"しょう" + +#: smb4k/core/smb4ksettings.cpp:168 +msgid "Show the comment of a share" +msgstr "共有(シェア)のコメントを表示" + +#: smb4k/core/smb4ksettings.cpp:169 +msgid "" +"The comment describing the server or share will be displayed in a separate " +"column in the network browser." +msgstr "" +"サーバーかシェアについて記述するコメントは、ネットワーク・ブラウザ中の個別の" +"カラムで表示されるでしょう" + +#: smb4k/core/smb4ksettings.cpp:172 +msgid "Show a tooltip with information about the network item" +msgstr "ネットワーク項目に関する情報をツールチップで表示" + +#: smb4k/core/smb4ksettings.cpp:173 +msgid "The tooltip shows various information about the current network item." +msgstr "現在のネットワーク項目に関する多様な情報をツールチップで表示します" + +#: smb4k/core/smb4ksettings.cpp:176 +msgid "Show the mount point of a share instead of its name" +msgstr "その名前の代わりにシェアのマウントポイントを示します" + +#: smb4k/core/smb4ksettings.cpp:177 +msgid "" +"A share is normally displayed with its name in the shares view. Choosing " +"this feature will cause the exchange of the share name by the mount point." +msgstr "" +"シェアは、シェア・ビュで名前を通常表示されます。この機能を選択するとマウント" +"ポイントによってシェア名の変換をおこないます" + +#: smb4k/core/smb4ksettings.cpp:181 +msgid "" +"You will not only see the shares that were mounted and are owned by you, but " +"also all other mounts using the SMBFS and CIFS file system that are present " +"on the system." +msgstr "" +"マウントされた、あなたの所有されているシェアを表示しません、しかし 他の全て" +"のマウントは、システム上で存在するSMBFSおよびCIFSファイルシステムを使用します" + +#: smb4k/core/smb4ksettings.cpp:184 +msgid "Allow the dropping of files and directories onto share icons" +msgstr "シェア・アイコンへのファイルおよびディレクトリのドロップを可能にします" + +#: smb4k/core/smb4ksettings.cpp:185 +msgid "" +"This setting allows you to drop files or whole directories onto the share " +"icons, which will cause them to be copied." +msgstr "" +"この設定は、あなたがシェア・アイコンへのファイルあるいはディレクトリ全体をド" +"ロップすることを可能にします。シェア・アイコンへドロップしたファイルやディレ" +"クトリは、コピーされます" + +#: smb4k/core/smb4ksettings.cpp:188 +msgid "Allow the dragging of share icons" +msgstr "シェア・アイコンのドラッグを可能にします" + +#: smb4k/core/smb4ksettings.cpp:189 +msgid "" +"This setting allows you to drag a share item out of Smb4K and onto the " +"desktop or into a file manager. Only enable it if you think you absolutely " +"need it and read the handbook before you mark this checkbox." +msgstr "" +"この設定は、あなたがSmb4Kから、デスクトップ上へ、あるいはファイル・マネージャ" +"の中へのシェア・アイテムをドラッグすることを可能 にします。あなたが、これを絶" +"対に必要と思う場合は、チェックボックスにチェックする前にハンドブックを読んで" +"ください。そしてそれを可 能にしてください。" + +#: smb4k/core/smb4ksettings.cpp:192 +msgid "Show a tooltip with information about the share" +msgstr "共有に関する情報をツールチップで表示" + +#: smb4k/core/smb4ksettings.cpp:193 +msgid "The tooltip shows various information about the current share." +msgstr "現在のシェアに関する様々な情報をツールチップで表示" + +#: smb4k/core/smb4ksettings.cpp:196 +msgid "Show hidden files and directories when previewing a share" +msgstr "シェアをプレビューする場合、隠しファイルとディレクトリーを示します" + +#: smb4k/core/smb4ksettings.cpp:197 +msgid "" +"Display hidden files and directories in the preview dialog. The names of " +"hidden files and directories are beginning with a period and are usually " +"needed for very specific purposes (configuration file of an application, " +"etc.). Since they are not of any importance for your regular work, you " +"normally do not need to enable this feature." +msgstr "" +"プレビュダイアログに隠しファイルやディレクトリを表示します。隠しファイルや" +"ディレクトリの名前は、ピリオド で始まり、とても特別な目的(アプリケーションな" +"どの設定ファイル)の為に通常必要とします。それらが、あな たの普通の業務に重要" +"でないので、通常この機能を使用可能にする必要はありません" + +#: smb4k/core/smb4ksettings.cpp:201 +msgid "" +"Show the UID and GID that own all files on the mounted file system. At the " +"moment the column will only contain an entry if the share was mounted with " +"the SMBFS file system." +msgstr "" +"マウントされたファイルシステム上の全てのファイルを所有するUIDおよびGIDを表示" +"します。そのときは、もしシェアがSMBFSファイルシステムでマウントされていた場" +"合、カラムには単に、エントリが含まれています。" + +#: smb4k/core/smb4ksettings.cpp:205 +msgid "" +"Show the login that was used to authenticate to the server. The column will " +"only contain an entry if the share was mounted with the CIFS file system." +msgstr "" +"サーバに認証する為に使用したログインを表示します。もしシェアが CIFS ファイル" +"システムでマウント されていた場合、カラムには単に、エントリが含まれています" + +#: smb4k/core/smb4ksettings.cpp:209 +msgid "Show the file system that was used for mounting the share." +msgstr "シェアのマウントで使用されたファイルシステムを表示" + +#: smb4k/core/smb4ksettings.cpp:213 +msgid "Show the free disk space that is left on the share." +msgstr "シェアの左側にディスクの空き容量を表示" + +#: smb4k/core/smb4ksettings.cpp:217 +msgid "Show the disk space that is already used on the share." +msgstr "" +"システムにマウントされた全ての共有(シェア)を表示 すでに使用されている共有" +"ディスクの容量を表示" + +#: smb4k/core/smb4ksettings.cpp:221 +msgid "Show the total disk space of the share." +msgstr "共有の合計ディスク容量を表示" + +#: smb4k/core/smb4ksettings.cpp:225 +msgid "Show the space that is used on the share in percent." +msgstr "パーセントで共有の使用されている容量を表示" + +#: smb4k/core/smb4ksettings.cpp:252 +msgid "Method how to retrieve the browse list" +msgstr "ブラウズリストを検索する方法" + +#: smb4k/core/smb4ksettings.cpp:253 +msgid "" +"Choose the method how to compile the initial browse list. There are four " +"options available: The first one is the default one and employs \"nmblookup -" +"M -- -\" to discover all workgroups, domains, and their master browsers on " +"your network neighborhood. The second one instructs Smb4K to query the " +"current master browser of your workgroup or domain to retrieve the browse " +"list. The third is similar to the second one except that you can define the " +"master browser that should be queried. If you choose the last option, the " +"provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x." +"x -- '*'\"." +msgstr "" +"最初のブラウズ・リストをどのように編集する方法を選択します。利用可能な4つの" +"オプションがあります。 1番目は、デフォルトで、あなたのネットワーク近隣上の" +"ワークグループ、ドメイン、そしてそれらのマスタ・ブラウザを すべて見つける為" +"に、\"nmblookup -M -- -\" を使用します。2番目は、 Smb4K にブラウズリストを検" +"索するあな たのワーク グループかドメインの現在のマスタ・ブラウザへ問い合わせ" +"るように指示します。3番目は、あなたが問 い合わせるマスタ・ブラウザを定義でき" +"るという点を除いて、2番目のものと似ています。あなたが最後のオプション を選べ" +"ば、 \"nmblookup -B x.x.x.x -- '*'\" を使用して検索されたブロードキャスト・エ" +"リアのリストを提供されます" + +#: smb4k/core/smb4ksettings.cpp:256 +msgid "A custom master browser that is to be queried" +msgstr "問い合わせることになっているカスタム・マスター・ブラウザ" + +#: smb4k/core/smb4ksettings.cpp:257 +msgid "" +"Enter the name or IP address of a master browser here that should be queried " +"to compile the initial browse list." +msgstr "" +"初期のブラウズリストをコンパイルする為に問い合わせをするマスター・ブラウザの" +"ここで、IPアドレス又は、名前の入力を行います" + +#: smb4k/core/smb4ksettings.cpp:260 +msgid "A custom list of broadcast addresses" +msgstr "ブロードキャスト・アドレスのカスタム・リスト" + +#: smb4k/core/smb4ksettings.cpp:261 +msgid "" +"Enter a comma-separated list of broadcast addresses here (e.g. " +"192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the " +"respective broadcast areas." +msgstr "" +"リモート・ホストを捜す方法ここで(例えば192.168.0.255と192.168.1.255)ブロード" +"キャスト・アドレス のコンマで分離されたリストを入力してください。それは、それ" +"ぞれのブロードキャストエリアのすべての 既知のホストの検索に使用されます" + +#: smb4k/core/smb4ksettings.cpp:275 +msgid "Method for searching for remote hosts" +msgstr "リモート・ホストを捜す方法" + +#: smb4k/core/smb4ksettings.cpp:276 +msgid "" +"Smb4K is able to search for remote hosts either using nmblookup or " +"smbclient. The nmblookup method is very reliable and works well. However, if " +"your network is configured uncommonly and you experience problems when " +"searching, you should try the smbclient method. But please note that you " +"lose the ability to search for IP addresses in that case." +msgstr "" +"Smb4Kは nmblookup または smbclient を使用して、リモート・ホストを捜すことがで" +"きます。 nmblookup の方法は非常に信頼できて、とてもよいです。しかしながら、あ" +"なたのネットワーク が複雑に構築されていて、検索するときに経験上の問題があれ" +"ば、 smbclient の方法を試 みてください。しかし、その場合IPアドレスを検索する" +"能力を失うことに注意してください。" + +#: smb4k/core/smb4ksettings.cpp:282 +msgid "The mount prefix" +msgstr "マウント拡張子" + +#: smb4k/core/smb4ksettings.cpp:283 +msgid "" +"This is the prefix where Smb4K will create the mount points and mount the " +"remote shares." +msgstr "" +"Smb4Kがマウントポイントを作成し、遠隔のシェアをマウントする拡張子です。" + +#: smb4k/core/smb4ksettings.cpp:286 +msgid "Force the subdirectories created by Smb4K to be lowercase" +msgstr "Smb4Kによって、強制的に小文字のサブディレクトリを作成しました" + +#: smb4k/core/smb4ksettings.cpp:287 +msgid "" +"All names of the subdirectories created by Smb4K below the mount prefix will " +"be lowercase." +msgstr "" +"小文字で、強制的にサブディレクトリを作成しました マウント拡張子より下のSmb4K" +"によって作成されたサブディレクトリの名前はすべて、小文字になります" + +#: smb4k/core/smb4ksettings.cpp:290 +msgid "Unmount the shares owned by the user on exit" +msgstr "終了時、 ユーザによって共有(シェア)を、アンマウントします" + +#: smb4k/core/smb4ksettings.cpp:291 +#, fuzzy +msgid "Unmount all shares that belong to you when the program exits." +msgstr "終了時、 ユーザ %1 の全ての共有(シェア)を、アンマウントします" + +#: smb4k/core/smb4ksettings.cpp:294 +msgid "Remount shares" +msgstr "共有(シェア)を再マウント" + +#: smb4k/core/smb4ksettings.cpp:295 +msgid "" +"Remount all your shares that were still mounted when you exited the program. " +"Shares that were mounted by other users are ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:298 +msgid "Allow the unmounting of shares owned by other users" +msgstr "他のユーザによって所有される共有(シェア)のアンマウントを許可する" + +#: smb4k/core/smb4ksettings.cpp:299 +msgid "" +"Allow the unmounting of shares that were mounted by other users. In most " +"cases you need super user privileges for this. Please think before you " +"enable this option!" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:304 +msgid "Interval between checks for new and inaccessible shares" +msgstr "新しい共有(シェア)や、アクセスしにくい(シェア)のチェック間隔" + +#: smb4k/core/smb4ksettings.cpp:305 +msgid "" +"This is the time that elapses until Smb4K checks again for new mounts and " +"unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note " +"that the smaller the interval gets the higher is your system load." +msgstr "" +"新しいマウントや、アンマウントの Smb4K が再度チェックするまでの時間です。 下" +"限が 500 ms で、上限が 300000 ms です。告知:チェックの間隔を短くす るとシス" +"テム・ロードが高くなります。" + +#: smb4k/core/smb4ksettings.cpp:311 +msgid "Use a wallet to store authentication data" +msgstr "認証データを保存するためにワレットを使用します" + +#: smb4k/core/smb4ksettings.cpp:312 +msgid "" +"Use a wallet to store the authentication data. The login name and the " +"password name are stored encrypted on your hard drive. If this setting is " +"disabled, the authentication data is not stored permanently but only " +"temporarily." +msgstr "" +"認証データを保存するためにワレットを使用してください。ログイン名およびパス" +"ワード名 はあなたのハードドライブ上で暗号化されて保存されます。この設定を無効" +"にした場合、 認証データは、永久に保存されません、しかし一時的には、保存されま" +"す。" + +#: smb4k/core/smb4ksettings.cpp:315 +msgid "Remember passwords if no wallet is used" +msgstr "ワレットが使用されない場合、パスワードを憶えてください" + +#: smb4k/core/smb4ksettings.cpp:316 +msgid "" +"If you decided to store the login names and passwords only temporarily, " +"Smb4K will remember them until the program exits. If you disable this " +"setting, you will have to provide the authentication data everytime it is " +"needed." +msgstr "" +"もしあなたがログイン名およびパスワードを一時的に保存することを決めれば、 " +"Smb4K は プログラム終了まで それらを記憶しています。もしこの設定を無効にする" +"と、必要なとき毎回 認証データを入力しなければならないでしょう。" + +#: smb4k/core/smb4ksettings.cpp:319 +msgid "Use a default login" +msgstr "デフォルト・ログインを使用" + +#: smb4k/core/smb4ksettings.cpp:320 +msgid "" +"Enable the usage of a default login name and password. The authentication " +"data provided below is then used by default to authenticate to a remote " +"server. This is very useful e.g. if you are working in an Active Directory " +"environment or an NT domain." +msgstr "" +"デフォルト・ログイン名およびパスワードの使用を有効にしてください。その後、下" +"に提供される 認証データは、リモート・サーバで認証するためにデフォルトで使用さ" +"れます。例えば、アクティ ブ・ディレクトリ環境あるいはNTドメインで動作している" +"場合、これは非常に便利です、" + +#: smb4k/core/smb4ksettings.cpp:326 +msgid "The NetBIOS name of this computer" +msgstr "このコンピューターのNetBIOS名" + +#: smb4k/core/smb4ksettings.cpp:327 +msgid "" +"This is the NetBIOS name of this computer that is used by Smb4K. By default, " +"it is either the NetBIOS name that is defined in the smb.conf file or the " +"host name." +msgstr "" +"これは Smb4K によって使用されるこのコンピューターの NetBIOS 名です。デフォル" +"トによって、 smb.conf ファイル又は ホスト名 に定義されているどちらか一方の " +"NetBIOS 名です。" + +#: smb4k/core/smb4ksettings.cpp:330 +msgid "The name of the workgroup/domain this computer is in" +msgstr "このコンピューターがあるワークグループ/ドメインの名前" + +#: smb4k/core/smb4ksettings.cpp:331 +msgid "" +"This is the workgroup or domain this computer is or should be in. By " +"default, it is the workgroup that is defined in the smb.conf file." +msgstr "" +"これは、このコンピューターのワークグループかドメインです。 デフォルトによっ" +"て、 smb.conf ファイルに定義されているワークグループです。" + +#: smb4k/core/smb4ksettings.cpp:334 +msgid "The socket options" +msgstr "Socket・オプション" + +#: smb4k/core/smb4ksettings.cpp:335 +msgid "" +"These are the TCP socket options that are used by nmblookup, smbmount and " +"smbclient. Socket options are controls on the networking layer of the " +"operating systems which allow the connection to be tuned. See the manual " +"page of smb.conf for more information." +msgstr "" +"これらは、nmblookup、smbmountおよびsmbclientによって使用されるTCPソケット・オ" +"プションです。 ソケット・オプションは、接続の調整を可能にするオペレーティン" +"グ・システムのネットワーク層の制御です。 より詳細には、 smb.conf のマニュア" +"ル・ページを参照してください。" + +#: smb4k/core/smb4ksettings.cpp:338 +msgid "The NetBIOS scope" +msgstr "NetBIOSの範囲" + +#: smb4k/core/smb4ksettings.cpp:339 +msgid "" +"This sets the NetBIOS scope that nmblookup, smbmount and smbclient will " +"operate under. It should not be set unless every machine on your network " +"neighborhood sets this value." +msgstr "" +"これは、nmblookup、smbmountおよびsmbclientが実行するNetBIOS範囲を設定しま" +"す。 もしあなたのネットワーク近隣上のすべてのコンピュータがこの値を設定しなけ" +"れば、それは設定されるべきではありません。" + +#: smb4k/core/smb4ksettings.cpp:344 +msgid "The remote SMB port" +msgstr "遠隔のSMBポート" + +#: smb4k/core/smb4ksettings.cpp:345 +msgid "" +"This is the port that is to be used for connecting to remote servers. Please " +"note that this is independent of the settings in the smb.conf file." +msgstr "" +"これはリモート・サーバに接続するために使用されることになっているポートです。 " +"これが smb.conf ファイル中の設定に依存しないことに注意してください。" + +#: smb4k/core/smb4ksettings.cpp:348 +msgid "Use Kerberos for authentication" +msgstr "Kerberos を認証に使用します" + +#: smb4k/core/smb4ksettings.cpp:349 +msgid "" +"Try to authenticate with Kerberos. This is only useful in an Active " +"Directory environment. The setting affects the smbmount and smbclient " +"command." +msgstr "" +"Kerberos で認証を試してください。これはアクティブ・ディレクトリ環境にのみ役立" +"ちます。 設定はsmbmountおよびsmbclientコマンドに影響します" + +#: smb4k/core/smb4ksettings.cpp:352 +msgid "Use machine account for login" +msgstr "コンピュータのアカウントをログインに使用します" + +#: smb4k/core/smb4ksettings.cpp:353 +msgid "" +"Make queries to the remote server using the machine account of the local " +"server. The setting affects the net and the smbclient command." +msgstr "" +"ローカル・サーバのマシン・アカウントを使用して、リモート・サーバに問い合わせ" +"をします。 設定は、net およびsmbclientコマンドに影響します。" + +#: smb4k/core/smb4ksettings.cpp:367 +msgid "The file system that is used for mounting remote shares" +msgstr "マウントする遠隔の共有(シェア)で使用されるファイル・システム" + +#: smb4k/core/smb4ksettings.cpp:368 +msgid "" +"This is the file system that will be used to mount the remote shares. The " +"Common Internet File System (CIFS) is supported by Windows 2000 and above as " +"well as by Samba. It offers many improvements and advancements compared to " +"the Server Message Block File System (SMBFS) which is used by Windows 9x and " +"below." +msgstr "" +"これは遠隔のシェアをマウントするために使用されるファイルシステムです。 共通の" +"インターネット・ファイルシステム(CIFS)はウインドウズ2000とSambaと同様にサポー" +"トされます。 それは、Windows 9x以降で使用されるサーバ・メッセージ・ブロック・" +"ファイルシステム(SMBFS)と比較 された多くの改良および進歩を提供します" + +#: smb4k/core/smb4ksettings.cpp:487 +msgid "The charset used by the client" +msgstr "クライアントのキャラセット(charset)を使用しました" + +#: smb4k/core/smb4ksettings.cpp:488 +msgid "" +"This is the charset that is used by the client side (i.e. your side) either " +"to convert local path names to and from Unicode in case of the CIFS file " +"system or for codepage to charset translations (NLS) in case of the SMBFS " +"file system. If you keep the default setting, Smb4K will try to " +"automatically determine the charset by looking up the \"unix charset\" " +"option in the smb.conf." +msgstr "" +"CIFSファイルシステムの場合、ユニコード(Unicode)からローカルのパス名を変換する" +"為に クライアント側で使用されるキャラセット(charset)です。又、SMBFSファイルシ" +"ステムの場合 、キャラセット(charset)翻訳(NLS)へのコードページの為にクライアン" +"ト側で使用されるキャ ラセット(charset)です。あなたがデフォルト設定を維持すれ" +"ば、Smb4Kはsmb.confの中の \"unix、charset\" オプションを調べることにより、" +"キャラセット(charset)を自動的に決定し ようとします。" + +#: smb4k/core/smb4ksettings.cpp:657 +msgid "The codepage used by the server" +msgstr "サーバのコードページを使用しました" + +#: smb4k/core/smb4ksettings.cpp:658 +msgid "" +"This is the codepage that is used by the server. The setting is only " +"available with the SMBFS file system. If you keep the default setting, Smb4K " +"will try to automatically determine the codepage by looking up the \"dos " +"charset\" option in the smb.conf." +msgstr "" +"これはサーバーによって使用されるコードページです。設定はSMBFSファイルシステム" +"で利用可能です。 あなたがデフォルト設定を維持すれば、Smb4Kはsmb.confの中の" +"\"dos charset\" オプションを調べる ことにより、コードページを自動的に決定しよ" +"うとします。" + +#: smb4k/core/smb4ksettings.cpp:661 +msgid "The user ID that is to be used for mounting" +msgstr "マウントに使用されるユーザーID" + +#: smb4k/core/smb4ksettings.cpp:662 +msgid "" +"Here you can enter the user ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" +"ここで、マウントされた共有(シェア)のファイルおよびディレクトリが持つユーザID" +"(数字)を入力することができます。 あなたがCIFSファイルシステムを使用しており、" +"リモート・サーバが CIFS Unix 拡張 をサポートしていれば、この 設定は、無視さ" +"れるでしょう。" + +#: smb4k/core/smb4ksettings.cpp:665 +msgid "The group ID that is to be used for mounting" +msgstr "マウントに使用されるグループID" + +#: smb4k/core/smb4ksettings.cpp:666 +msgid "" +"Here you can enter the group ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" +"ここで、マウントされた共有(シェア)のファイルおよびディレクトリが持つグループ" +"ID(数字)を入力することができます。 あなたがCIFSファイルシステムを使用してお" +"り、リモート・サーバが CIFS Unix 拡張 をサポートしていれば、この 設定は、無" +"視されるでしょう。" + +#: smb4k/core/smb4ksettings.cpp:669 +msgid "The file mask for a share" +msgstr "共有(シェア)用のファイル・マスク" + +#: smb4k/core/smb4ksettings.cpp:670 +msgid "" +"This is the mask that will be used for creating files. It must be defined in " +"octal. In case the CIFS file system is used, this setting only takes effect " +"if the server does not support the CIFS Unix Extensions." +msgstr "" +"これはファイルの作成のために使用されるマスクです。それは8進法で定義しなければ" +"なりません。 CIFSファイルシステムが使用時、サーバが CIFS Unix 拡張 をサポート" +"していない場合、 この設定は、効果があります。" + +#: smb4k/core/smb4ksettings.cpp:673 +msgid "The directory mask for a share" +msgstr "共有(シェア)用のディレクトリ・マスク" + +#: smb4k/core/smb4ksettings.cpp:674 +msgid "" +"This is the mask that will be used for creating directories. It must be " +"defined in octal. In case the CIFS file system is used, this setting only " +"takes effect if the server does not support the CIFS Unix Extensions." +msgstr "" +"これはディレクトリの作成のために使用されるマスクです。それは8進法で定義しなけ" +"ればなりません。 CIFSファイルシステムが使用時、サーバが CIFS Unix 拡張 をサ" +"ポートしていない場合、 この設定は、効果があります。" + +#: smb4k/core/smb4ksettings.cpp:688 +msgid "The write access granted for the share" +msgstr "共有(シェア)用の書き込みアクセス権限" + +#: smb4k/core/smb4ksettings.cpp:689 +msgid "" +"Here you can choose if the shares should be mounted in read and write mode " +"or only read-only." +msgstr "" +"ここで、共有(シェア)をマウントしたときの、読み込み、書き込み、又は読み込みだ" +"けのモードを選択できます。" + +#: smb4k/core/smb4ksettings.cpp:693 +msgid "" +"The client side (i.e. your side) will check if you have the right UID/GID to " +"manipulate a file or directory. You might want to switch this feature off if " +"the server(s) support the CIFS Unix Extensions and you are not allowed to " +"access the files and directories. This setting does not affect the normal " +"ACL check." +msgstr "" +"クライアント側(つまりあなたの側)は、ファイル又はディレクトリを操作するため" +"に、あなたが正しい UID / GID を 持っているかどうかチェックするでしょう。も" +"し、サーバが CIFS Unix 拡張をサポートし、ファイルとディレクトリに アクセスす" +"ることを認められなければ、この機能を無効に切替えたいと思うかもしれません。 こ" +"の設定は、通常の ACL チェックに影響しません" + +#: smb4k/core/smb4ksettings.cpp:696 +msgid "Set UID and GID" +msgstr "UID と GID 設定" + +#: smb4k/core/smb4ksettings.cpp:697 +msgid "" +"In case the server supports the CIFS Unix Extensions, the client side (i.e. " +"your side) attempts to set the effective UID and GID of the current process " +"on newly created files, directories and devices. If this feature is turned " +"off, the default UID and GID defined for the share will be used. It is " +"recommended that you read the manual page of mount.cifs before you change " +"this setting." +msgstr "" +"サーバが CIFS Unix 拡張をサポートした場合、クライアント側(つまりあなたの側)" +"は、新しく作成されたファイル、 ディレクトリおよびデバイスを現在のプロセスの有" +"効な UID および GID を設定することを試みます。 この機能を無効にした場合、共有" +"(シェア)の為に定義されたデフォルトの UID 及び GID が使用されるでしょう。 この" +"設定を変更する前に、 mount.cifs のマニュアルページを参照することを推奨します" + +#: smb4k/core/smb4ksettings.cpp:701 +msgid "" +"Use inode numbers (unique persistent file identifiers) returned by the " +"server instead of automatically generating temporary inode numbers on the " +"client side." +msgstr "" +"クライアント側で自動的に作成された一時的な inode 番号の代わりに、サーバで返さ" +"れた Inode 番号 (ユニークで持続的なファイル識別)を使用します。" + +#: smb4k/core/smb4ksettings.cpp:705 +msgid "" +"Directly read from and write to files opened on the share. In some cases " +"this can provide better performance than the default behavior which caches " +"reads and writes." +msgstr "" +"共有(シェア)の開いたファイルを直接読み書きします。いくつかの場合で、読み書き" +"キャッシュのデフォルト動作よりも、 よりよいパフォーマンスを提供することができ" +"ます。" + +#: smb4k/core/smb4ksettings.cpp:709 +msgid "" +"Translate six of the seven reserved characters (including the colon, " +"question mark, pipe, asterisk, greater than and less than characters but not " +"the backslash) to remap range (above 0xF000). This allows you to open files " +"that were created with such characters. This has no effect if the server " +"does not support Unicode." +msgstr "" +"範囲(0xF000以上の)をリマップ(再配置)する為に、7つの予約文字(バックスラッシュ" +"は除く、コロン、疑問符、パイプ、 星印、大なり、小なりを含む)の6つを翻訳しま" +"す。これは、そのような文字で作成されたファイルを開くことが可能です。 もし、" +"サーバがユニコードをサポートしていない場合、これは効果がありません。" + +#: smb4k/core/smb4ksettings.cpp:713 +msgid "Do not use locking. Do not start lockd." +msgstr "ロックを使用しない。ロックデーモンを起動しない" + +#: smb4k/core/smb4ksettings.cpp:716 +msgid "Advanced custom options for the CIFS file system" +msgstr "CIFSファイルシステムの高度なカスタムオプション" + +#: smb4k/core/smb4ksettings.cpp:717 +msgid "" +"Here you can enter advanced options for the CIFS file system in a comma-" +"separated list (refer to the manual page of mount.cifs to learn more). The " +"list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not " +"enter options that have already been defined in the configuration dialog." +msgstr "" +"ここで、コンマで分離されたリストのCIFS ファイルシステムの高度なオプションを入" +"力することができます (もっと学習するためにmount.cifsのマニュアルページを参照" +"します)。 リストに、mounnt.cifs の引数 \"-o\" が加えられるでしょう。 設定ダイ" +"アログですでに定義されているオプションを入力しないでください。" + +#: smb4k/core/smb4ksettings.cpp:720 +msgid "Determines how long directory listings are cached" +msgstr "長いディレクトリー・リストがどのようにキャッシュされるか決めます" + +#: smb4k/core/smb4ksettings.cpp:721 +msgid "" +"This setting determines how long a directory listing is cached in " +"milliseconds. A high value means it takes longer until changes on the server " +"are noticed on the client side (i.e. your side), but it can also give you an " +"increase in performance on large directories, especially on long distances. " +"You need Linux kernel 2.4.2 or later to take advantage of this setting." +msgstr "" +"この設定は、ディレクトリ・リストが 1/1000秒単位でどれくらいの時間キャッシュ" +"されているか決定します。 高い値は、サーバーの変更がクライアント側(つまりあな" +"たの側)で気づくのが、より長くかかることを意味します。 しかし、特に長い距離や" +"長いディレクトリであればパフォーマンスの向上があります。 この設定を利用するに" +"は、 Linux Kernel 2.4.2 又はそれ以降が必要になります。" + +#: smb4k/core/smb4ksettings.cpp:724 +msgid "Unicode support" +msgstr "ユニコードのサポート" + +#: smb4k/core/smb4ksettings.cpp:725 +msgid "" +"Use Unicode when communicating with the server. This will give you better " +"support for non-ASCII character sets with the SMBFS file system." +msgstr "" +"サーバと通信する場合 Unicode を使用してください。 これは、非ASCII文字セットの" +"SMBFSファイルシステムの為に、よりよいサポートを与えるでしょう。" + +#: smb4k/core/smb4ksettings.cpp:728 +msgid "Long file support" +msgstr "大きいファイルのサーポート" + +#: smb4k/core/smb4ksettings.cpp:729 +#, fuzzy +msgid "" +"Large file support (LFS) enables you to read and write \n" +"files bigger than 2 GB on shares that were mounted with the SMBFS file " +"system." +msgstr "" +"SMBFSファイルシステムでマウントされたシェア上で大きなファイルシステムサポート" +"(LFS)によって 2GBより大きなファイルを読み書きすることができます。" + +#: smb4k/core/smb4ksettings.cpp:754 +msgid "The protocol that is used with the net command" +msgstr "ネット・コマンドと共に使用されるプロトコル" + +#: smb4k/core/smb4ksettings.cpp:755 +msgid "" +"Here you can choose the protocol that will be used by the net command for " +"the communication with remote servers if appropriate. In most cases the " +"automatic detection will work fine and you should not need to change the " +"default setting. However, if you experience problems, use the RPC protocol " +"for newer operating systems (Windows NT4 and above) and the RAP protocol for " +"older ones (Windows 98/NT3 and below). Functions that need the ADS protocol " +"(for Active Directory environments) have not been implemented yet, so you " +"can ignore that one for now." +msgstr "" +"ここで、適切に ネット・コマンドでリモート・サーバとのコミュニケーションに使用" +"されるプロトコルを選ぶことができます。 ほとんどの場合、自動検知は正しく動作す" +"るでしょう。また、デフォルト・設定を変更する必要がありません。 しかしながら、" +"もし経験上の問題があるならば、新しいオペレーティング・システム(ウインドウズ" +"NT4、それ以降)用 のRPCプロトコル及び、古いもの(Windows98/NT3、それ以前)のため" +"のRAPプロトコルを使用します。 ADSプロトコル(アクティブ・ディレクトリ環境用の)" +"を必要とする機能はまだ実装されていません。 したがって、今のところそれを無視す" +"ることができます。" + +#: smb4k/core/smb4ksettings.cpp:758 +msgid "Name resolve order used by smbclient" +msgstr "名前の解決オーダは smbclient によって使用されました" + +#: smb4k/core/smb4ksettings.cpp:759 +msgid "" +"This option is used to determine what naming services and in what order are " +"used to resolve host names and IP addresses. It takes a space-separated list " +"of up to four different name resolution options. Those are: lmhost, host, " +"wins, bcast. See the manual page of smbclient for further information." +msgstr "" +"このオプションは、名前をつけるサービスや、ホスト名とIPアドレスを解決を決定す" +"る為に使用されます。 それは、4つまでの異なったネーム・リゾリューション・オプ" +"ションで、スペースで分離されたリストをとります。 それらは次のとおりです:" +"lmhost、ホスト(host)、wins、ブロードキャスト。さらに詳しい情報に関しては、 " +"smbclient のマニュアルページを参照してください。" + +#: smb4k/core/smb4ksettings.cpp:763 +msgid "Transmit/send buffer size used by smbclient" +msgstr "smbclientで使用される転送/送信バッファー・サイズを送ります" + +#: smb4k/core/smb4ksettings.cpp:764 +msgid "" +"This option changes the transmit/send buffer size when getting or putting a " +"file from/to the server. The default is 65520 bytes. Setting this value " +"smaller has been observed to speed up file transfers to and from Windows 9x " +"servers." +msgstr "" +"このオプションは、サーバからファイルの取得やサーバへファイルを送る、転送/送信" +"バッファサイズの変更です。 デフォルトは、65520バイトです。この値をより小さく" +"することは、Windows 9x サーバ間のファイル転送の スピード向上することに気づく" +"でしょう。" + +#: smb4k/core/smb4ksettings.cpp:788 +msgid "Signing state" +msgstr "署名の状態" + +#: smb4k/core/smb4ksettings.cpp:789 +msgid "Set the signing state for smbclient." +msgstr "smbclientのために署名状態を設定してください" + +#: smb4k/core/smb4ksettings.cpp:792 +msgid "The broadcast address used by nmblookup" +msgstr "ブロードキャスト・アドレスはnmblookupによって使用されました" + +#: smb4k/core/smb4ksettings.cpp:793 +msgid "" +"Queries performed with nmblookup will be send to the given broadcast " +"address. Without this option the default behavior is to send the queries to " +"the broadcast address of the network interface that was either auto-detected " +"or defined in the \"interfaces\" parameter of the smb.conf file." +msgstr "" +"nmblookup で行われた問い合わせは、与えられたブロードキャストアドレスに送りま" +"す。 このオプションなしで、デフォルトの動作は、自動検出されたか又は、smb." +"conf ファイルのパラメータ \"interfaces\" で 定義したネット ワークインターフェ" +"イスのブロードキャスト アドレスに問い合わせを送ります。" + +#: smb4k/core/smb4ksettings.cpp:796 +msgid "Use UDP port 137 with nmblookup" +msgstr "nmblookupは、UDPポート137を使用します" + +#: smb4k/core/smb4ksettings.cpp:797 +msgid "" +"Try and bind to UDP port 137 to send and receive UDP datagrams. The reason " +"for this option is a bug in Windows 95 where it ignores the source port of " +"the requesting packet and only replies to UDP port 137. Unfortunately, on " +"most Unix systems super user privileges are needed to bind to this port. " +"Please read the manual page of nmblookup for more information." +msgstr "" +"UDP データグラムへ送受信のために UDP ポート 137 へ接続を試みてください。 この" +"オプションの理由は、要求するパケットの要求元のポートを無視し、単に UDP ポー" +"ト 137 に返事を返す Windows 95 のバグです。 不幸にも、ほとんどの Unix システ" +"ムにおいては、スーパーユーザー特権がこのポートへ使用するために必要です。 より" +"詳細には、 nmblookup のマニュアルページを読んでください。" + +#: smb4k/core/smb4ksettings.cpp:803 +msgid "Prefix for synchronization" +msgstr "同期のための拡張子" + +#: smb4k/core/smb4ksettings.cpp:804 +msgid "" +"This is the path where Smb4K will store the files and directories during " +"synchronization. If you plan to synchronize only with one remote share, then " +"you can put the data directly in this directory. If you want to synchronize " +"with several remote shares, then you should create a subdirectory for each " +"share and choose the appropriate one in the synchronization dialog." +msgstr "" +"これは、Smb4Kが同期中にファイルとディレクトリを保存するパスです。 一つのリ" +"モート共有(シェア)のみで同期することを計画すれば、このディレクトリにデータを" +"直接入れることができます。 いくつかのリモート共有(シェア)で同期したければ、各" +"共有(シェア)のサブディレクトリを作成し、同期ダイアログで適切なものを選択しま" +"す" + +#: smb4k/core/smb4ksettings.cpp:807 +msgid "Use archive mode" +msgstr "アーカイブモードを使用" + +#: smb4k/core/smb4ksettings.cpp:808 +msgid "Use archive mode (-a, --archive). This is a short form of -rlptgoD." +msgstr "" +"アーカイブ・モード(-a、 --archive)を使用してください。これは -rlptgoD の簡易" +"型です" + +#: smb4k/core/smb4ksettings.cpp:811 +msgid "Recurse into subdirectories" +msgstr "サブディレクトリを再帰" + +#: smb4k/core/smb4ksettings.cpp:812 +msgid "Recurse into directories (-r, --recursive)." +msgstr "ディレクトリーを再帰(-r、 --recursive)" + +#: smb4k/core/smb4ksettings.cpp:815 +msgid "Skip files that are newer in the target directory" +msgstr "ターゲットディレクトリーで、新規のファイルをスキップします" + +#: smb4k/core/smb4ksettings.cpp:816 +msgid "" +"Update files in the destination directory that are older than in the source " +"directory (-u, --update)." +msgstr "" +"ソースディレクトリよりも古い、目的のディレクトリのファイルを更新します(-u, --" +"update)" + +#: smb4k/core/smb4ksettings.cpp:820 +msgid "" +"Update destination files in-place (--inplace). By default, rsync first " +"creates a new copy of a file and moves it into place after its transfer " +"finished. If you enable this feature, no copy will be created but the " +"destination file will immediately be overwritten instead. An exception to " +"this is if you combine this option with --backup." +msgstr "" +"-inplace で指定した、目的のファイルをアップデートします。 デフォルトでは、 " +"rsync が最初にファイルの新しいコピーを作成し、転送終了後適切な場所に移動しま" +"す。 この機能を有効にすれば、コピーは作成されないでしょう。しかし、目的のファ" +"イルは直ちに代わりに上書きされるでしょう。 この例外は、あなたがこの --backup " +"オプションを組み合わせるかどうかです" + +#: smb4k/core/smb4ksettings.cpp:824 +msgid "" +"Use relative paths (-R, --relative). This means that the full path names " +"specified on the command line are sent to the server rather than just the " +"last parts of the file names." +msgstr "" +"相対的なパス(-R、-relative)を使用してください。 これは、ファイル名の単なる最" +"後の部分ではなくサーバへコマンドライン上 で指定されたフルパス名が送られること" +"を意味します。" + +#: smb4k/core/smb4ksettings.cpp:827 +msgid "Don't send implied directories with --relative" +msgstr "--relative オプションで、隠されたディレクトリに送らないでください" + +#: smb4k/core/smb4ksettings.cpp:828 +msgid "" +"Don't send implied directories with --relative (--no-implied-dirs). This " +"means that the corresponding path elements on the destination system are " +"left unchanged if they exist, and any missing implied directories are " +"created with default attributes. This even allows these implied path " +"elements to have big differences, such as being a symlink to a directory on " +"one side of the transfer, and a real directory on the other side." +msgstr "" +"-relative (--no-implied-dirs) で、隠されたディレクトリを送らないでください。 " +"それらが存在する場合、転送先のシステム上の対応するパス要素が変更されないこと" +"を意味します。 また、いくつかの見つからない隠されたディレクトリも、デフォルト" +"属性で作成されます。 転送の片方のディレクトリへのシンボリックリンク及び別の方" +"の実際のディレクトリであるように、隠され たパスの要素が大きな違いを持つことを" +"さらに可能にします。 " + +#: smb4k/core/smb4ksettings.cpp:832 +msgid "" +"Transfer directories without recursing (-d, --dirs). This means that all top-" +"level subdirectories are transferred but without their contents." +msgstr "" +"再帰なし(-d, --dirs) で、ディレクトリを転送します。 これは、サブディレクトリ" +"の内容が含まずに、すべてのトップレベルのサブディレクトリが転送されることを意" +"味します" + +#: smb4k/core/smb4ksettings.cpp:836 +msgid "" +"Compress data during transfer (-z, --compress). This significantly reduces " +"the amount of data that is being transferred. You may want to use this " +"option, if you have a slow connection." +msgstr "" +"転送中にデータを圧縮 (-z, --compress)します。 これは、転送されているデータの" +"量を著しく減らします。 あなたが遅い接続をしていれば、このオプションの使用を望" +"むでしょう。" + +#: smb4k/core/smb4ksettings.cpp:840 +msgid "Copy symlinks as symlinks (-l, --links)." +msgstr "シンボリックリンクはシンボリックリンクとして複写します(-l, --links)" + +#: smb4k/core/smb4ksettings.cpp:844 +msgid "" +"Transform symlinks into the items they are pointing to (-L, --copy-links)." +msgstr "シンボリックリンクを指示しているアイテムに変換します(-L, --copy-links)" + +#: smb4k/core/smb4ksettings.cpp:848 +msgid "" +"Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-" +"links). This means that only those symlinks are transformed that point to " +"items that are outside the copied tree. Absolute symlinks are treated the " +"same way. This option has no additional effect if --copy-links has also been " +"specified." +msgstr "" +"危険なシンボリックリンクを指示しているアイテムに変換します(--copy-unsafe-" +"links)。 これは、コピーされたツリの外にあるアイテムを指すシンボリックリンクだ" +"けが変換されることを意味します。 絶対的なシンボリックリンクも同等に扱われま" +"す。 --copy-links オプションが指定された場合、このオプションは付加的なオプ" +"ションを持っていません。" + +#: smb4k/core/smb4ksettings.cpp:852 +msgid "" +"Ignore symlinks that point outside the copied tree (--safe-links). All " +"absolute symlinks are also ignored. If you use this option in conjunction " +"with --relative you might get unexpected results." +msgstr "" +"コピーされたツリーの外を指めすシンボリックリンクを無視します(--safe-kinks)。 " +"全ての絶対的なシンボリックリンクも無視します。 --relative と同時にこのオプ" +"ションを使用する場合、予期しない結果が得るかもしれません" + +#: smb4k/core/smb4ksettings.cpp:856 +msgid "" +"Preserve hard links (-H, --hard-links). This options causes rsync to " +"preserve the hard links that are found during the transfer. Without it, hard " +"links are treated as though they were separate files." +msgstr "" +"ハードリンクを保ちます(-H, --hard-links)。 これは、転送中に見つかるハードリン" +"クを保存するために, rsync に与えるオプションです。 このオプションが無いと、" +"ハードリンクは、個別のファイルのように扱われます。" + +#: smb4k/core/smb4ksettings.cpp:860 +msgid "" +"Treat symlinked directories on the receiving side as though they were real " +"ones (-K, --keep-dirlinks). This only works if the symlink matches a real " +"directory from the sending side. Without this option, the receiver's symlink " +"will be deleted and replaced with a real directory." +msgstr "" +"受信側のシンボリックリンクされたディレクトリは、実際のものとして扱います(-K, " +"--keep-dirlinks)。 シンボリックリンクが、送信側の実際のディレクトリと一致する" +"場合のみ、動作します。 このオプションが無い場合、受信側のシンボリックリンク" +"は、削除され、実再のディレクトリに置き換えられます。" + +#: smb4k/core/smb4ksettings.cpp:864 +msgid "" +"Preserve permissions (-p, --perms). The permissions of the destination file " +"will be same as the source file. For what happens if this option is switched " +"off, please read rsync's manual page." +msgstr "" +"許可情報を保ちます(-p, --perms)。 転送先のファイルの許可情報は、転送元ファイ" +"ルと同じになります。 このオプションを無効にした場合、何が起きるかは、 rsync " +"のマニュアルページを参照してください。" + +#: smb4k/core/smb4ksettings.cpp:868 +msgid "" +"Preserve the group (-g, --group). The group of the destination file will be " +"set to the same value as the source file." +msgstr "" +"グループを保ちます(-g, --group)。転送先ファイルのグループは、転送元のファイル" +"と同じ値に設定されます" + +#: smb4k/core/smb4ksettings.cpp:871 +msgid "Preserve owner (super user only)" +msgstr "所有者(スーパーユーザーのみ)を保ちます" + +#: smb4k/core/smb4ksettings.cpp:872 +msgid "" +"Preserve the owner (-o, --owner). The owner of the destination file will be " +"set to the same value as the source file, but only if the receiving rsync is " +"run as the super user. Without this option, the owner is set to the invoking " +"user on the receiving side." +msgstr "" +"所有者(-o、--owner)を保ちます。目的のファイルの所有者はソース・ファイルと同じ" +"値に設定されるでしょう、 しかし、スーパーユーザーとして rsync で受信を実行さ" +"れる場合のみです。このオプションなしで、所有者 は受信側で起動ユーザに設定され" +"ます。" + +#: smb4k/core/smb4ksettings.cpp:876 +msgid "" +"Preserve device and special files (-D, --devices --specials). This option " +"causes rsync to transfer character and block devices as well as special " +"files such as named sockets and fifos. It works only partially if rsync is " +"not run as super user and the --super option is not specified." +msgstr "" +"デバイスおよび特別なファイル(-D,--devices --speciials)を保ちます。このオプ" +"ションは rsync に、 ソケットやFIFOSの命名された特別のファイルと同様にキャラク" +"タおよびブロックデバイスも転送させ ます。rsync がスーパーユーザーとして実行さ" +"れない場合、--super オプションを指定しない場合、 それは、単に部分的に作動しま" +"す。" + +#: smb4k/core/smb4ksettings.cpp:880 +msgid "" +"Preserve times (-t, --times). The modification times are transferred along " +"with the files. For what happens if this option is switched off, please read " +"rsync's manual page." +msgstr "" +"時間(-t、 --times)を保ちます。修正時間はファイルと共に転送されます。 このオプ" +"ションのスイッチを付加しない場合、なにが起こるか rsync のマニュアルページを読" +"んでください。" + +#: smb4k/core/smb4ksettings.cpp:884 +msgid "" +"Omit directories when preserving times (-O, --omit-dir-times). This means " +"that directories are omitted when modification times are being preserved. " +"Thus, this feature only works in conjunction with --times." +msgstr "" +"時間(-O、--omit-dir-times)を保つ場合ディレクトリは除外します。これは、修正時" +"間が保たれて場合ディレクトリが除外されることを意味します。したがって、この特" +"徴のみ、 --times と共に使用します。" + +#: smb4k/core/smb4ksettings.cpp:888 +msgid "" +"Remove all synchronized source files (--remove-source-files). This tells " +"rsync to remove from the sending side the non-directory items that are a " +"part of the transfer and have been successfully duplicated on the receiving " +"side." +msgstr "" +"同期されたソース・ファイル(--remove-souce-files)をすべて削除します。これは、" +"転送の一部で、受信側で正しく重複された非ディレクトリ アイテム を送信側から削" +"除するように、 rsync に命じます。" + +#: smb4k/core/smb4ksettings.cpp:892 +msgid "" +"Delete extraneous files from destination (--delete). This tells rsync to " +"delete all files from the receiving side that are not present on the sending " +"side, but only for the directories that are being synchronized." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:896 +msgid "" +"Delete files on the receiving side before the transfer starts (--delete-" +"before). This is the default behavior if --delete or --delete-excluded is " +"specified without one of the --delete-WHEN options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:900 +msgid "" +"Delete files on the receiving side after the transfer has completed (--" +"delete-after, --del)." +msgstr "" +"転送が完了した後、受信側のファイルを削除します。(--delete-after, --del)." + +#: smb4k/core/smb4ksettings.cpp:904 +msgid "" +"Delete files on the receiving side during the transfer (--delete-during). " +"This method is faster than --delete-before or --delete-after, but it is only " +"supported with rsync 2.6.4 or later." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:907 +msgid "Also delete excluded files from destination directory" +msgstr "さらに転送先のディレクトリーから除外されたファイルを削除します" + +#: smb4k/core/smb4ksettings.cpp:908 +msgid "" +"Also delete excluded files from destination directory (--delete-excluded). " +"In addition to deleting the files on the receiving side that are not on the " +"sending side, this tells rsync to also delete any files on the receiving " +"side that are excluded. Refer to rsync's manual page for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:912 +msgid "" +"Delete even if I/O errors occur (--ignore-errors). This option has to be " +"specified in conjunction with --delete to take effect." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:916 +msgid "" +"Force deletion of directories even if they are not empty (--force). This " +"option tells rsync to delete a non-empty directory when it is to be replaced " +"by a non-directory. This is only relevant if deletions are not active." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:919 +msgid "Only delete a maximum number of files" +msgstr "ファイルの最大の数を削除します" + +#: smb4k/core/smb4ksettings.cpp:920 +msgid "" +"Only delete as many files as defined here (--max-delete=NUM). This tells " +"rsync not to delete more than NUM files or directories (NUM must be non-" +"zero). This is useful when mirroring very large trees to prevent disasters." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:924 +msgid "Value for DeleteMaximum config entry" +msgstr "削除の最大値設定の値" + +#: smb4k/core/smb4ksettings.cpp:927 smb4k/core/smb4ksettings.cpp:935 +msgid "Don't transfer any file smaller than SIZE" +msgstr "SIZE より小さなどんなファイルも転送しません" + +#: smb4k/core/smb4ksettings.cpp:928 +msgid "" +"This option causes rsync to not transfer any file that is smaller than the " +"specified size (--min-size=SIZE)." +msgstr "" +"この rsync オプションは、指定されたサイズより小さいどんなファイルも転送しませ" +"ん。(--min-size=SIZE)." + +#: smb4k/core/smb4ksettings.cpp:932 +msgid "Value for MinimalTransferSize config entry" +msgstr "最小転送サイズ 設定の値" + +#: smb4k/core/smb4ksettings.cpp:936 +msgid "" +"This option causes rsync to not transfer any file that is larger than the " +"specified size (--max-size=SIZE)." +msgstr "" +"この rsync オプションは、指定されたサイズより大きいどんなファイルも転送しませ" +"ん。" + +#: smb4k/core/smb4ksettings.cpp:940 +msgid "Value for MamximalTransferSize config entry" +msgstr "最大転送サイズ設定の値" + +#: smb4k/core/smb4ksettings.cpp:944 +msgid "" +"Keep partially transferred files (--partial). The default behavor is that " +"any partially transferred file is deleted if the transfer is interrupted." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:947 +msgid "The directory where to put a partially transferred file into." +msgstr "部分的に転送したファイルを入れるディレクトリ" + +#: smb4k/core/smb4ksettings.cpp:948 +msgid "" +"Put a partially transferred file into this directory (--partial-dir=DIR). " +"This is a better way than the --partial option to keep partial files, " +"because the partially transferred file is kept in a different directory and " +"the destination file is not overwritten." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:951 +msgid "The data for the UsePartialDirectory option" +msgstr "UsePartialDirectory オプション用のデータ" + +#: smb4k/core/smb4ksettings.cpp:955 +msgid "" +"Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a " +"useful shorthand for excluding a broad range of files that you often do not " +"want to transfer between systems. This option uses the same algorithm that " +"CVS uses to determine if a file should be ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:958 +msgid "Exclude files that match a certain pattern" +msgstr "パターンに合うファイルを除外します" + +#: smb4k/core/smb4ksettings.cpp:959 +msgid "" +"Exclude files that match a certain pattern (--exclude=PATTERN). This is a " +"special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:962 +msgid "Pattern that is used for file exclusion" +msgstr "ファイル排除に使用されるパターン" + +#: smb4k/core/smb4ksettings.cpp:965 +msgid "Read exclude patterns from a file" +msgstr "除外パターンをファイルから読み込みます" + +#: smb4k/core/smb4ksettings.cpp:966 +msgid "" +"Read exclude patterns from a file (--exclude-from=FILE). This option is " +"similar to the --exclude=PATTERN option except that the exclude patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:969 +msgid "The file from which the exclude patterns are read" +msgstr "排除パターンが読まれるファイル" + +#: smb4k/core/smb4ksettings.cpp:972 +msgid "Do not exclude files matching a certain pattern" +msgstr "パターンに合うファイルを除外しません" + +#: smb4k/core/smb4ksettings.cpp:973 +msgid "" +"Do not exclude files matching a certain pattern (--include=PATTERN). This is " +"a special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:976 +msgid "Pattern that is used for file inclusion" +msgstr "ファイルの包含に使用されるパターン" + +#: smb4k/core/smb4ksettings.cpp:979 +msgid "Read include patterns from a file" +msgstr "インクルードパターンをファイルから読み込みます" + +#: smb4k/core/smb4ksettings.cpp:980 +msgid "" +"Read include patterns from a file (--include-from=FILE). This option is " +"similar to the --include=PATTERN option except that the include patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:983 +msgid "The file from which the include patterns are read" +msgstr "インクルードパターンが読まれるファイル" + +#: smb4k/core/smb4ksettings.cpp:986 +msgid "Add custom file-filtering rules" +msgstr "カスタムのファイルフィルタリングを加えます" + +#: smb4k/core/smb4ksettings.cpp:987 +msgid "" +"Add custom file-filtering rules (-f, --filter=RULE). This option allows you " +"to add rules to selectively exclude certain files from the list of files to " +"be transferred." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:990 +msgid "Use -F filter rule" +msgstr "フィルタールール -F を使用します" + +#: smb4k/core/smb4ksettings.cpp:991 +msgid "" +"This filter rule tells rsync to look for per-directory .rsync-filter files " +"that have been sprinkled through the hierarchy and use their rules to filter " +"the files in the transfer. It has no effect, if you also choose to use the --" +"filter='exclude .rsync-filter' rule." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:994 +msgid "Use -FF filter rule" +msgstr "フィルタールール -FF を使用します" + +#: smb4k/core/smb4ksettings.cpp:995 +msgid "" +"This rule filters out the .rsync-filter files from the transfer. These files " +"normally contain filter rules that can be activated by choosing the --" +"filter='dir-merge /.rsync-filter' rule and deselecting this one." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:999 +msgid "" +"Handle sparse files efficiently (-S, --sparse) so that they take up less " +"space on the destination. This option conflicts with --inplace. For further " +"information read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1003 +msgid "" +"Copy files whole (-W, --whole-file). With this option the incremental rsync " +"algorithm is not used and the whole file is sent as-is instead." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1006 +msgid "Do not cross file system boundaries" +msgstr "ファイルシステムの境界をまたがないでください" + +#: smb4k/core/smb4ksettings.cpp:1007 +msgid "" +"Do not cross file system boundaries (-x, --one-file-system). This tells " +"rsync to avoid crossing a filesystem boundary when recursing. For further " +"information on this option, read the manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1010 +msgid "Skip creating new files on the receiving side" +msgstr "受信側で新しいファイルを作成することをスキップします" + +#: smb4k/core/smb4ksettings.cpp:1011 +msgid "" +"Skip creating new files on the receiving side (--existing). This tells rsync " +"to skip creating files (including directories) that do not exist yet on the " +"destination. If this option is combined with the --ignore-existing option, " +"no files will be updated (which can be useful if all you want to do is to " +"delete extraneous files)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1014 +msgid "Skip updating files that exist on the receiving side" +msgstr "受信側で存在するファイルを更新することをスキップします。" + +#: smb4k/core/smb4ksettings.cpp:1015 +msgid "" +"Skip updating files that already exist on the receiving side (--ignore-" +"existing). Existing directories are not ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1018 +msgid "Delay updates until the end of the transfer" +msgstr "転送の終了までアップデートを遅らせます" + +#: smb4k/core/smb4ksettings.cpp:1019 +msgid "" +"Delay updates until the end of the transfer (--delay-updates). This option " +"puts the temporary file from each updated file into a holding directory " +"until the end of the transfer, at which time all the files are renamed and " +"copied into place in rapid succession." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1023 +msgid "" +"Make backups (-b, --backup). With this option, preexisting destination files " +"are renamed as each file is transferred or deleted. You can control where " +"the backup file goes and what (if any) suffix gets appended using the --" +"backup-dir=DIR and --suffix=SUFFIX options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1026 +msgid "Use a suffix for backups" +msgstr "拡張子をバックアップに使用します" + +#: smb4k/core/smb4ksettings.cpp:1027 +msgid "Use this suffix for backups (--suffix=SUFFIX)." +msgstr "この拡張子をバックアップに使用します (--suffix=SUFFIX)." + +#: smb4k/core/smb4ksettings.cpp:1030 +msgid "Backup suffix" +msgstr "バックアップ拡張子" + +#: smb4k/core/smb4ksettings.cpp:1033 +msgid "Put backups into a certain directory" +msgstr "ディレクトリーにバックアップを入れます" + +#: smb4k/core/smb4ksettings.cpp:1034 +msgid "Store backups in this directory (--backup-dir=DIR)." +msgstr "このディレクトリーにバックアップを格納します (--backup-dir=DIR)." + +#: smb4k/core/smb4ksettings.cpp:1037 +msgid "Backup directory" +msgstr "バックアップ・ディレクトリ" + +#: smb4k/core/smb4ksettings.cpp:1040 +msgid "Force a fixed checksum block-size" +msgstr "チェックサムブロック・サイズを固定しました" + +#: smb4k/core/smb4ksettings.cpp:1041 +msgid "" +"Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the " +"block size used in the rsync algorithm to a fixed value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1045 +msgid "The block size" +msgstr "ブロックサイズ" + +#: smb4k/core/smb4ksettings.cpp:1048 +msgid "Set block/file checksum seed" +msgstr "ブロック/ファイル チェックサムのたね 設定" + +#: smb4k/core/smb4ksettings.cpp:1049 +msgid "" +"Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum " +"seed to this integer. This 4 byte checksum seed is included in each block " +"and file MD4 checksum calculation. By default the checksum seed is generated " +"by the server and defaults to the current time." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1053 +msgid "The checksum seed" +msgstr "チェックサムのたね" + +#: smb4k/core/smb4ksettings.cpp:1056 +msgid "Skip files based on a checksum" +msgstr "チェックサムに基づいたファイルをスキップします" + +#: smb4k/core/smb4ksettings.cpp:1057 +msgid "" +"Skip files based on a checksum and not based on modification time and size (-" +"c, --checksum). For further information on how this feature works read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1074 +msgid "The program that should be used to gain super user privileges" +msgstr "スーパーユーザー特権を獲得するために使用するプログラム" + +#: smb4k/core/smb4ksettings.cpp:1075 +msgid "" +"Choose the program that will grant you limited super user privileges for " +"mounting and unmounting remote shares. You can either select sudo, the " +"standard tool for this purpose on most distributions, or super." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1078 +msgid "Use super user privileges to unmount inaccessible shares" +msgstr "" +"アクセスできない共有(シェア)をアンマウントするスーパーユーザー特権を使用しま" +"す" + +#: smb4k/core/smb4ksettings.cpp:1079 +msgid "" +"Unmount a share under Linux by force. This even works if the file system is " +"\"busy\", because it is immediately detached from the file system hierarchy " +"and all references to it are cleaned up later when it is not busy anymore. " +"Linux kernel 2.4.11 or later is needed to take advantage of this feature. " +"Use with case! Note, that you will need the root password to write the " +"necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1083 +msgid "" +"Use super user privileges for mounting and unmounting remote shares. This " +"feature is only needed, if you are not allowed to use smbmount, smbumount, " +"mount.cifs and umount.cifs as normal user. Note, that you will need the root " +"password to write the necessary changes to the configuration file." +msgstr "" +"遠隔シェアのマウント、アンマウントをスーパーユーザー権限で、使用します。あな" +"たが通常ユーザ として smbmount、smbumount、mount.cifs およびumount.cifs を使" +"用することが認められなけ れば、この機能が必要です。告知:設定ファイルへ必要な" +"変更を書き込む為にルートパスワードが必要になります。 " + +#: smb4k/core/smb4kerror.cpp:42 +msgid "" +"The browse list could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"ブラウズリストを読み出せませんでした。\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:46 +msgid "" +"The browse list could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"ブラウズリストを読み出せませんでした。\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:55 +msgid "" +"The list of servers could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"サーバーリストを読み出せませんでした。\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:59 +msgid "" +"The list of servers could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"サーバーリストを読み出せませんでした。\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:68 +msgid "" +"The list of shares could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"共有リストを読み出せませんでした。\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:72 +msgid "" +"The list of shares could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"共有リストを読み出せませんでした。\n" +" \"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:81 +msgid "" +"The preview could not be compiled.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"プレビューを作成できませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:85 +msgid "" +"The preview could not be compiled.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"プレビューを作成できませんでした\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:92 +#, fuzzy +msgid "" +"The wallet \"%1\" could not be opened. KWallet support will be disabled for " +"this session." +msgstr "" +"ワレット \"%1\" を開くのに、失敗しました。Kワレットのサポートは、無効になりま" +"した" + +#: smb4k/core/smb4kerror.cpp:100 +msgid "" +"Some file permissions could not be determined.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"いくつかのファイルパーミッションを断定できませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:104 +msgid "" +"Some file permissions could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"いくつかのファイルパーミッションを断定できませんでした\n" +" \"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:111 +msgid "" +"You are not allowed to unmount this share, because it is owned by another " +"user." +msgstr "" +"別のユーザが所有者の為、あなたは、この共有のアンマウントを認められません" + +#: smb4k/core/smb4kerror.cpp:119 +msgid "" +"The share \"%1\" could not be mounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"共有 \"%1\" は、マウントできませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:123 +msgid "" +"The share \"%1\" could not be mounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"共有 \"%1\" は、マウントできませんでした\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:132 +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"共有 \"%1\" は、アンマウントできませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:136 +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"共有 \"%1\" は、アンマウントできませんでした\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:143 +msgid "The file \"%1\" could not be found." +msgstr "ファイル \"%1\" は、見つけることができません" + +#: smb4k/core/smb4kerror.cpp:151 +msgid "The file \"%1\" could not be read." +msgstr "ファイル \"%1\" は、読むことがができません" + +#: smb4k/core/smb4kerror.cpp:155 +msgid "" +"The file \"%1\" could not be read.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"ファイル \"%1\" を読めません\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:164 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"システムコールの gethostname関数を使って、あなたのコンピュータ名を断定できま" +"せんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:168 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"システムコールの gethostname関数を使って、あなたのコンピュータ名を断定できま" +"せんでした\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:175 +msgid "" +"Either your PATH environment variable is not set properly or there are the " +"following programs missing on your system:\n" +"%1\n" +"Please correct this and restart Smb4K." +msgstr "" +"あなたの PATH 環境変数は、正確に設定していないか、あるいは、システム上で見当" +"たらない 下記プログラムがあります:\n" +"%1\n" +"これを修正して、Smb4Kを再起動してください。" + +#: smb4k/core/smb4kerror.cpp:181 +msgid "" +"The file \"%1\" is currently being edited by user %2. To avoid any problems, " +"access to this file is denied at the moment. Please try again later." +msgstr "" +"ファイル \"%1\" は現在、ユーザ \"%2\" によって編集されています。 いくつかの不" +"具合を回避する為 に、現在そのファイルアクセスを与えられないので、後でもう一度" +"試みてください" + +#: smb4k/core/smb4kerror.cpp:187 +msgid "The directory \"%1\" could not be created." +msgstr "ディレクトリー \"%1\" は、作成できません" + +#: smb4k/core/smb4kerror.cpp:193 +msgid "The file \"%1\" could not be written." +msgstr "ファイル \"%1\" は、書き込むことがができません" + +#: smb4k/core/smb4kerror.cpp:199 +msgid "" +"The share could not be unmounted, because the mount point string was empty." +msgstr "マウントポイントが空なので、この共有をアンマウントすることができません" + +#: smb4k/core/smb4kerror.cpp:205 +msgid "This feature has not been enabled." +msgstr "この機能は有効になっていません" + +#: smb4k/core/smb4kerror.cpp:211 +msgid "Printers cannot be bookmarked." +msgstr "プリンタはブックマークを付けることができません" + +#: smb4k/core/smb4kerror.cpp:217 +msgid "" +"IP addresses are not supported with this search method. Please choose \"Use " +"nmblookup\" in the configuration dialog and try again." +msgstr "" +"IPアドレスは、この検索メソッドでサポートしていません. 設定ダイアログで " +"\"nmblookupを使用する\"を選び、再び試みてください" + +#: smb4k/core/smb4kerror.cpp:225 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"マウントされたSMBFSやCIFS共有のリストは、インポートできません\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:229 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"マウントされたSMBFSやCIFS共有のリストは、インポートできません\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:236 +msgid "The command \"%1\" could not be found." +msgstr "コマンド \"%1\" は、見つかりません" + +#: smb4k/core/smb4kerror.cpp:244 +msgid "" +"The file \"%1\" could not be printed.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"ファイル \"%1\" を印刷できませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:248 +msgid "" +"The file \"%1\" could not be printed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"ファイル \"%1\" を印刷できませんでした\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:257 +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"一時ディレクトリ \"%1\" を作成できませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:261 +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"一時ディレクトリ \"%1\" を作成できませんでした\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:270 +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"一時ファイル \"%1\" を作成できませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:274 +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"一時ファイル \"%1\" を作成できませんでした\n" +"\"詳細\"でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:281 +msgid "The directory \"%1\" could not be found." +msgstr "ディレクトリ %1 は、見つけることができません" + +#: smb4k/core/smb4kerror.cpp:287 +msgid "" +"The file \"%1\" is irregular. That means it is either a symlink, a fifo, or " +"something similar. This could indicate that someone is trying to exploit " +"your system. Please inform your system administrator." +msgstr "" +"ファイル \"%1\" は不正です。それがシンボリックリンク又はFIFO、あるいは類似し" +"たもののいずれかであることを意味します。 これは、誰かがあなたのシステムを悪用" +"していることを示しています。システム管理者に通知してください" + +#: smb4k/core/smb4kerror.cpp:295 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"同期が完了できませんでした\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:299 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"同期が完了できませんでした\n" +"\"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:308 +msgid "The file \"%1\" could not be opened." +msgstr "ファイル %1 は、開けません" + +#: smb4k/core/smb4kerror.cpp:312 +msgid "" +"The file \"%1\" could not be opened.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"ファイル \"%1\" を開けません\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:321 +msgid "The file \"%1\" could not be closed." +msgstr "ファイル \"%1\" は、閉じれません" + +#: smb4k/core/smb4kerror.cpp:325 +msgid "" +"The file \"%1\" could not be closed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"ファイル \"%1\" を閉じれません\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:332 +msgid "" +"The list of arguments for the \"net\" command could not be assembled.\n" +"At the moment it reads: %1" +msgstr "" +"\"net\" コマンドの引数リストを、組み立てることができませんでした\n" +"現在、それは読み込みです: %1" + +#: smb4k/core/smb4kerror.cpp:340 +msgid "The list of supplementary group IDs could not be determined." +msgstr "補足のグループIDのリストを決定することができません" + +#: smb4k/core/smb4kerror.cpp:344 +msgid "" +"The list of supplementary group IDs could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"補足のグループIDのリストを決定することがでません\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:354 +msgid "" +"An unknown error occurred.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"不明なエラーが起こりました\n" +"エラーメッセージが無いので、詳細な情報を提供できません" + +#: smb4k/core/smb4kerror.cpp:358 +msgid "" +"An unknown error occurred.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"不明なエラーが起こりました\n" +" \"詳細\" でさらに詳しい情報を見つける為にエラーメッセージを読んでください" + +#: smb4k/core/smb4kerror.cpp:385 +msgid "" +"The mimetype \"%1\" is not supported. Please convert the file to PostScript " +"or PDF." +msgstr "" +"Mime タイプ \"%1\" は、サポートしていません。ファイルをポストスクリプトまたは" +"PDFに変換してください" + +#: smb4k/core/smb4kerror.cpp:391 +msgid "" +"You previously chose to use \"%1\", but now it is missing on your system. " +"Smb4K will disable this feature." +msgstr "" +"以前にプログラム \"%1\" の使用を選択しました。しかし、今、それは、システム上" +"で見当たりませんSmb4K は、この機能は、使えないでしょう" + +#: smb4k/core/smb4kerror.cpp:397 +msgid "" +"The label \"%1\" is used more than once. It will automatically be renamed " +"for bookmark \"%2\" to avoid confusion." +msgstr "" +"ラベル \"%1\" は二度以上使用されます。ブックマーク \"%2\" の混乱を回避するた" +"めに自動的に改名されます" + +#: smb4k/core/smb4kpasswordhandler.cpp:258 +msgid "The access was denied. " +msgstr "アクセスは、拒否されました " + +#: smb4k/core/smb4kpasswordhandler.cpp:261 +msgid "The password is not correct. " +msgstr "パスワードは、正確ではありません " + +#: smb4k/core/smb4kpasswordhandler.cpp:264 +msgid "The permission was denied. " +msgstr "パーミッションは、拒否されました " + +#: smb4k/core/smb4kpasswordhandler.cpp:267 +msgid "An authentication error occurred. " +msgstr "認証エエラーが生じました " + +#: smb4k/core/smb4kpasswordhandler.cpp:270 +msgid "The logon failed. " +msgstr "ログオンは、失敗しました " + +#: smb4k/core/smb4kpasswordhandler.cpp:278 +msgid "Please enter authentication data for server %1." +msgstr "サーバ %1 の認証データを入力してください" + +#: smb4k/core/smb4kpasswordhandler.cpp:282 +msgid "Please enter authentication data for share %1." +msgstr "共有 %1 の認証データを入力してください" + +#: smb4k/core/smb4knetworkitems.cpp:202 +msgid "Disk" +msgstr "ディスク" + +#: smb4k/core/smb4knetworkitems.cpp:206 smb4k/dialogs/smb4kprintdialog.cpp:71 +msgid "Printer" +msgstr "プリンタ" + +#: smb4k/core/smb4khomesshareshandler.cpp:73 +msgid "Specify User" +msgstr "指定ユーザ" + +#: smb4k/core/smb4khomesshareshandler.cpp:74 +msgid "Clear List" +msgstr "クリアーリスト" + +#: smb4k/core/smb4khomesshareshandler.cpp:87 +msgid "Please specify a user name." +msgstr "ユーザ名を指定します" + +#: smb4k/listview/smb4kshareslistview.cpp:52 +msgid "Owner" +msgstr "オーナ" + +#: smb4k/listview/smb4kshareslistview.cpp:54 +msgid "Login" +msgstr "ログイン" + +#: smb4k/listview/smb4kshareslistview.cpp:57 +msgid "Free" +msgstr "未使用" + +#: smb4k/listview/smb4kshareslistview.cpp:58 +msgid "Used" +msgstr "使用" + +#: smb4k/listview/smb4kshareslistview.cpp:59 +msgid "Total" +msgstr "合計" + +#: smb4k/listview/smb4kshareslistview.cpp:60 +msgid "Usage" +msgstr "使用法" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:122 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:122 +msgid "Mount point:" +msgstr "マウント ポイント:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:211 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:211 +msgid "Free:" +msgstr "未使用:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:215 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:215 +msgid "Used:" +msgstr "使用:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:219 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:219 +msgid "Total:" +msgstr "合計:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:223 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:223 +msgid "Usage:" +msgstr "使用法:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:229 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:388 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:229 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:388 +msgid "This share is inaccessible." +msgstr "この共有は、アクセスできない" + +#: smb4k/listview/smb4kshareslistview_part.cpp:115 +#: smb4k/smb4ksystemtray.cpp:794 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:112 +msgid "&Force Unmounting" +msgstr "強制アンマウント(&F)" + +#: smb4k/listview/smb4kshareslistview_part.cpp:119 +#: smb4k/smb4ksystemtray.cpp:446 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:116 +msgid "U&nmount All" +msgstr "全てアンマウント(&n)" + +#: smb4k/listview/smb4kshareslistview_part.cpp:122 +#: smb4k/smb4ksystemtray.cpp:799 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:119 +msgid "S&ynchronize" +msgstr "同期化(&y)" + +#: smb4k/listview/smb4kshareslistview_part.cpp:125 +#: smb4k/smb4ksystemtray.cpp:804 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:122 +msgid "Open with Konso&le" +msgstr "Konsole で開く(&l)" + +#: smb4k/listview/smb4kshareslistview_part.cpp:128 +#: smb4k/smb4ksystemtray.cpp:809 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:125 +msgid "Open with &Konqueror" +msgstr "Konqueror で開く(&K)" + +#: smb4k/listview/smb4kshareslistview_part.cpp:676 +msgid "Smb4KSharesListViewPart" +msgstr "Smb4KSharesListViewPart" + +#: smb4k/searchdlg/smb4ksearchdialog_part.cpp:254 +msgid "Smb4KSearchDialogPart" +msgstr "Smb4K 検索ダイアログ" + +#: smb4k/searchdlg/smb4ksearchdialogitem.cpp:80 +msgid "The search failed." +msgstr "検索は失敗しました" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:52 +msgid "Enter the search string here." +msgstr "検索文字列をここで入力します" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:57 plugin/smb4k_konqplugin.cpp:71 +msgid "Search" +msgstr "検索" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:63 +msgid "Search Results" +msgstr "検索 結果" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize" +msgstr "同期化" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize the destination with the source" +msgstr "送り先とソースと同期します" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap Paths" +msgstr "スワップパス" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap source and destination" +msgstr "スワップ元とスワップ先" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:60 +msgid "Source:" +msgstr "元:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:65 +msgid "Destination:" +msgstr "先:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:85 +msgid "Files transferred:" +msgstr "ファイル転送済み:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:90 +msgid "Transfer rate:" +msgstr "転送レート:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:46 +msgid "Print File" +msgstr "ファイルを印刷" + +#: smb4k/dialogs/smb4kprintdialog.cpp:74 +msgid "Name:" +msgstr "名前:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:98 +msgid "File:" +msgstr "ファイル:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:107 +msgid "Copies:" +msgstr "部数:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:155 +msgid "You haven't specified a file." +msgstr "ファイルを指定していません" + +#: smb4k/dialogs/smb4kmountdialog.cpp:48 +msgid "Mount Share" +msgstr "共有(シェア)をマウント" + +#: smb4k/dialogs/smb4kmountdialog.cpp:75 +msgid "IP Address:" +msgstr "IP アドレス:" + +#: smb4k/dialogs/smb4kmountdialog.cpp:83 +msgid "Add this share to the bookmarks" +msgstr "ブックマークへ、この共有(シェア)を追加" + +#: smb4k/dialogs/smb4kmountdialog.cpp:140 +msgid "" +"The format of the share you entered is not correct. It must have the form //" +"HOST/SHARE." +msgstr "" +"入力した共有名のフォーマットが間違っています。//HOST/SHARE の形式でなければな" +"りません" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:46 +msgid "Preview" +msgstr "プレビュー" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:111 +msgid "Forward" +msgstr "前" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:112 +msgid "Up" +msgstr "上" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:93 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:106 +msgid "Custom Options" +msgstr "カスタムオプション" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:185 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:301 +msgid "Try to authenticate with Kerberos (Active Directory)" +msgstr "Kerberos で認証を試みます(アクティブディレクトリ)" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:52 +msgid "Bookmark Editor" +msgstr "ブックマークエディター" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:61 +msgid "Bookmark" +msgstr "ブックマーク" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:62 +msgid "Workgroup" +msgstr "ワークグループ" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:64 +msgid "Label" +msgstr "ラベル" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:76 +msgid "Remove &All" +msgstr "全て削除(&A)" + +#: smb4k/smb4ksystemtray.cpp:59 smb4k/main.cpp:64 +msgid "Smb4K" +msgstr "Smb4K" + +#: smb4k/main.cpp:51 +msgid "" +"Smb4K is an advanced network neighborhood browser and a\n" +"front end to the programs of the Samba software suite." +msgstr "" +"Smb4K は、Samba ソフトウェア スイート プログラムへの高度な\n" +"ネットワーク近隣ブラウザ、およびフロント・エンドです" + +#: smb4k/main.cpp:66 +#, fuzzy +msgid "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" +msgstr "" +"(c) 2003-2007, Alexander Reinholdt\n" +"(c) 2004-2007, Massimo Callegari\n" +"(c) 2004, Franck Babin" + +#: smb4k/main.cpp:69 smb4k/main.cpp:70 smb4k/main.cpp:71 +msgid "Developer" +msgstr "開発者" + +#: smb4k/main.cpp:74 +msgid "Catalan translation" +msgstr "カタロニア語の翻訳" + +#: smb4k/main.cpp:75 smb4k/main.cpp:100 +msgid "Polish translation" +msgstr "ポーランド語の翻訳" + +#: smb4k/main.cpp:76 +msgid "Chinese Simplified translation" +msgstr "中国語 簡化字の翻訳" + +#: smb4k/main.cpp:77 +msgid "Russian translation" +msgstr "ロシア語の翻訳" + +#: smb4k/main.cpp:78 +msgid "Swedish translation and intensive testing" +msgstr "スウェーデン語の翻訳と、集中的な試験" + +#: smb4k/main.cpp:79 smb4k/main.cpp:96 +msgid "Brazilian Portuguese translation" +msgstr "ブラジルのポルトガル語の翻訳" + +#: smb4k/main.cpp:80 +msgid "Ukrainian translation" +msgstr "ウクライナ語の翻訳" + +#: smb4k/main.cpp:81 +msgid "Hungarian translation" +msgstr "ハンガリー語の翻訳" + +#: smb4k/main.cpp:82 smb4k/main.cpp:90 +msgid "Spanish translation" +msgstr "スペイン語の翻訳" + +#: smb4k/main.cpp:83 +msgid "Slovak translation" +msgstr "スロバキア語の翻訳" + +#: smb4k/main.cpp:84 +msgid "French translation" +msgstr "フランス語の翻訳" + +#: smb4k/main.cpp:85 +msgid "Japanese translation" +msgstr "日本語の翻訳" + +#: smb4k/main.cpp:86 +msgid "Bulgarian translation" +msgstr "ブルガリア語の翻訳" + +#: smb4k/main.cpp:87 +msgid "Italian translation" +msgstr "イタリア語の翻訳" + +#: smb4k/main.cpp:88 +msgid "Norwegian translations" +msgstr "ノルウェー語の翻訳" + +#: smb4k/main.cpp:89 +msgid "Czech translation" +msgstr "チェコ語の翻訳" + +#: smb4k/main.cpp:91 smb4k/main.cpp:97 +msgid "Turkish translation" +msgstr "トルコ語の翻訳" + +#: smb4k/main.cpp:92 smb4k/main.cpp:98 +msgid "Chinese Traditional translation" +msgstr "中国語 繁体字の翻訳" + +#: smb4k/main.cpp:93 +msgid "Icelandic translation" +msgstr "アイスランド語の翻訳" + +#: smb4k/main.cpp:94 +msgid "Danish translation" +msgstr "デンマーク語の翻訳" + +#: smb4k/main.cpp:95 +msgid "Dutch translation" +msgstr "オランダ語の翻訳" + +#: smb4k/main.cpp:99 +msgid "Testing of Smb4K under FreeBSD" +msgstr "FreeBSDでのSmb4Kの試験" + +#: smb4k/main.cpp:129 +msgid "" +"Smb4K now uses a different configuration system. Thus, your old settings are " +"obsolete and you have to reconfigure the application.\n" +"To assure a clean transition, the current configuration file will be removed." +msgstr "" +"Smb4Kは今異なった形態のシステムを使用します。したがって、あなたの古いセッティ" +"ングは旧式で、 アプリケーションを再構成しなければなりません。\n" +"きれいな推移を保証するために、現在の設定ファイルは削除されるでしょう。" + +#: smb4k/iconview/smb4ksharesiconview_part.cpp:549 +msgid "Smb4KSharesIconViewPart" +msgstr "Smb4KSharesIconViewPart" + +#. i18n: file ./smb4k/smb4k_shell.rc line 7 +#. i18n: file ./smb4k/browser/smb4knetworkbrowser_part.rc line 4 +#: rc.cpp:6 rc.cpp:27 +#, no-c-format +msgid "&Network" +msgstr "ネットワーク(&N)" + +#. i18n: file ./smb4k/smb4k_shell.rc line 9 +#: rc.cpp:9 +#, no-c-format +msgid "Sh&ares" +msgstr "共有(&a)" + +#. i18n: file ./smb4k/smb4k_shell.rc line 27 +#: rc.cpp:18 +#, no-c-format +msgid "Network ToolBar" +msgstr "ネットワークツールバー" + +#. i18n: file ./smb4k/smb4k_shell.rc line 29 +#: rc.cpp:21 +#, no-c-format +msgid "Shares View ToolBar" +msgstr "共有表示ツールバー" + +#. i18n: file ./smb4k/smb4k_shell.rc line 31 +#: rc.cpp:24 +#, no-c-format +msgid "Main ToolBar" +msgstr "メインツールバー" + +#. i18n: file ./smb4k/listview/smb4kshareslistview_part.rc line 4 +#. i18n: file ./smb4k/iconview/smb4ksharesiconview_part.rc line 4 +#: rc.cpp:30 rc.cpp:33 +#, no-c-format +msgid "&Shares" +msgstr "共有(&S)" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Toyohiro Asukai" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "toyohiro@ksmplus.com" + +#: plugin/smb4k_konqplugin.cpp:70 +msgid "Scan Network" +msgstr "ネットワークを検索" + +#: plugin/smb4k_konqplugin.cpp:122 +msgid "Samba Browser" +msgstr "Samba ブラウザ" + +#~ msgid "Translate reservered characters" +#~ msgstr "予約された文字を翻訳します" + +#~ msgid "The default user name for authentication" +#~ msgstr "認証用のデフォルト・ユーザー名" + +#~ msgid "The default password for authentication" +#~ msgstr "認証用のデフォルト・パスワード" diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 0000000..32619c9 --- /dev/null +++ b/po/sv.po @@ -0,0 +1,4140 @@ +# translation of sv.po to svenska +# Alexander Reinholdt , 2003. +# Marc Hansen , 2003, 2004, 2005. +# Marc Hansen , 2005. +msgid "" +msgstr "" +"Project-Id-Version: sv\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-10 15:17+0200\n" +"PO-Revision-Date: 2005-12-26 15:58+0100\n" +"Last-Translator: Marc Hansen \n" +"Language-Team: svenska \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.1\n" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" +"_:Översättare \n" +"Marc Hansen" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" +"_:Översättarens mailadress:\n" +"marcgie@mail.berlios.de" + +#: plugin/smb4k_konqplugin.cpp:70 +#, fuzzy +msgid "Scan Network" +msgstr "Nätverk" + +#: plugin/smb4k_konqplugin.cpp:71 smb4k/searchdlg/smb4ksearchdialog.cpp:57 +msgid "Search" +msgstr "Sök" + +#: plugin/smb4k_konqplugin.cpp:122 +msgid "Samba Browser" +msgstr "Samba Browser" + +#: plugin/smb4k_konqplugin.cpp:149 smb4k/smb4k.cpp:118 smb4k/smb4k.cpp:122 +#: smb4k/smb4k.cpp:316 +#, fuzzy +msgid "Search Dialog" +msgstr "Söker..." + +#: smb4k/smb4k.cpp:84 +msgid "&Dock Widgets" +msgstr "&Dock fönster" + +#: smb4k/smb4k.cpp:108 smb4k/smb4k.cpp:112 smb4k/smb4k.cpp:287 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:170 +msgid "Network Browser" +msgstr "Nätverksbläddrare" + +#: smb4k/smb4k.cpp:156 +#, fuzzy +msgid "Shares Vie&w" +msgstr "Visa katalog" + +#: smb4k/smb4k.cpp:159 +msgid "&Icon View" +msgstr "" + +#: smb4k/smb4k.cpp:163 +#, fuzzy +msgid "List Vie&w" +msgstr "Visa katalog" + +#: smb4k/smb4k.cpp:203 smb4k/smb4k.cpp:771 +msgid "Ready." +msgstr "Klar." + +#: smb4k/smb4k.cpp:264 +#, fuzzy +msgid "Jump to shares view" +msgstr "Visa katalog" + +#: smb4k/smb4k.cpp:293 +#, fuzzy +msgid "Jump to network browser" +msgstr "Nätverksbläddrare" + +#: smb4k/smb4k.cpp:332 +#, fuzzy +msgid "Jump to search dialog" +msgstr "Söker..." + +#: smb4k/smb4k.cpp:463 +#, fuzzy +msgid "" +"Closing the main window will keep Smb4K running in the system tray. Use " +"\"Quit\" from the \"File\" menu to quit the application." +msgstr "Avslutning av Huvudfönstred " + +#: smb4k/smb4k.cpp:465 +msgid "Docking in System Tray" +msgstr "Docka i systembrickan" + +#: smb4k/smb4k.cpp:496 +msgid "Exiting..." +msgstr "Avslutar..." + +#: smb4k/smb4k.cpp:649 +#, fuzzy +msgid "Looking up workgroups and domains..." +msgstr "Fråga en masterbrowser för att få browselistan" + +#: smb4k/smb4k.cpp:655 +#, fuzzy +msgid "Querying current master browser..." +msgstr "Fråga en masterbrowser för att få browselistan" + +#: smb4k/smb4k.cpp:661 +#, fuzzy +msgid "Querying master browser %1..." +msgstr "Fråga en masterbrowser för att få browselistan" + +#: smb4k/smb4k.cpp:667 +#, fuzzy +msgid "Scanning broadcast areas..." +msgstr "Broadcastadress:" + +#: smb4k/smb4k.cpp:681 +msgid "Opening workgroup..." +msgstr "Öppnar arbetsgrupp..." + +#: smb4k/smb4k.cpp:687 +#, fuzzy +msgid "Retrieving list of shares..." +msgstr "Sök datorn..." + +#: smb4k/smb4k.cpp:693 +#, fuzzy +msgid "Retrieving additional information..." +msgstr "Information mottags..." + +#: smb4k/smb4k.cpp:699 +#, fuzzy +msgid "Searching..." +msgstr "Sök nätverk..." + +#: smb4k/smb4k.cpp:705 +#, fuzzy +msgid "Retrying to retrieve list of shares..." +msgstr "Et fel uppstod, när vi fick listan av shares." + +#: smb4k/smb4k.cpp:711 smb4k/smb4k.cpp:729 smb4k/smb4k.cpp:741 +#: smb4k/smb4k.cpp:753 smb4k/smb4k.cpp:765 +msgid "Done." +msgstr "Klar." + +#: smb4k/smb4k.cpp:717 +msgid "Mounting share..." +msgstr "Monterar kataloger..." + +#: smb4k/smb4k.cpp:723 +msgid "Unmounting share..." +msgstr "Avmonterar katalog..." + +#: smb4k/smb4k.cpp:735 +#, fuzzy +msgid "Printing file..." +msgstr "Skriv filen" + +#: smb4k/smb4k.cpp:747 +#, fuzzy +msgid "Synchronizing data..." +msgstr "Fransk översättning" + +#: smb4k/smb4k.cpp:759 +#, fuzzy +msgid "Generating preview..." +msgstr "Förhandsgranskning mottages..." + +#: smb4k/smb4k.cpp:819 smb4k/smb4ksystemtray.cpp:236 +msgid "&Edit Bookmarks" +msgstr "&Skapa bokmärken" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:52 +msgid "Programs" +msgstr "Program" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:55 +msgid "Use the following program to gain super user privileges:" +msgstr "Använd följande Program, att få \"super användare\" privileges:" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:59 +msgid "Actions" +msgstr "Händelser" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:62 +#, fuzzy +msgid "" +"Use super user privileges to force the unmounting of (inaccessible) shares" +msgstr "" +"Använd superanvändareprivilegier för att montera och avmontera kataloger" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:64 +#: smb4k/core/smb4ksettings.cpp:1081 +msgid "Use super user privileges to mount and unmount shares" +msgstr "" +"Använd superanvändareprivilegier för att montera och avmontera kataloger" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:67 +msgid "Remove Entries" +msgstr "Radera text" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:68 +msgid "Remove entries from the configuration file" +msgstr "" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:69 +msgid "" +"Depending on your choice under \"Programs\", all entries that were written " +"by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. " +"Additionally, all your choices under \"Actions\" will be cleared." +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:70 +msgid "General Options" +msgstr "Allmänt ionställningar" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:73 +msgid "NetBIOS name:" +msgstr "NetBIOS namn:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:76 +#, fuzzy +msgid "Domain:" +msgstr "Plats:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:79 +msgid "Socket options:" +msgstr "Socketinställningar:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:82 +#, fuzzy +msgid "NetBIOS scope:" +msgstr "NetBIOS namn:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:85 +msgid "Remote SMB port:" +msgstr "Avlägsen SMB-port:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:89 +#: smb4k/configdlg/smb4kconfigdialog.cpp:165 +#: smb4k/core/smb4kpasswordhandler.cpp:237 +msgid "Authentication" +msgstr "Autentisering" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:91 +msgid "Try to authenticate with Kerberos" +msgstr "Försöck att använda Kerberos för authentisering" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:92 +msgid "Authenticate as machine account" +msgstr "Autentisering vid datorkonto" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:100 +#, fuzzy +msgid "General Settings" +msgstr "Allmänt ionställningar" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:110 +#: smb4k/configdlg/smb4ksambaoptions.cpp:384 +#: smb4k/listview/smb4kshareslistview.cpp:56 +msgid "File System" +msgstr "Filsystem" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:120 +#, fuzzy +msgid "" +"NOTE: You might need to enable support for either \"super\" or \"sudo\" in " +"the Super User page." +msgstr "" +"OBS: Om du använder CIFS filsystemed, du behöver super eller " +"sudo i filen \"super.tab\"." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:124 +msgid "User and Group" +msgstr "Användare och grupp" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:127 +#: smb4k/configdlg/smb4ksambaoptions.cpp:430 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:292 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:317 +#, fuzzy +msgid "User ID:" +msgstr "Användare:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:131 +#: smb4k/configdlg/smb4ksambaoptions.cpp:435 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:296 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:321 +#, fuzzy +msgid "Group ID:" +msgstr "Arbetsgrupp:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:136 +msgid "Charset and Codepage" +msgstr "Charset och codepage." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:139 +#, fuzzy +msgid "Client charset:" +msgstr "Linux charset:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:141 +#: smb4k/configdlg/smb4ksambaoptions.cpp:167 +#: smb4k/configdlg/smb4kconfigdialog.cpp:460 +#: smb4k/configdlg/smb4kconfigdialog.cpp:465 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1072 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1082 +msgid "default" +msgstr "grundinställning" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:165 +msgid "Server codepage:" +msgstr "Server codepage:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:202 +msgid "Permissions" +msgstr "Rättigheter" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:205 +msgid "File mask:" +msgstr "Filmask" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:209 +msgid "Directory mask:" +msgstr "Katalogmask:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:213 +#: smb4k/configdlg/smb4ksambaoptions.cpp:414 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:286 +msgid "Write access:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:215 +#: smb4k/configdlg/smb4ksambaoptions.cpp:418 +#: smb4k/configdlg/smb4kconfigdialog.cpp:360 +#: smb4k/configdlg/smb4kconfigdialog.cpp:458 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1060 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:913 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-write" +msgstr "läs-skriv" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:216 +#: smb4k/configdlg/smb4ksambaoptions.cpp:419 +#: smb4k/configdlg/smb4kconfigdialog.cpp:361 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1061 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-only" +msgstr "läs-bara" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:220 +msgid "Advanced CIFS Options" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:227 smb4k/core/smb4ksettings.cpp:692 +#, fuzzy +msgid "Do permission checks" +msgstr "Rättigheter" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:229 +msgid "Attempt to set UID and GID" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:231 smb4k/core/smb4ksettings.cpp:700 +msgid "Use server inode numbers" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:233 smb4k/core/smb4ksettings.cpp:704 +msgid "Do not cache inode data" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:235 smb4k/core/smb4ksettings.cpp:708 +msgid "Translate reserved characters" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:237 smb4k/core/smb4ksettings.cpp:712 +msgid "Do not use locking" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:244 +msgid "Additional options:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:248 +msgid "Advanced SMBFS Options" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:251 +#, fuzzy +msgid "Use Unicode when communicating with the server" +msgstr "Använd unicode vid kommunikation med servern" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:252 +#, fuzzy +msgid "Use large file system support" +msgstr "Använd stor filsystemssupport" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:258 +msgid "Caching time of directory listings:" +msgstr "Cachingtid för kataloglistor:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:289 +#, fuzzy +msgid "Protocol Hint" +msgstr "Protokoll" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:291 +#, fuzzy +msgid "Automatic detection" +msgstr "Autentisering" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:293 +#, fuzzy +msgid "RPC: Modern operating systems" +msgstr "RAP (äldere systemed)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:295 +#, fuzzy +msgid "RAP: Older operating systems" +msgstr "RAP (äldere systemed)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:297 +#, fuzzy +msgid "ADS: Active Directory environment (LDAP/Kerberos)" +msgstr "Active Directory (LDAP/Kerberos)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:318 +#, fuzzy +msgid "Name resolve order:" +msgstr "Mottag uppdrag:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:321 +msgid "Buffer size:" +msgstr "Buffertstorlek:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:323 +msgid " Bytes" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:325 +msgid "Signing state:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:327 +#, fuzzy +msgid "none" +msgstr "Ingen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:328 +#, fuzzy +msgid "on" +msgstr "Ingen" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:329 +msgid "off" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:330 +msgid "required" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:354 +msgid "Broadcast address:" +msgstr "Broadcastadress:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:357 +msgid "Try and bind to UDP port 137 to send and receive UDP datagrams" +msgstr "" +"Försök att använda UDP-port 137 för att skicka och mottaga UDP-datagram" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:381 +#: smb4k/listview/smb4kshareslistview.cpp:51 +msgid "Item" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:382 +#, fuzzy +msgid "Protocol" +msgstr "Protokoll" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:385 +msgid "Write Access" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:387 +msgid "Kerberos" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:388 +msgid "UID" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:389 +msgid "GID" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:390 +#, fuzzy +msgid "Port" +msgstr "&Avbryt" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:396 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:177 +#, fuzzy +msgid "Protocol:" +msgstr "Protokoll" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:400 +#: smb4k/configdlg/smb4kconfigdialog.cpp:327 +#: smb4k/configdlg/smb4kconfigdialog.cpp:328 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1039 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:970 +#, fuzzy +msgid "auto" +msgstr "Automatiskt" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:407 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:279 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:136 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:136 +#, fuzzy +msgid "File system:" +msgstr "Filsystem" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:423 +msgid "Kerberos:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:427 +#: smb4k/configdlg/smb4kconfigdialog.cpp:332 +#: smb4k/configdlg/smb4kconfigdialog.cpp:353 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1099 +msgid "no" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:428 +#: smb4k/configdlg/smb4kconfigdialog.cpp:331 +#: smb4k/configdlg/smb4kconfigdialog.cpp:352 +#: smb4k/configdlg/smb4kconfigdialog.cpp:441 +#: smb4k/configdlg/smb4kconfigdialog.cpp:451 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1098 +msgid "yes" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:440 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:164 +#, fuzzy +msgid "Port:" +msgstr "Skriva:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:451 +msgid "Remove All" +msgstr "Radera allt" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:493 +#, fuzzy +msgid "Custom" +msgstr "Automatiskt" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:55 +#, fuzzy +msgid "Default Destination" +msgstr "Standardlogin" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:59 +msgid "Rsync prefix:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:63 +#: smb4k/configdlg/smb4krsyncoptions.cpp:166 +#: smb4k/configdlg/smb4krsyncoptions.cpp:209 +msgid "General" +msgstr "Allmänt" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:67 +msgid "Archive mode" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:68 +msgid "Recurse into directories" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:69 +msgid "Skip files that are newer in target directory" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:70 smb4k/core/smb4ksettings.cpp:818 +msgid "Update destination files in place" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:71 smb4k/core/smb4ksettings.cpp:822 +msgid "Use relative path names" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:72 +msgid "Don't send implied directories" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:73 smb4k/core/smb4ksettings.cpp:830 +msgid "Transfer directories without recursing" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:74 smb4k/core/smb4ksettings.cpp:834 +msgid "Compress data during transfer" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:76 +msgid "Links" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:79 smb4k/core/smb4ksettings.cpp:838 +msgid "Preserve symlinks" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:80 smb4k/core/smb4ksettings.cpp:842 +msgid "Transform symlinks" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:81 smb4k/core/smb4ksettings.cpp:846 +msgid "Only transform unsafe symlinks" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:82 smb4k/core/smb4ksettings.cpp:850 +msgid "Ignore unsafe symlinks" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:83 smb4k/core/smb4ksettings.cpp:854 +msgid "Preserve hard links" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:84 smb4k/core/smb4ksettings.cpp:858 +msgid "Keep directory symlinks" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:86 +#, fuzzy +msgid "File Permissions, etc." +msgstr "Rättigheter" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:90 smb4k/core/smb4ksettings.cpp:862 +#, fuzzy +msgid "Preserve permissions" +msgstr "Rättigheter" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:91 smb4k/core/smb4ksettings.cpp:866 +msgid "Preserve group" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:92 +#, fuzzy +msgid "Preserve owner" +msgstr "Rättigheter" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:93 smb4k/core/smb4ksettings.cpp:874 +#, fuzzy +msgid "Preserve device and special files" +msgstr "Rättigheter" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:94 smb4k/core/smb4ksettings.cpp:878 +msgid "Preserve times" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:95 smb4k/core/smb4ksettings.cpp:882 +msgid "Omit directories when preserving times" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:105 +#, fuzzy +msgid "Copying" +msgstr "Kopia" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:115 +msgid "File Deletion" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:118 smb4k/core/smb4ksettings.cpp:886 +msgid "Remove synchronized source files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:119 smb4k/core/smb4ksettings.cpp:890 +msgid "Delete extraneous files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:120 smb4k/core/smb4ksettings.cpp:894 +msgid "Delete files before transfer" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:121 smb4k/core/smb4ksettings.cpp:898 +msgid "Delete files after transfer" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:122 smb4k/core/smb4ksettings.cpp:902 +msgid "Delete files during transfer" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:123 +msgid "Also delete excluded files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:124 smb4k/core/smb4ksettings.cpp:910 +msgid "Delete even if I/O errors occur" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:125 smb4k/core/smb4ksettings.cpp:914 +msgid "Force deletion of non-void directories" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:127 +#, fuzzy +msgid "Restrictions" +msgstr "Händelser" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:130 +msgid "Don't delete more than this many files:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:133 +#, fuzzy +msgid "File Transfer" +msgstr "Filmask" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:137 +msgid "Don't transfer any file smaller than:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:140 +msgid "Don't transfer any file larger than:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:143 smb4k/core/smb4ksettings.cpp:942 +msgid "Keep partially transferred files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:145 +msgid "Put a partially transferred file into:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:156 +msgid "File Deletion && Transfer" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:170 smb4k/core/smb4ksettings.cpp:953 +msgid "Auto-ignore files in the same way CVS does" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:172 +msgid "Exclude files matching this pattern:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:174 +msgid "Read exclude patterns from:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:177 +msgid "Don't exclude files matching this pattern:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:179 +msgid "Read include patterns from:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:183 +msgid "Filter Rules" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:186 +msgid "" +"The rules defined below will be added to the \"rsync\" command as they are. " +"Thus, you have to start with the --filter=... argument." +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:189 +msgid "Special filter rules:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:190 +msgid "Use --filter='dir-merge /.rsync-filter' filter rule" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:191 +msgid "Use --filter='exclude .rsync-filter' filter rule" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:199 +msgid "Filtering" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:213 smb4k/core/smb4ksettings.cpp:997 +msgid "Handle sparse files efficiently" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:214 smb4k/core/smb4ksettings.cpp:1001 +msgid "Copy files whole (no rsync algorithm)" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:215 +msgid "Don't cross file system boundaries" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:216 +msgid "Only update files that already exist" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:217 +msgid "Ignore files that already exist" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:218 +msgid "Delay updates until the end of transfer" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:220 +msgid "Backup" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:223 smb4k/core/smb4ksettings.cpp:1021 +msgid "Make backups" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:225 +msgid "Backup suffix:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:227 +#, fuzzy +msgid "Backup directory:" +msgstr "Active Directory" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:231 +msgid "Checksums" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:234 +msgid "Force fixed checksum block size:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:236 +msgid "Set block/file checksum seed:" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:238 +msgid "Skip files based on checksum" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:248 +msgid "Advanced" +msgstr "" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:50 +msgid "Browse List" +msgstr "Bläddra" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:53 +msgid "Scan the network neighborhood for available workgroups and domains" +msgstr "" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:55 +#, fuzzy +msgid "Query the current workgroup master browser" +msgstr "Fråga en masterbrowser för att få browselistan" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:62 +#, fuzzy +msgid "Query this master browser:" +msgstr "Pseudomästare:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:65 +#, fuzzy +msgid "Scan broadcast areas:" +msgstr "Broadcastadress:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:80 +msgid "Network Search" +msgstr "Nätverkssökning" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:85 +#, fuzzy +msgid "" +"Smb4K uses \"nmblookup\" by default to search for remote hosts. This method " +"is very reliable but fails sometimes if your network neighborhood is " +"configured uncommonly. In this case you should try to use \"smbclient\"." +msgstr "" +"Sm4k använder nmblookup vid grundinställingar för att göra " +"nätverkssökningar. Denna metod är mycket tillförlitlig, men misslyckas " +"ibland om ditt nätverksgrannskap är otillräckligt konfiguerat. Försök i så " +"fall att använda smbclient." + +#: smb4k/configdlg/smb4knetworkoptions.cpp:88 +msgid "Use nmblookup (recommended)" +msgstr "Använd nmblookup (rekommenderat)" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:91 +msgid "Use smbclient" +msgstr "Använd smbclient" + +#: smb4k/configdlg/smb4kshareoptions.cpp:53 +msgid "Directories" +msgstr "Kataloger" + +#: smb4k/configdlg/smb4kshareoptions.cpp:59 +#, fuzzy +msgid "Mount prefix:" +msgstr "Montera kataloger:" + +#: smb4k/configdlg/smb4kshareoptions.cpp:66 +msgid "Force generated subdirectories to be lower case" +msgstr "Forcera skapade underkataloger i sänkt shiftläge" + +#: smb4k/configdlg/smb4kshareoptions.cpp:69 +msgid "Mounting and Unmounting" +msgstr "Montera och avmontera" + +#: smb4k/configdlg/smb4kshareoptions.cpp:70 +msgid "Unmount all shares of user %1 on exit" +msgstr "Avmontera alla kataloger från %1 när du avslutar" + +#: smb4k/configdlg/smb4kshareoptions.cpp:72 +msgid "Remount recently used shares on program start" +msgstr "Montera alla kataloger som är senast använt vid program start" + +#: smb4k/configdlg/smb4kshareoptions.cpp:74 +msgid "Allow the unmounting of shares that are owned by other users" +msgstr "Tillåt avmontering av kataloger, som ägs av andra användare" + +#: smb4k/configdlg/smb4kshareoptions.cpp:77 +msgid "Checks" +msgstr "" + +#: smb4k/configdlg/smb4kshareoptions.cpp:79 +msgid "Interval between checks:" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:52 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:171 +#, fuzzy +msgid "Shares View" +msgstr "Visa katalog" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:55 +#, fuzzy +msgid "Show mounted shares in an icon view" +msgstr "Visa fjärrkataloger som lista istället som ikoner" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:57 +#, fuzzy +msgid "Show mounted shares in a list view" +msgstr "Visa fjärrkataloger som lista istället som ikoner" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:62 +#: smb4k/core/smb4ksettings.cpp:117 +msgid "Show custom bookmark label if available" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:64 +#, fuzzy +msgid "System Tray" +msgstr "Docka i systembrickan" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:67 +msgid "Embed application into the system tray" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:83 +#, fuzzy +msgid "Remote Shares" +msgstr "Utdelat &Kataloger" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:85 +#: smb4k/core/smb4ksettings.cpp:144 +msgid "Show printer shares" +msgstr "Visa skrivarresurser" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:86 +#: smb4k/core/smb4ksettings.cpp:148 +msgid "Show hidden shares" +msgstr "Visa dolda kataloger" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:87 +msgid "Show IPC$ shares" +msgstr "Visa IPC$-resurser" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:88 +msgid "Show ADMIN$ shares" +msgstr "Visa ADMIN$-resurser" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:90 +msgid "Columns" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:92 +msgid "Show type" +msgstr "Visa typ" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:93 +msgid "Show IP address" +msgstr "Visa IP-adress" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:94 +msgid "Show comment" +msgstr "Visa kommentar" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:96 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:124 +msgid "Tooltips" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:98 +msgid "Show tooltip with information about a network item" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:114 +#: smb4k/smb4ksystemtray.cpp:67 +#, fuzzy +msgid "Mounted Shares" +msgstr "Utdelat &Kataloger" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:116 +msgid "Show mount point instead of share name" +msgstr "Visa monteringsnamn istället för fjärrkatalognamn" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:117 +#: smb4k/core/smb4ksettings.cpp:180 +msgid "Show all shares that are mounted on the system" +msgstr "Visa alla fjärrkataloger som är monterade i systemet" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:119 +#, fuzzy +msgid "Drag and Drop" +msgstr "Användare och grupp" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:121 +msgid "Allow dropping of files and directories onto shares" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:122 +#, fuzzy +msgid "Allow dragging of shares" +msgstr "Visa skrivarresurser" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:126 +msgid "Show tooltip with information about a share" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:128 +#, fuzzy +msgid "List View" +msgstr "Visa katalog" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:132 +#: smb4k/core/smb4ksettings.cpp:200 +msgid "Show owner and group (SMBFS only)" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:133 +#: smb4k/core/smb4ksettings.cpp:204 +msgid "Show login (CIFS only)" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:135 +#, fuzzy +msgid "Show owner and group" +msgstr "Användare och grupp" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:137 +#: smb4k/core/smb4ksettings.cpp:208 +#, fuzzy +msgid "Show file system" +msgstr "Filsystem" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:138 +#: smb4k/core/smb4ksettings.cpp:212 +msgid "Show free disk space" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:139 +#: smb4k/core/smb4ksettings.cpp:216 +msgid "Show used disk space" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:140 +#: smb4k/core/smb4ksettings.cpp:220 +msgid "Show total disk space" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:141 +#: smb4k/core/smb4ksettings.cpp:224 +#, fuzzy +msgid "Show disk usage" +msgstr "Visa dolda kataloger" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:158 +msgid "Hidden Files and Directories" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:159 +msgid "Preview hidden files and directories" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:169 +#, fuzzy +msgid "Main Window && System Tray" +msgstr "Docka i systembrickan" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:172 +#, fuzzy +msgid "Preview Dialog" +msgstr "Förhandsgranskning" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:162 +msgid "User Interface" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:163 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:186 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:319 +#: smb4k/browser/smb4knetworkbrowser.cpp:50 +msgid "Network" +msgstr "Nätverk" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:164 +#: smb4k/listview/smb4kshareslistview_part.cpp:144 +#: smb4k/listview/smb4kshareslistview_part.cpp:346 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:141 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:232 +msgid "Shares" +msgstr "Kataloger" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:166 +msgid "Samba" +msgstr "Samba" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:167 +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47 +#, fuzzy +msgid "Synchronization" +msgstr "Fransk översättning" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:168 +msgid "Super User" +msgstr "Superanvändare" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:707 +msgid "[Network] The custom master browser has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:722 +msgid "[Network] The broadcast areas have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:733 +#, fuzzy +msgid "[Shares] The mount prefix is empty.\n" +msgstr "Montera kataloger:" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:748 +msgid "[Authentication] The default user name has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:759 +msgid "[Samba] The file mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:770 +msgid "[Samba] The directory mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:781 +msgid "[Samba] The UID is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:792 +msgid "[Samba] The GID is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:803 +msgid "[Synchronization] The rsync prefix is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:816 +msgid "" +"[Synchronization] The directory where partially transferred files should be " +"stored is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:829 +msgid "[Synchronization] The exclude patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:842 +msgid "[Synchronization] The path of the exclude file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:855 +msgid "[Synchronization] The include patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:868 +msgid "[Synchronization] The path of the include file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:887 +msgid "[Synchronization] The backup suffix has not been defined.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:900 +msgid "[Synchronization] The backup directory is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:908 +msgid "" +"The configuration could not be written, because one setting is incomplete:\n" +"%1Please correct this issue." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:912 +msgid "" +"The configuration could not be written, because %1 settings are incomplete:\n" +"%1Please correct these issues." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:1191 +msgid "Smb4KConfigDialog" +msgstr "" + +#: smb4k/configdlg/smb4kauthoptions.cpp:52 +msgid "Password Storage" +msgstr "Lösenord" + +#: smb4k/configdlg/smb4kauthoptions.cpp:53 +#, fuzzy +msgid "Save the authentication data in a wallet" +msgstr "Använd autentisiering för %1." + +#: smb4k/configdlg/smb4kauthoptions.cpp:55 +#, fuzzy +msgid "If no wallet is used, remember authentication data during run time" +msgstr "Om ingen plånbook är använd, håll lösenordet i RAM" + +#: smb4k/configdlg/smb4kauthoptions.cpp:58 +msgid "Default Login" +msgstr "Standardlogin" + +#: smb4k/configdlg/smb4kauthoptions.cpp:62 +msgid "Use default login" +msgstr "Använd default login" + +#: smb4k/configdlg/smb4kauthoptions.cpp:69 +#: smb4k/core/smb4kpasswordhandler.cpp:291 +#: smb4k/core/smb4khomesshareshandler.cpp:89 +msgid "User:" +msgstr "Användare:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:72 +msgid "This login name is used by default to authenticate to a remote server." +msgstr "" + +#: smb4k/configdlg/smb4kauthoptions.cpp:73 +#: smb4k/core/smb4kpasswordhandler.cpp:311 +msgid "Password:" +msgstr "Lösenord:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:77 +msgid "" +"This password is used by default to authenticate to a remote server. It may " +"be empty." +msgstr "" + +#: smb4k/smb4ksystemtray.cpp:59 smb4k/main.cpp:64 +msgid "Smb4K" +msgstr "Smb4K" + +#: smb4k/smb4ksystemtray.cpp:72 smb4k/browser/smb4knetworkbrowser_part.cpp:149 +#, fuzzy +msgid "M&ount Manually" +msgstr "&Montera manuellt" + +#: smb4k/smb4ksystemtray.cpp:446 +#: smb4k/listview/smb4kshareslistview_part.cpp:119 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:116 +#, fuzzy +msgid "U&nmount All" +msgstr "Avmo&ntera allt" + +#: smb4k/smb4ksystemtray.cpp:790 +#: smb4k/listview/smb4kshareslistview_part.cpp:111 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:203 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:108 +msgid "&Unmount" +msgstr "A&vmontera" + +#: smb4k/smb4ksystemtray.cpp:794 +#: smb4k/listview/smb4kshareslistview_part.cpp:115 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:112 +#, fuzzy +msgid "&Force Unmounting" +msgstr "&Forcera avmontering" + +#: smb4k/smb4ksystemtray.cpp:799 +#: smb4k/listview/smb4kshareslistview_part.cpp:122 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:119 +#, fuzzy +msgid "S&ynchronize" +msgstr "Fransk översättning" + +#: smb4k/smb4ksystemtray.cpp:804 +#: smb4k/listview/smb4kshareslistview_part.cpp:125 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:122 +#, fuzzy +msgid "Open with Konso&le" +msgstr "&Konqueror" + +#: smb4k/smb4ksystemtray.cpp:809 +#: smb4k/listview/smb4kshareslistview_part.cpp:128 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:125 +#, fuzzy +msgid "Open with &Konqueror" +msgstr "&Konqueror" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +#, fuzzy +msgid "Synchronize" +msgstr "Fransk översättning" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize the destination with the source" +msgstr "" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap Paths" +msgstr "" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap source and destination" +msgstr "" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:60 +#, fuzzy +msgid "Source:" +msgstr "Utdelad katalog:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:65 +#, fuzzy +msgid "Destination:" +msgstr "Dokumentation" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:85 +#, fuzzy +msgid "Files transferred:" +msgstr "Filmask" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:90 +msgid "Transfer rate:" +msgstr "" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:93 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:106 +#, fuzzy +msgid "Custom Options" +msgstr "Samba-alternativ" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/dialogs/smb4kprintdialog.cpp:83 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:129 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:207 +msgid "Host:" +msgstr "Värddator:" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/dialogs/smb4kmountdialog.cpp:70 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:120 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:182 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:120 +msgid "Share:" +msgstr "Utdelad katalog:" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:185 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:301 +#, fuzzy +msgid "Try to authenticate with Kerberos (Active Directory)" +msgstr "Försöck att använda Kerberos för authentisering" + +#: smb4k/dialogs/smb4kprintdialog.cpp:46 +msgid "Print File" +msgstr "Skriv filen" + +#: smb4k/dialogs/smb4kprintdialog.cpp:71 smb4k/core/smb4knetworkitems.cpp:206 +msgid "Printer" +msgstr "Skriva" + +#: smb4k/dialogs/smb4kprintdialog.cpp:74 +msgid "Name:" +msgstr "" + +#: smb4k/dialogs/smb4kprintdialog.cpp:86 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:135 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:211 +#, fuzzy +msgid "IP address:" +msgstr "IP-adress:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:88 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:116 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:136 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:140 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:144 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:160 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:213 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:292 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:301 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:310 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:331 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:335 +msgid "Unknown" +msgstr "Okänd" + +#: smb4k/dialogs/smb4kprintdialog.cpp:92 smb4k/dialogs/smb4kmountdialog.cpp:79 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:109 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:154 +msgid "Workgroup:" +msgstr "Arbetsgrupp:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:98 +msgid "File:" +msgstr "Fil:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:107 +msgid "Copies:" +msgstr "Kopia:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:155 +msgid "You haven't specified a file." +msgstr "Du har inte marerad afil." + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:46 +msgid "Preview" +msgstr "Förhandsgranskning" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:111 +msgid "Forward" +msgstr "" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:112 +msgid "Up" +msgstr "Upp:" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:52 +msgid "Bookmark Editor" +msgstr "Bokmärkeseditor" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:61 +msgid "Bookmark" +msgstr "Bokmärken" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:62 +#, fuzzy +msgid "Workgroup" +msgstr "Arbetsgrupp:" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:63 +#: smb4k/browser/smb4knetworkbrowser.cpp:52 +msgid "IP Address" +msgstr "IP-adress" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:64 +msgid "Label" +msgstr "" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:76 +#, fuzzy +msgid "Remove &All" +msgstr "Radera allt" + +#: smb4k/dialogs/smb4kmountdialog.cpp:48 +msgid "Mount Share" +msgstr "Montera Kataloger" + +#: smb4k/dialogs/smb4kmountdialog.cpp:75 +msgid "IP Address:" +msgstr "IP-adress:" + +#: smb4k/dialogs/smb4kmountdialog.cpp:83 +msgid "Add this share to the bookmarks" +msgstr "Lägg katalogen till Bokmärken" + +#: smb4k/dialogs/smb4kmountdialog.cpp:140 +#, fuzzy +msgid "" +"The format of the share you entered is not correct. It must have the form //" +"HOST/SHARE." +msgstr "Katalognamn är fel. Sriv //DATOR/KATALOGNAMN." + +#: smb4k/listview/smb4kshareslistview_part.cpp:676 +msgid "Smb4KSharesListViewPart" +msgstr "" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:122 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:122 +#, fuzzy +msgid "Mount point:" +msgstr "Monteringspunkt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:211 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:211 +msgid "Free:" +msgstr "Ledig:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:215 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:215 +msgid "Used:" +msgstr "Använt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:219 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:219 +msgid "Total:" +msgstr "Totalt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:223 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:223 +msgid "Usage:" +msgstr "Använt:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:229 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:388 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:229 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:388 +msgid "This share is inaccessible." +msgstr "" + +#: smb4k/listview/smb4kshareslistview.cpp:52 +msgid "Owner" +msgstr "" + +#: smb4k/listview/smb4kshareslistview.cpp:54 +msgid "Login" +msgstr "" + +#: smb4k/listview/smb4kshareslistview.cpp:57 +#, fuzzy +msgid "Free" +msgstr "Ledig:" + +#: smb4k/listview/smb4kshareslistview.cpp:58 +#, fuzzy +msgid "Used" +msgstr "Använt:" + +#: smb4k/listview/smb4kshareslistview.cpp:59 +#, fuzzy +msgid "Total" +msgstr "Totalt:" + +#: smb4k/listview/smb4kshareslistview.cpp:60 +#, fuzzy +msgid "Usage" +msgstr "Använt:" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:141 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:532 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:552 +#, fuzzy +msgid "Scan Netwo&rk" +msgstr "Nätverk" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:144 +msgid "&Abort" +msgstr "&Avbryt" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:154 +msgid "Au&thentication" +msgstr "A&utentisering:" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:157 +#, fuzzy +msgid "&Custom Options" +msgstr "Samba-alternativ" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:160 +#, fuzzy +msgid "Add &Bookmark" +msgstr "&Skapa bokmärken" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:163 +msgid "Pre&view" +msgstr "F&örhandsgranskning" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:166 +#, fuzzy +msgid "&Print File" +msgstr "Skriv filen" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:169 +msgid "&Mount" +msgstr "&Montera" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:345 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:370 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:400 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:462 +msgid "Scan Compute&r" +msgstr "" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:383 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:486 +#, fuzzy +msgid "Scan Wo&rkgroup" +msgstr "Arbetsgrupp:" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:1905 +#, fuzzy +msgid "Smb4KNetworkBrowserPart" +msgstr "Nätverksbläddrare" + +#: smb4k/browser/smb4knetworkbrowser.cpp:51 +msgid "Type" +msgstr "Typ" + +#: smb4k/browser/smb4knetworkbrowser.cpp:53 +msgid "Comment" +msgstr "Kommentar" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#, fuzzy +msgid "Pseudo master browser:" +msgstr "Pseudomästare:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:158 +#, fuzzy +msgid "Master browser:" +msgstr "Master:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:132 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:185 +#, fuzzy +msgid "Comment:" +msgstr "Kommentar" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:139 +#, fuzzy +msgid "Operating system:" +msgstr "Filsystem" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:143 +#, fuzzy +msgid "Server string:" +msgstr "Server:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:188 +msgid "Type:" +msgstr "Typ:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:196 +#, fuzzy +msgid "Mounted:" +msgstr "Montera" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:52 +#, fuzzy +msgid "Enter the search string here." +msgstr "Skriv in datorn här." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:63 +#, fuzzy +msgid "Search Results" +msgstr "Sökresultat" + +#: smb4k/searchdlg/smb4ksearchdialogitem.cpp:80 +#, fuzzy +msgid "The search failed." +msgstr "Sökandet efter %1 misslyckades." + +#: smb4k/searchdlg/smb4ksearchdialog_part.cpp:254 +#, fuzzy +msgid "Smb4KSearchDialogPart" +msgstr "Söker..." + +#: smb4k/iconview/smb4ksharesiconview_part.cpp:549 +msgid "Smb4KSharesIconViewPart" +msgstr "" + +#: smb4k/main.cpp:51 +msgid "" +"Smb4K is an advanced network neighborhood browser and a\n" +"front end to the programs of the Samba software suite." +msgstr "" + +#: smb4k/main.cpp:66 +msgid "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" +msgstr "" + +#: smb4k/main.cpp:69 smb4k/main.cpp:70 smb4k/main.cpp:71 +msgid "Developer" +msgstr "Utvecklare" + +#: smb4k/main.cpp:74 +msgid "Catalan translation" +msgstr "Katalansk översättning" + +#: smb4k/main.cpp:75 smb4k/main.cpp:100 +msgid "Polish translation" +msgstr "Polsk översättning" + +#: smb4k/main.cpp:76 +msgid "Chinese Simplified translation" +msgstr "Kinesisk förenklad översättning" + +#: smb4k/main.cpp:77 +msgid "Russian translation" +msgstr "Rysk översättning" + +#: smb4k/main.cpp:78 +msgid "Swedish translation and intensive testing" +msgstr "Svensk översättning och test" + +#: smb4k/main.cpp:79 smb4k/main.cpp:96 +msgid "Brazilian Portuguese translation" +msgstr "Brasiliansk portugisisk översättning" + +#: smb4k/main.cpp:80 +msgid "Ukrainian translation" +msgstr "Ukrainsk översättning" + +#: smb4k/main.cpp:81 +msgid "Hungarian translation" +msgstr "Ungersk översättning" + +#: smb4k/main.cpp:82 smb4k/main.cpp:90 +msgid "Spanish translation" +msgstr "Spansk översättning" + +#: smb4k/main.cpp:83 +msgid "Slovak translation" +msgstr "Slovakisk översättning" + +#: smb4k/main.cpp:84 +msgid "French translation" +msgstr "Fransk översättning" + +#: smb4k/main.cpp:85 +msgid "Japanese translation" +msgstr "Japansk översättning" + +#: smb4k/main.cpp:86 +msgid "Bulgarian translation" +msgstr "Bulgarisk översättning" + +#: smb4k/main.cpp:87 +msgid "Italian translation" +msgstr "Italiensk översättning" + +#: smb4k/main.cpp:88 +msgid "Norwegian translations" +msgstr "Norsk översättning" + +#: smb4k/main.cpp:89 +msgid "Czech translation" +msgstr "Czech översättning" + +#: smb4k/main.cpp:91 smb4k/main.cpp:97 +msgid "Turkish translation" +msgstr "Turkisk översättning" + +#: smb4k/main.cpp:92 smb4k/main.cpp:98 +msgid "Chinese Traditional translation" +msgstr "Kinesisk förenklad översättning" + +#: smb4k/main.cpp:93 +msgid "Icelandic translation" +msgstr "Isländska översättning" + +#: smb4k/main.cpp:94 +msgid "Danish translation" +msgstr "Dansk översättning" + +#: smb4k/main.cpp:95 +msgid "Dutch translation" +msgstr "Hollöndsk översättning" + +#: smb4k/main.cpp:99 +msgid "Testing of Smb4K under FreeBSD" +msgstr "Testin av Smb4k med FreeBSD" + +#: smb4k/main.cpp:129 +msgid "" +"Smb4K now uses a different configuration system. Thus, your old settings are " +"obsolete and you have to reconfigure the application.\n" +"To assure a clean transition, the current configuration file will be removed." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:30 +msgid "The path to the program \"grep\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:33 +msgid "The path to the program \"awk\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:36 +msgid "The path to the program \"sed\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:39 +msgid "The path to the program \"xargs\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:42 +msgid "The path to the program \"rmdir\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:45 +msgid "The path to the program \"nmblookup\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:48 +msgid "The path to the program \"smbclient\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:51 +msgid "The path to the program \"smbspool\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:54 +msgid "The path to the program \"net\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:57 +msgid "The path to the program \"mount.cifs\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:60 +msgid "The path to the program \"umount.cifs\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:63 +msgid "The path to the program \"smbmount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:66 +msgid "The path to the program \"smbumount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:69 +msgid "The path to the program \"mount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:72 +msgid "The path to the program \"mount_smbfs\" (FreeBSD only)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:75 +msgid "The path to the program \"smbutil\" (FreeBSD only)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:78 +msgid "The path to the program \"umount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:81 +msgid "The path to the program \"smb4k_mount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:84 +msgid "The path to the program \"smb4k_umount\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:87 +msgid "The path to the program \"smb4k_kill\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:90 +msgid "The path to the program \"smb4k_cat\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:93 +msgid "The path to the program \"smb4k_mv\"" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:96 +msgid "The path to the program \"super\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:99 +msgid "The path to the program \"sudo\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:102 +msgid "The path to the program \"dvips\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:105 +msgid "The path to the program \"enscript\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:108 +msgid "The path to the program \"rsync\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:111 +msgid "The path to the program \"konsole\" (optional)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:118 +msgid "" +"Do not show the name of the share that is represented by the bookmark but " +"the custom label that was defined in the bookmark editor." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:121 +msgid "Embed application into system tray" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:122 +msgid "" +"Embed the application into the system tray. The system tray widget provides " +"a popup menu with several commonly used tasks so that you do not need to " +"bring up the main window everytime. If this setting is chosen you have to " +"use \"Quit\" from the \"File\" menu or the system tray widget to exit the " +"application." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:125 +msgid "Start docked" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:126 +msgid "" +"Start the application docked to the system tray, i.e. only the system tray " +"widget is shown and the main window is hidden. You can bring the main window " +"up by clicking on the system tray widget or by choosing \"Restore\" from its " +"popup menu." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:140 +msgid "How the shares should be displayed" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:141 +msgid "" +"Choose the kind of view you prefer for displaying the mounted shares. There " +"is an icon view or a list view available." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:145 +msgid "Printer shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:149 +msgid "" +"Hidden shares will be displayed in the network browser. Hidden shares are " +"ending with a $ sign, e.g. Musik$ or IPC$." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:152 +#, fuzzy +msgid "Show hidden IPC$ shares" +msgstr "Visa dolda kataloger" + +#: smb4k/core/smb4ksettings.cpp:153 +msgid "Hidden IPC$ shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:156 +#, fuzzy +msgid "Show hidden ADMIN$ shares" +msgstr "Visa dolda kataloger" + +#: smb4k/core/smb4ksettings.cpp:157 +msgid "Hidden ADMIN$ shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:160 +#, fuzzy +msgid "Show the type of a share" +msgstr "Visa dolda kataloger" + +#: smb4k/core/smb4ksettings.cpp:161 +msgid "" +"The type of a share will be displayed in a separate column in the network " +"browser. It can either be Disk, Print or IPC." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:164 +#, fuzzy +msgid "Show the IP address of a server" +msgstr "Visa IP-adress" + +#: smb4k/core/smb4ksettings.cpp:165 +msgid "" +"The IP address of the server will be displayed in a separate column in the " +"network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:168 +#, fuzzy +msgid "Show the comment of a share" +msgstr "Visa dolda kataloger" + +#: smb4k/core/smb4ksettings.cpp:169 +msgid "" +"The comment describing the server or share will be displayed in a separate " +"column in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:172 +msgid "Show a tooltip with information about the network item" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:173 +msgid "The tooltip shows various information about the current network item." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:176 +#, fuzzy +msgid "Show the mount point of a share instead of its name" +msgstr "Visa monteringsnamn istället för fjärrkatalognamn" + +#: smb4k/core/smb4ksettings.cpp:177 +msgid "" +"A share is normally displayed with its name in the shares view. Choosing " +"this feature will cause the exchange of the share name by the mount point." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:181 +msgid "" +"You will not only see the shares that were mounted and are owned by you, but " +"also all other mounts using the SMBFS and CIFS file system that are present " +"on the system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:184 +msgid "Allow the dropping of files and directories onto share icons" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:185 +msgid "" +"This setting allows you to drop files or whole directories onto the share " +"icons, which will cause them to be copied." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:188 +#, fuzzy +msgid "Allow the dragging of share icons" +msgstr "Visa skrivarresurser" + +#: smb4k/core/smb4ksettings.cpp:189 +msgid "" +"This setting allows you to drag a share item out of Smb4K and onto the " +"desktop or into a file manager. Only enable it if you think you absolutely " +"need it and read the handbook before you mark this checkbox." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:192 +msgid "Show a tooltip with information about the share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:193 +msgid "The tooltip shows various information about the current share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:196 +msgid "Show hidden files and directories when previewing a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:197 +msgid "" +"Display hidden files and directories in the preview dialog. The names of " +"hidden files and directories are beginning with a period and are usually " +"needed for very specific purposes (configuration file of an application, " +"etc.). Since they are not of any importance for your regular work, you " +"normally do not need to enable this feature." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:201 +msgid "" +"Show the UID and GID that own all files on the mounted file system. At the " +"moment the column will only contain an entry if the share was mounted with " +"the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:205 +msgid "" +"Show the login that was used to authenticate to the server. The column will " +"only contain an entry if the share was mounted with the CIFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:209 +msgid "Show the file system that was used for mounting the share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:213 +msgid "Show the free disk space that is left on the share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:217 +#, fuzzy +msgid "Show the disk space that is already used on the share." +msgstr "Visa alla fjärrkataloger som är monterade i systemet" + +#: smb4k/core/smb4ksettings.cpp:221 +#, fuzzy +msgid "Show the total disk space of the share." +msgstr "Visa dolda kataloger" + +#: smb4k/core/smb4ksettings.cpp:225 +msgid "Show the space that is used on the share in percent." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:252 +#, fuzzy +msgid "Method how to retrieve the browse list" +msgstr "Granska nätverket för att få browselistan" + +#: smb4k/core/smb4ksettings.cpp:253 +msgid "" +"Choose the method how to compile the initial browse list. There are four " +"options available: The first one is the default one and employs \"nmblookup -" +"M -- -\" to discover all workgroups, domains, and their master browsers on " +"your network neighborhood. The second one instructs Smb4K to query the " +"current master browser of your workgroup or domain to retrieve the browse " +"list. The third is similar to the second one except that you can define the " +"master browser that should be queried. If you choose the last option, the " +"provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x." +"x -- '*'\"." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:256 +msgid "A custom master browser that is to be queried" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:257 +msgid "" +"Enter the name or IP address of a master browser here that should be queried " +"to compile the initial browse list." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:260 +msgid "A custom list of broadcast addresses" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:261 +msgid "" +"Enter a comma-separated list of broadcast addresses here (e.g. " +"192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the " +"respective broadcast areas." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:275 +msgid "Method for searching for remote hosts" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:276 +msgid "" +"Smb4K is able to search for remote hosts either using nmblookup or " +"smbclient. The nmblookup method is very reliable and works well. However, if " +"your network is configured uncommonly and you experience problems when " +"searching, you should try the smbclient method. But please note that you " +"lose the ability to search for IP addresses in that case." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:282 +#, fuzzy +msgid "The mount prefix" +msgstr "Montera kataloger:" + +#: smb4k/core/smb4ksettings.cpp:283 +msgid "" +"This is the prefix where Smb4K will create the mount points and mount the " +"remote shares." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:286 +#, fuzzy +msgid "Force the subdirectories created by Smb4K to be lowercase" +msgstr "Forcera skapade underkataloger i sänkt shiftläge" + +#: smb4k/core/smb4ksettings.cpp:287 +#, fuzzy +msgid "" +"All names of the subdirectories created by Smb4K below the mount prefix will " +"be lowercase." +msgstr "Forcera skapade underkataloger i sänkt shiftläge" + +#: smb4k/core/smb4ksettings.cpp:290 +#, fuzzy +msgid "Unmount the shares owned by the user on exit" +msgstr "Avmontera alla kataloger från %1 när du avslutar" + +#: smb4k/core/smb4ksettings.cpp:291 +#, fuzzy +msgid "Unmount all shares that belong to you when the program exits." +msgstr "Avmontera alla kataloger från %1 när du avslutar" + +#: smb4k/core/smb4ksettings.cpp:294 +#, fuzzy +msgid "Remount shares" +msgstr "Utdelat &Kataloger" + +#: smb4k/core/smb4ksettings.cpp:295 +msgid "" +"Remount all your shares that were still mounted when you exited the program. " +"Shares that were mounted by other users are ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:298 +#, fuzzy +msgid "Allow the unmounting of shares owned by other users" +msgstr "Tillåt avmontering av kataloger, som ägs av andra användare" + +#: smb4k/core/smb4ksettings.cpp:299 +msgid "" +"Allow the unmounting of shares that were mounted by other users. In most " +"cases you need super user privileges for this. Please think before you " +"enable this option!" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:304 +msgid "Interval between checks for new and inaccessible shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:305 +msgid "" +"This is the time that elapses until Smb4K checks again for new mounts and " +"unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note " +"that the smaller the interval gets the higher is your system load." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:311 +#, fuzzy +msgid "Use a wallet to store authentication data" +msgstr "Använd autentisiering för %1." + +#: smb4k/core/smb4ksettings.cpp:312 +msgid "" +"Use a wallet to store the authentication data. The login name and the " +"password name are stored encrypted on your hard drive. If this setting is " +"disabled, the authentication data is not stored permanently but only " +"temporarily." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:315 +msgid "Remember passwords if no wallet is used" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:316 +msgid "" +"If you decided to store the login names and passwords only temporarily, " +"Smb4K will remember them until the program exits. If you disable this " +"setting, you will have to provide the authentication data everytime it is " +"needed." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:319 +#, fuzzy +msgid "Use a default login" +msgstr "Använd default login" + +#: smb4k/core/smb4ksettings.cpp:320 +msgid "" +"Enable the usage of a default login name and password. The authentication " +"data provided below is then used by default to authenticate to a remote " +"server. This is very useful e.g. if you are working in an Active Directory " +"environment or an NT domain." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:326 +msgid "The NetBIOS name of this computer" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:327 +msgid "" +"This is the NetBIOS name of this computer that is used by Smb4K. By default, " +"it is either the NetBIOS name that is defined in the smb.conf file or the " +"host name." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:330 +msgid "The name of the workgroup/domain this computer is in" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:331 +msgid "" +"This is the workgroup or domain this computer is or should be in. By " +"default, it is the workgroup that is defined in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:334 +#, fuzzy +msgid "The socket options" +msgstr "Socketinställningar:" + +#: smb4k/core/smb4ksettings.cpp:335 +msgid "" +"These are the TCP socket options that are used by nmblookup, smbmount and " +"smbclient. Socket options are controls on the networking layer of the " +"operating systems which allow the connection to be tuned. See the manual " +"page of smb.conf for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:338 +#, fuzzy +msgid "The NetBIOS scope" +msgstr "NetBIOS namn:" + +#: smb4k/core/smb4ksettings.cpp:339 +msgid "" +"This sets the NetBIOS scope that nmblookup, smbmount and smbclient will " +"operate under. It should not be set unless every machine on your network " +"neighborhood sets this value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:344 +#, fuzzy +msgid "The remote SMB port" +msgstr "Avlägsen SMB-port:" + +#: smb4k/core/smb4ksettings.cpp:345 +msgid "" +"This is the port that is to be used for connecting to remote servers. Please " +"note that this is independent of the settings in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:348 +#, fuzzy +msgid "Use Kerberos for authentication" +msgstr "Denna masterbrowser behöver autentisering" + +#: smb4k/core/smb4ksettings.cpp:349 +msgid "" +"Try to authenticate with Kerberos. This is only useful in an Active " +"Directory environment. The setting affects the smbmount and smbclient " +"command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:352 +#, fuzzy +msgid "Use machine account for login" +msgstr "Använd default login" + +#: smb4k/core/smb4ksettings.cpp:353 +msgid "" +"Make queries to the remote server using the machine account of the local " +"server. The setting affects the net and the smbclient command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:367 +msgid "The file system that is used for mounting remote shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:368 +msgid "" +"This is the file system that will be used to mount the remote shares. The " +"Common Internet File System (CIFS) is supported by Windows 2000 and above as " +"well as by Samba. It offers many improvements and advancements compared to " +"the Server Message Block File System (SMBFS) which is used by Windows 9x and " +"below." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:487 +msgid "The charset used by the client" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:488 +msgid "" +"This is the charset that is used by the client side (i.e. your side) either " +"to convert local path names to and from Unicode in case of the CIFS file " +"system or for codepage to charset translations (NLS) in case of the SMBFS " +"file system. If you keep the default setting, Smb4K will try to " +"automatically determine the charset by looking up the \"unix charset\" " +"option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:657 +msgid "The codepage used by the server" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:658 +msgid "" +"This is the codepage that is used by the server. The setting is only " +"available with the SMBFS file system. If you keep the default setting, Smb4K " +"will try to automatically determine the codepage by looking up the \"dos " +"charset\" option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:661 +msgid "The user ID that is to be used for mounting" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:662 +msgid "" +"Here you can enter the user ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:665 +msgid "The group ID that is to be used for mounting" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:666 +msgid "" +"Here you can enter the group ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:669 +msgid "The file mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:670 +msgid "" +"This is the mask that will be used for creating files. It must be defined in " +"octal. In case the CIFS file system is used, this setting only takes effect " +"if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:673 +msgid "The directory mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:674 +msgid "" +"This is the mask that will be used for creating directories. It must be " +"defined in octal. In case the CIFS file system is used, this setting only " +"takes effect if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:688 +msgid "The write access granted for the share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:689 +msgid "" +"Here you can choose if the shares should be mounted in read and write mode " +"or only read-only." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:693 +msgid "" +"The client side (i.e. your side) will check if you have the right UID/GID to " +"manipulate a file or directory. You might want to switch this feature off if " +"the server(s) support the CIFS Unix Extensions and you are not allowed to " +"access the files and directories. This setting does not affect the normal " +"ACL check." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:696 +msgid "Set UID and GID" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:697 +msgid "" +"In case the server supports the CIFS Unix Extensions, the client side (i.e. " +"your side) attempts to set the effective UID and GID of the current process " +"on newly created files, directories and devices. If this feature is turned " +"off, the default UID and GID defined for the share will be used. It is " +"recommended that you read the manual page of mount.cifs before you change " +"this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:701 +msgid "" +"Use inode numbers (unique persistent file identifiers) returned by the " +"server instead of automatically generating temporary inode numbers on the " +"client side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:705 +msgid "" +"Directly read from and write to files opened on the share. In some cases " +"this can provide better performance than the default behavior which caches " +"reads and writes." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:709 +msgid "" +"Translate six of the seven reserved characters (including the colon, " +"question mark, pipe, asterisk, greater than and less than characters but not " +"the backslash) to remap range (above 0xF000). This allows you to open files " +"that were created with such characters. This has no effect if the server " +"does not support Unicode." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:713 +msgid "Do not use locking. Do not start lockd." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:716 +msgid "Advanced custom options for the CIFS file system" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:717 +msgid "" +"Here you can enter advanced options for the CIFS file system in a comma-" +"separated list (refer to the manual page of mount.cifs to learn more). The " +"list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not " +"enter options that have already been defined in the configuration dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:720 +msgid "Determines how long directory listings are cached" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:721 +msgid "" +"This setting determines how long a directory listing is cached in " +"milliseconds. A high value means it takes longer until changes on the server " +"are noticed on the client side (i.e. your side), but it can also give you an " +"increase in performance on large directories, especially on long distances. " +"You need Linux kernel 2.4.2 or later to take advantage of this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:724 +msgid "Unicode support" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:725 +msgid "" +"Use Unicode when communicating with the server. This will give you better " +"support for non-ASCII character sets with the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:728 +#, fuzzy +msgid "Long file support" +msgstr "Använd stor filsystemssupport" + +#: smb4k/core/smb4ksettings.cpp:729 +msgid "" +"Large file system support (LFS) enables you to read and write files bigger " +"than 2 GB on shares that were mounted with the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:753 +msgid "The protocol that is used with the net command" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:754 +msgid "" +"Here you can choose the protocol that will be used by the net command for " +"the communication with remote servers if appropriate. In most cases the " +"automatic detection will work fine and you should not need to change the " +"default setting. However, if you experience problems, use the RPC protocol " +"for newer operating systems (Windows NT4 and above) and the RAP protocol for " +"older ones (Windows 98/NT3 and below). Functions that need the ADS protocol " +"(for Active Directory environments) have not been implemented yet, so you " +"can ignore that one for now." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:757 +msgid "Name resolve order used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:758 +msgid "" +"This option is used to determine what naming services and in what order are " +"used to resolve host names and IP addresses. It takes a space-separated list " +"of up to four different name resolution options. Those are: lmhost, host, " +"wins, bcast. See the manual page of smbclient for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:762 +msgid "Transmit/send buffer size used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:763 +msgid "" +"This option changes the transmit/send buffer size when getting or putting a " +"file from/to the server. The default is 65520 bytes. Setting this value " +"smaller has been observed to speed up file transfers to and from Windows 9x " +"servers." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:787 +msgid "Signing state" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:788 +msgid "Set the signing state for smbclient." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:791 +msgid "The broadcast address used by nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:792 +msgid "" +"Queries performed with nmblookup will be send to the given broadcast " +"address. Without this option the default behavior is to send the queries to " +"the broadcast address of the network interface that was either auto-detected " +"or defined in the \"interfaces\" parameter of the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:795 +msgid "Use UDP port 137 with nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:796 +msgid "" +"Try and bind to UDP port 137 to send and receive UDP datagrams. The reason " +"for this option is a bug in Windows 95 where it ignores the source port of " +"the requesting packet and only replies to UDP port 137. Unfortunately, on " +"most Unix systems super user privileges are needed to bind to this port. " +"Please read the manual page of nmblookup for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:802 +#, fuzzy +msgid "Prefix for synchronization" +msgstr "Standardlogin" + +#: smb4k/core/smb4ksettings.cpp:803 +msgid "" +"This is the path where Smb4K will store the files and directories during " +"synchronization. If you plan to synchronize only with one remote share, then " +"you can put the data directly in this directory. If you want to synchronize " +"with several remote shares, then you should create a subdirectory for each " +"share and choose the appropriate one in the synchronization dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:806 +msgid "Use archive mode" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:807 +msgid "Use archive mode (-a, --archive). This is a short form of -rlptgoD." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:810 +msgid "Recurse into subdirectories" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:811 +msgid "Recurse into directories (-r, --recursive)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:814 +msgid "Skip files that are newer in the target directory" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:815 +msgid "" +"Update files in the destination directory that are older than in the source " +"directory (-u, --update)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:819 +msgid "" +"Update destination files in-place (--inplace). By default, rsync first " +"creates a new copy of a file and moves it into place after its transfer " +"finished. If you enable this feature, no copy will be created but the " +"destination file will immediately be overwritten instead. An exception to " +"this is if you combine this option with --backup." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:823 +msgid "" +"Use relative paths (-R, --relative). This means that the full path names " +"specified on the command line are sent to the server rather than just the " +"last parts of the file names." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:826 +msgid "Don't send implied directories with --relative" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:827 +msgid "" +"Don't send implied directories with --relative (--no-implied-dirs). This " +"means that the corresponding path elements on the destination system are " +"left unchanged if they exist, and any missing implied directories are " +"created with default attributes. This even allows these implied path " +"elements to have big differences, such as being a symlink to a directory on " +"one side of the transfer, and a real directory on the other side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:831 +msgid "" +"Transfer directories without recursing (-d, --dirs). This means that all top-" +"level subdirectories are transferred but without their contents." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:835 +msgid "" +"Compress data during transfer (-z, --compress). This significantly reduces " +"the amount of data that is being transferred. You may want to use this " +"option, if you have a slow connection." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:839 +msgid "Copy symlinks as symlinks (-l, --links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:843 +msgid "" +"Transform symlinks into the items they are pointing to (-L, --copy-links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:847 +msgid "" +"Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-" +"links). This means that only those symlinks are transformed that point to " +"items that are outside the copied tree. Absolute symlinks are treated the " +"same way. This option has no additional effect if --copy-links has also been " +"specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:851 +msgid "" +"Ignore symlinks that point outside the copied tree (--safe-links). All " +"absolute symlinks are also ignored. If you use this option in conjunction " +"with --relative you might get unexpected results." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:855 +msgid "" +"Preserve hard links (-H, --hard-links). This options causes rsync to " +"preserve the hard links that are found during the transfer. Without it, hard " +"links are treated as though they were separate files." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:859 +msgid "" +"Treat symlinked directories on the receiving side as though they were real " +"ones (-K, --keep-dirlinks). This only works if the symlink matches a real " +"directory from the sending side. Without this option, the receiver's symlink " +"will be deleted and replaced with a real directory." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:863 +msgid "" +"Preserve permissions (-p, --perms). The permissions of the destination file " +"will be same as the source file. For what happens if this option is switched " +"off, please read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:867 +msgid "" +"Preserve the group (-g, --group). The group of the destination file will be " +"set to the same value as the source file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:870 +msgid "Preserve owner (super user only)" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:871 +msgid "" +"Preserve the owner (-o, --owner). The owner of the destination file will be " +"set to the same value as the source file, but only if the receiving rsync is " +"run as the super user. Without this option, the owner is set to the invoking " +"user on the receiving side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:875 +msgid "" +"Preserve device and special files (-D, --devices --specials). This option " +"causes rsync to transfer character and block devices as well as special " +"files such as named sockets and fifos. It works only partially if rsync is " +"not run as super user and the --super option is not specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:879 +msgid "" +"Preserve times (-t, --times). The modification times are transferred along " +"with the files. For what happens if this option is switched off, please read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:883 +msgid "" +"Omit directories when preserving times (-O, --omit-dir-times). This means " +"that directories are omitted when modification times are being preserved. " +"Thus, this feature only works in conjunction with --times." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:887 +msgid "" +"Remove all synchronized source files (--remove-source-files). This tells " +"rsync to remove from the sending side the non-directory items that are a " +"part of the transfer and have been successfully duplicated on the receiving " +"side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:891 +msgid "" +"Delete extraneous files from destination (--delete). This tells rsync to " +"delete all files from the receiving side that are not present on the sending " +"side, but only for the directories that are being synchronized." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:895 +msgid "" +"Delete files on the receiving side before the transfer starts (--delete-" +"before). This is the default behavior if --delete or --delete-excluded is " +"specified without one of the --delete-WHEN options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:899 +msgid "" +"Delete files on the receiving side after the transfer has completed (--" +"delete-after, --del)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:903 +msgid "" +"Delete files on the receiving side during the transfer (--delete-during). " +"This method is faster than --delete-before or --delete-after, but it is only " +"supported with rsync 2.6.4 or later." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:906 +msgid "Also delete excluded files from destination directory" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:907 +msgid "" +"Also delete excluded files from destination directory (--delete-excluded). " +"In addition to deleting the files on the receiving side that are not on the " +"sending side, this tells rsync to also delete any files on the receiving " +"side that are excluded. Refer to rsync's manual page for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:911 +msgid "" +"Delete even if I/O errors occur (--ignore-errors). This option has to be " +"specified in conjunction with --delete to take effect." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:915 +msgid "" +"Force deletion of directories even if they are not empty (--force). This " +"option tells rsync to delete a non-empty directory when it is to be replaced " +"by a non-directory. This is only relevant if deletions are not active." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:918 +msgid "Only delete a maximum number of files" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:919 +msgid "" +"Only delete as many files as defined here (--max-delete=NUM). This tells " +"rsync not to delete more than NUM files or directories (NUM must be non-" +"zero). This is useful when mirroring very large trees to prevent disasters." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:923 +msgid "Value for DeleteMaximum config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:926 smb4k/core/smb4ksettings.cpp:934 +msgid "Don't transfer any file smaller than SIZE" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:927 +msgid "" +"This option causes rsync to not transfer any file that is smaller than the " +"specified size (--min-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:931 +msgid "Value for MinimalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:935 +msgid "" +"This option causes rsync to not transfer any file that is larger than the " +"specified size (--max-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:939 +msgid "Value for MamximalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:943 +msgid "" +"Keep partially transferred files (--partial). The default behavor is that " +"any partially transferred file is deleted if the transfer is interrupted." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:946 +msgid "The directory where to put a partially transferred file into." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:947 +msgid "" +"Put a partially transferred file into this directory (--partial-dir=DIR). " +"This is a better way than the --partial option to keep partial files, " +"because the partially transferred file is kept in a different directory and " +"the destination file is not overwritten." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:950 +msgid "The data for the UsePartialDirectory option" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:954 +msgid "" +"Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a " +"useful shorthand for excluding a broad range of files that you often do not " +"want to transfer between systems. This option uses the same algorithm that " +"CVS uses to determine if a file should be ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:957 +msgid "Exclude files that match a certain pattern" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:958 +msgid "" +"Exclude files that match a certain pattern (--exclude=PATTERN). This is a " +"special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:961 +msgid "Pattern that is used for file exclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:964 +msgid "Read exclude patterns from a file" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:965 +msgid "" +"Read exclude patterns from a file (--exclude-from=FILE). This option is " +"similar to the --exclude=PATTERN option except that the exclude patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:968 +msgid "The file from which the exclude patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:971 +msgid "Do not exclude files matching a certain pattern" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:972 +msgid "" +"Do not exclude files matching a certain pattern (--include=PATTERN). This is " +"a special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:975 +msgid "Pattern that is used for file inclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:978 +msgid "Read include patterns from a file" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:979 +msgid "" +"Read include patterns from a file (--include-from=FILE). This option is " +"similar to the --include=PATTERN option except that the include patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:982 +msgid "The file from which the include patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:985 +msgid "Add custom file-filtering rules" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:986 +msgid "" +"Add custom file-filtering rules (-f, --filter=RULE). This option allows you " +"to add rules to selectively exclude certain files from the list of files to " +"be transferred." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:989 +msgid "Use -F filter rule" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:990 +msgid "" +"This filter rule tells rsync to look for per-directory .rsync-filter files " +"that have been sprinkled through the hierarchy and use their rules to filter " +"the files in the transfer. It has no effect, if you also choose to use the --" +"filter='exclude .rsync-filter' rule." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:993 +msgid "Use -FF filter rule" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:994 +msgid "" +"This rule filters out the .rsync-filter files from the transfer. These files " +"normally contain filter rules that can be activated by choosing the --" +"filter='dir-merge /.rsync-filter' rule and deselecting this one." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:998 +msgid "" +"Handle sparse files efficiently (-S, --sparse) so that they take up less " +"space on the destination. This option conflicts with --inplace. For further " +"information read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1002 +msgid "" +"Copy files whole (-W, --whole-file). With this option the incremental rsync " +"algorithm is not used and the whole file is sent as-is instead." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1005 +msgid "Do not cross file system boundaries" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1006 +msgid "" +"Do not cross file system boundaries (-x, --one-file-system). This tells " +"rsync to avoid crossing a filesystem boundary when recursing. For further " +"information on this option, read the manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1009 +msgid "Skip creating new files on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1010 +msgid "" +"Skip creating new files on the receiving side (--existing). This tells rsync " +"to skip creating files (including directories) that do not exist yet on the " +"destination. If this option is combined with the --ignore-existing option, " +"no files will be updated (which can be useful if all you want to do is to " +"delete extraneous files)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1013 +msgid "Skip updating files that exist on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1014 +msgid "" +"Skip updating files that already exist on the receiving side (--ignore-" +"existing). Existing directories are not ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1017 +msgid "Delay updates until the end of the transfer" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1018 +msgid "" +"Delay updates until the end of the transfer (--delay-updates). This option " +"puts the temporary file from each updated file into a holding directory " +"until the end of the transfer, at which time all the files are renamed and " +"copied into place in rapid succession." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1022 +msgid "" +"Make backups (-b, --backup). With this option, preexisting destination files " +"are renamed as each file is transferred or deleted. You can control where " +"the backup file goes and what (if any) suffix gets appended using the --" +"backup-dir=DIR and --suffix=SUFFIX options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1025 +msgid "Use a suffix for backups" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1026 +msgid "Use this suffix for backups (--suffix=SUFFIX)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1029 +msgid "Backup suffix" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1032 +msgid "Put backups into a certain directory" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1033 +msgid "Store backups in this directory (--backup-dir=DIR)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1036 +#, fuzzy +msgid "Backup directory" +msgstr "Active Directory" + +#: smb4k/core/smb4ksettings.cpp:1039 +msgid "Force a fixed checksum block-size" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1040 +msgid "" +"Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the " +"block size used in the rsync algorithm to a fixed value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1044 +msgid "The block size" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1047 +msgid "Set block/file checksum seed" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1048 +msgid "" +"Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum " +"seed to this integer. This 4 byte checksum seed is included in each block " +"and file MD4 checksum calculation. By default the checksum seed is generated " +"by the server and defaults to the current time." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1052 +#, fuzzy +msgid "The checksum seed" +msgstr "Ej ingripande." + +#: smb4k/core/smb4ksettings.cpp:1055 +msgid "Skip files based on a checksum" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1056 +msgid "" +"Skip files based on a checksum and not based on modification time and size (-" +"c, --checksum). For further information on how this feature works read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1073 +#, fuzzy +msgid "The program that should be used to gain super user privileges" +msgstr "Använd följande Program, att få \"super användare\" privileges:" + +#: smb4k/core/smb4ksettings.cpp:1074 +msgid "" +"Choose the program that will grant you limited super user privileges for " +"mounting and unmounting remote shares. You can either select sudo, the " +"standard tool for this purpose on most distributions, or super." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1077 +#, fuzzy +msgid "Use super user privileges to unmount inaccessible shares" +msgstr "" +"Använd superanvändareprivilegier för att montera och avmontera kataloger" + +#: smb4k/core/smb4ksettings.cpp:1078 +msgid "" +"Unmount a share under Linux by force. This even works if the file system is " +"\"busy\", because it is immediately detached from the file system hierarchy " +"and all references to it are cleaned up later when it is not busy anymore. " +"Linux kernel 2.4.11 or later is needed to take advantage of this feature. " +"Use with case! Note, that you will need the root password to write the " +"necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1082 +msgid "" +"Use super user privileges for mounting and unmounting remote shares. This " +"feature is only needed, if you are not allowed to use smbmount, smbumount, " +"mount.cifs and umount.cifs as normal user. Note, that you will need the root " +"password to write the necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057 +#, fuzzy +msgid "Buffer size exceeded" +msgstr "Buffertstorlek:" + +#: smb4k/core/smb4knetworkitems.cpp:202 +msgid "Disk" +msgstr "" + +#: smb4k/core/smb4kpasswordhandler.cpp:258 +msgid "The access was denied. " +msgstr "Ej ingripande." + +#: smb4k/core/smb4kpasswordhandler.cpp:261 +#, fuzzy +msgid "The password is not correct. " +msgstr "Fel lösenord." + +#: smb4k/core/smb4kpasswordhandler.cpp:264 +msgid "The permission was denied. " +msgstr "Ej ingripande." + +#: smb4k/core/smb4kpasswordhandler.cpp:267 +msgid "An authentication error occurred. " +msgstr "Ett authentiserings fel uppstod." + +#: smb4k/core/smb4kpasswordhandler.cpp:270 +msgid "The logon failed. " +msgstr "Login mislykades." + +#: smb4k/core/smb4kpasswordhandler.cpp:278 +#, fuzzy +msgid "Please enter authentication data for server %1." +msgstr "Använd autentisiering för %1." + +#: smb4k/core/smb4kpasswordhandler.cpp:282 +#, fuzzy +msgid "Please enter authentication data for share %1." +msgstr "Använd autentisiering för %1." + +#: smb4k/core/smb4khomesshareshandler.cpp:73 +msgid "Specify User" +msgstr "Definiera användaren" + +#: smb4k/core/smb4khomesshareshandler.cpp:74 +#, fuzzy +msgid "Clear List" +msgstr "&Rensa" + +#: smb4k/core/smb4khomesshareshandler.cpp:87 +msgid "Please specify a user name." +msgstr "Ange användarnamn" + +#: smb4k/core/smb4kerror.cpp:42 +msgid "" +"The browse list could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:46 +#, fuzzy +msgid "" +"The browse list could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:55 +msgid "" +"The list of servers could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:59 +#, fuzzy +msgid "" +"The list of servers could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:68 +msgid "" +"The list of shares could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:72 +#, fuzzy +msgid "" +"The list of shares could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:81 +msgid "" +"The preview could not be compiled.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:85 +#, fuzzy +msgid "" +"The preview could not be compiled.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:92 +#, fuzzy +msgid "" +"The wallet \"%1\" could not be opened. KWallet support will be disabled for " +"this session." +msgstr "Att öppna Kwallet fungera inte." + +#: smb4k/core/smb4kerror.cpp:100 +msgid "" +"Some file permissions could not be determined.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:104 +#, fuzzy +msgid "" +"Some file permissions could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:111 +#, fuzzy +msgid "" +"You are not allowed to unmount this share, because it is owned by another " +"user." +msgstr "Du har inte tillåtelse att avmontera denna katalog." + +#: smb4k/core/smb4kerror.cpp:119 +msgid "" +"The share \"%1\" could not be mounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:123 +#, fuzzy +msgid "" +"The share \"%1\" could not be mounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:132 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:136 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:143 +#, fuzzy +msgid "The file \"%1\" could not be found." +msgstr "Filen %1 kan inte hittas." + +#: smb4k/core/smb4kerror.cpp:151 +#, fuzzy +msgid "The file \"%1\" could not be read." +msgstr "Filen %1 kann inte läst." + +#: smb4k/core/smb4kerror.cpp:155 +#, fuzzy +msgid "" +"The file \"%1\" could not be read.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:164 +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:168 +#, fuzzy +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:175 +#, fuzzy +msgid "" +"Either your PATH environment variable is not set properly or there are the " +"following programs missing on your system:\n" +"%1\n" +"Please correct this and restart Smb4K." +msgstr "" +"PATH variabeln är inte riktig stätt, eller dem följande programm är inte på " +"datorn:\n" +"%1\n" +"Omstart Smb4k efter rättning." + +#: smb4k/core/smb4kerror.cpp:181 +#, fuzzy +msgid "" +"The file \"%1\" is currently being edited by user %2. To avoid any problems, " +"access to this file is denied at the moment. Please try again later." +msgstr "" +"En annan användare (%2) öppnade just systemfilerna %1. Försök igen senare." + +#: smb4k/core/smb4kerror.cpp:187 +#, fuzzy +msgid "The directory \"%1\" could not be created." +msgstr "Katalogen %1 kann inte hittas." + +#: smb4k/core/smb4kerror.cpp:193 +#, fuzzy +msgid "The file \"%1\" could not be written." +msgstr "Filen %1 kann inte läst." + +#: smb4k/core/smb4kerror.cpp:199 +#, fuzzy +msgid "" +"The share could not be unmounted, because the mount point string was empty." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:205 +msgid "This feature has not been enabled." +msgstr "Den här funktion är inte aktiverat." + +#: smb4k/core/smb4kerror.cpp:211 +msgid "Printers cannot be bookmarked." +msgstr "Skrivare kann inte vara bokmärken." + +#: smb4k/core/smb4kerror.cpp:217 +#, fuzzy +msgid "" +"IP addresses are not supported with this search method. Please choose \"Use " +"nmblookup\" in the configuration dialog and try again." +msgstr "" +"Sökmetoden (smbclient) som du valde kan inte hantera IP-adresserna korrekt. " +"Välj \"Använd nmblookup\" under konfiguration dialog och försök igen." + +#: smb4k/core/smb4kerror.cpp:225 +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:229 +#, fuzzy +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:236 +#, fuzzy +msgid "The command \"%1\" could not be found." +msgstr "Kommandon %1 finnas inte." + +#: smb4k/core/smb4kerror.cpp:244 +msgid "" +"The file \"%1\" could not be printed.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:248 +#, fuzzy +msgid "" +"The file \"%1\" could not be printed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:257 +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:261 +#, fuzzy +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:270 +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:274 +#, fuzzy +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:281 +#, fuzzy +msgid "The directory \"%1\" could not be found." +msgstr "Katalogen %1 kan inte hittas." + +#: smb4k/core/smb4kerror.cpp:287 +msgid "" +"The file \"%1\" is irregular. That means it is either a symlink, a fifo, or " +"something similar. This could indicate that someone is trying to exploit " +"your system. Please inform your system administrator." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:295 +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:299 +#, fuzzy +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:308 +#, fuzzy +msgid "The file \"%1\" could not be opened." +msgstr "Filen %1 kan inte hittas." + +#: smb4k/core/smb4kerror.cpp:312 +#, fuzzy +msgid "" +"The file \"%1\" could not be opened.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:321 +#, fuzzy +msgid "The file \"%1\" could not be closed." +msgstr "Filen %1 kan inte hittas." + +#: smb4k/core/smb4kerror.cpp:325 +#, fuzzy +msgid "" +"The file \"%1\" could not be closed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:332 +msgid "" +"The list of arguments for the \"net\" command could not be assembled.\n" +"At the moment it reads: %1" +msgstr "" + +#: smb4k/core/smb4kerror.cpp:340 +#, fuzzy +msgid "The list of supplementary group IDs could not be determined." +msgstr "Hårtdisk usage kann inte hittas." + +#: smb4k/core/smb4kerror.cpp:344 +#, fuzzy +msgid "" +"The list of supplementary group IDs could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:354 +msgid "" +"An unknown error occurred.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:358 +#, fuzzy +msgid "" +"An unknown error occurred.\n" +"Read the error message under \"Details\" to find out more." +msgstr "Detta katalogen kann inte avmonteras. Katalogtext är tom." + +#: smb4k/core/smb4kerror.cpp:385 +#, fuzzy +msgid "" +"The mimetype \"%1\" is not supported. Please convert the file to PostScript " +"or PDF." +msgstr "" +"Mimetypen \"%1\" är inte understöd. Convertera filen till PostScript eller " +"PDF." + +#: smb4k/core/smb4kerror.cpp:391 +#, fuzzy +msgid "" +"You previously chose to use \"%1\", but now it is missing on your system. " +"Smb4K will disable this feature." +msgstr "" +"Programmed %1 finnas inte mer på datorn. Smb4k ska inaktivera den här " +"funktion!" + +#: smb4k/core/smb4kerror.cpp:397 +msgid "" +"The label \"%1\" is used more than once. It will automatically be renamed " +"for bookmark \"%2\" to avoid confusion." +msgstr "" + +#: smb4k/core/smb4kcore.cpp:248 +#, fuzzy +msgid "" +"Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will " +"hang if you try to access it.\n" +"Do you want to continue?" +msgstr "" +"Minst till version 3.3.2 från KDE och KIO. Det är inte mögligt att hantera " +"CIFS-Kataloger. Konqueror misslyckades, om du använder det.\n" +" Vill du fortsätter?" + +#: smb4k/core/smb4kmounter.cpp:815 smb4k/core/smb4kmounter.cpp:862 +msgid "Do you really want to force the unmounting of this share?" +msgstr "Vill du verkligen forcera avmonteringen av denna katalog?" + +#. i18n: file ./smb4k/listview/smb4kshareslistview_part.rc line 4 +#. i18n: file ./smb4k/iconview/smb4ksharesiconview_part.rc line 4 +#: rc.cpp:3 rc.cpp:33 +#, fuzzy, no-c-format +msgid "&Shares" +msgstr "Kataloger" + +#. i18n: file ./smb4k/browser/smb4knetworkbrowser_part.rc line 4 +#. i18n: file ./smb4k/smb4k_shell.rc line 7 +#: rc.cpp:6 rc.cpp:12 +#, no-c-format +msgid "&Network" +msgstr "&Nätverk" + +#. i18n: file ./smb4k/smb4k_shell.rc line 9 +#: rc.cpp:15 +#, no-c-format +msgid "Sh&ares" +msgstr "&Utdelning" + +#. i18n: file ./smb4k/smb4k_shell.rc line 27 +#: rc.cpp:24 +#, fuzzy, no-c-format +msgid "Network ToolBar" +msgstr "Nätverkssökning" + +#. i18n: file ./smb4k/smb4k_shell.rc line 29 +#: rc.cpp:27 +#, fuzzy, no-c-format +msgid "Shares View ToolBar" +msgstr "Visa katalog" + +#. i18n: file ./smb4k/smb4k_shell.rc line 31 +#: rc.cpp:30 +#, no-c-format +msgid "Main ToolBar" +msgstr "" + +#, fuzzy +#~ msgid "The default user name for authentication" +#~ msgstr "Denna masterbrowser behöver autentisering" + +#, fuzzy +#~ msgid "The default password for authentication" +#~ msgstr "Denna masterbrowser behöver autentisering" + +#~ msgid "Network neighborhood" +#~ msgstr "Nätverksgrannskap" + +#~ msgid "Save login information in a wallet" +#~ msgstr "Spara logininformation i än wallet." + +#, fuzzy +#~ msgid "Querying %1..." +#~ msgstr "Sök nätverk..." + +#, fuzzy +#~ msgid "Retrieving browse list from current master browser..." +#~ msgstr "Förhandsgranskning mottages..." + +#, fuzzy +#~ msgid "Retrieving browse list from %1..." +#~ msgstr "Förhandsgranskning mottages..." + +#, fuzzy +#~ msgid "Scanning broadcast areas to compose browse list..." +#~ msgstr "Fråga en masterbrowser för att få browselistan" + +#, fuzzy +#~ msgid "Querying %1 to compose browse list..." +#~ msgstr "Fråga en masterbrowser för att få browselistan" + +#, fuzzy +#~ msgid "Scanning network to retrieve browse list..." +#~ msgstr "Granska nätverket för att få browselistan" + +#~ msgid "None" +#~ msgstr "Ingen" + +#~ msgid "Show shares as list instead of as icons" +#~ msgstr "Visa fjärrkataloger som lista istället som ikoner" + +#~ msgid "" +#~ "Smb4K is an SMB/CIFS share browser for KDE.\n" +#~ "It uses Samba to access the local network neighborhood." +#~ msgstr "" +#~ "Smb4K är an SMB/CIFS katalogsökare för KDE.
Smb4k använder Samba för " +#~ "att söker nätverket." + +#, fuzzy +#~ msgid "" +#~ "NOTE: You might need to enable support for either super or " +#~ "sudo in the Super User page." +#~ msgstr "" +#~ "OBS: Om du använder CIFS filsystemed, du behöver super eller " +#~ "sudo i filen \"super.tab\"." + +#, fuzzy +#~ msgid "Scan netwo&rk" +#~ msgstr "Nätverk" + +#, fuzzy +#~ msgid "&Custom options" +#~ msgstr "Samba-alternativ" + +#, fuzzy +#~ msgid "&Print file" +#~ msgstr "&Skriv ut fil" + +#, fuzzy +#~ msgid "Broadcast addresses for IP scan:" +#~ msgstr "Broadcastadress:" + +#, fuzzy +#~ msgid "" +#~ "Smb4K uses nmblookup by default to do network searches. This " +#~ "method is very reliable but fails sometimes if your network neighborhood " +#~ "is configured uncommonly. In this case you should try to use " +#~ "smbclient." +#~ msgstr "" +#~ "Sm4k använder nmblookup vid grundinställingar för att göra " +#~ "nätverkssökningar. Denna metod är mycket tillförlitlig, men misslyckas " +#~ "ibland om ditt nätverksgrannskap är otillräckligt konfiguerat. Försök i " +#~ "så fall att använda smbclient." + +#~ msgid "" +#~ "Use super user privileges to force the unmounting of (broken) shares\n" +#~ "(Requires Linux kernel 2.4.11 or later)" +#~ msgstr "" +#~ "Använd root privilegium för att avmontera blockerad kataloger\n" +#~ "(Det behöves Linux kernel 2.4.11 eller senare)" + +#~ msgid "Samba Options" +#~ msgstr "Samba-alternativ" + +#~ msgid "Super User Privileges" +#~ msgstr "Privilegier för superanvändare" + +#, fuzzy +#~ msgid "Rsync Options" +#~ msgstr "Allmänt ionställningar" + +#~ msgid "" +#~ "You forgot to enter the host you want to query to retrieve the browse " +#~ "list.\n" +#~ "Do you want to enter it now?" +#~ msgstr "" +#~ "Du glömde ange vilken dator som du vill importera listan från.\n" +#~ "Vill du ange den nu?" + +#, fuzzy +#~ msgid "" +#~ "You forgot to enter the broadcast address(es) for the IP scan.\n" +#~ "Do you want to enter them now?" +#~ msgstr "" +#~ "Du glömde ange grundinställning för lösenord. \n" +#~ "Vill du ange den nu?" + +#, fuzzy +#~ msgid "" +#~ "You forgot to enter the mount prefix.\n" +#~ "Do you want to enter it now?" +#~ msgstr "" +#~ "Du glömde att ange grundinställning för login. \n" +#~ "Vill du ange den nu?" + +#, fuzzy +#~ msgid "Preserve owner (root only)" +#~ msgstr "Rättigheter" + +#~ msgid "Domain (workgroup):" +#~ msgstr "Domän (arbetsgrupp):" + +#~ msgid "Scope (Read manual page):" +#~ msgstr "Scope (Läs användarmanualen först):" + +#~ msgid "Active Directory" +#~ msgstr "Active Directory" + +#, fuzzy +#~ msgid "Linux charset:" +#~ msgstr "Linux charset:" + +#, fuzzy +#~ msgid "Use unicode when communicating with the server" +#~ msgstr "Använd unicode vid kommunikation med servern" + +#, fuzzy +#~ msgid "Use large filesystem support" +#~ msgstr "Använd stor filsystemssupport" + +#~ msgid "Use default network read size" +#~ msgstr "Använd default nätverk läsningsstorlek" + +#~ msgid "Use default network write size" +#~ msgstr "Använd default nätverk writesorlek" + +#~ msgid "Auto" +#~ msgstr "Automatiskt" + +#, fuzzy +#~ msgid "Active Directory (LDAP/Kerberos)" +#~ msgstr "Active Directory (LDAP/Kerberos)" + +#~ msgid "DCE-RPC" +#~ msgstr "DCE-RPC" + +#, fuzzy +#~ msgid "RAP (older systems)" +#~ msgstr "RAP (äldere systemed)" + +#, fuzzy +#~ msgid "Resolve order:" +#~ msgstr "Mottag uppdrag:" + +#, fuzzy +#~ msgid "" +#~ "The lock file '%1' is a symbolic link.\n" +#~ "It looks like someone is trying to exploit your system. Please inform " +#~ "your system administrator. Smb4K will not perform any action on a system " +#~ "file as long as this problem is not solved." +#~ msgstr "Filen (%1) är en link. Kanske någon inbryta i systemed." + +#, fuzzy +#~ msgid "The user IDs present on the system" +#~ msgstr "Visa alla fjärrkataloger som är monterade i systemet" + +#~ msgid "This login will be used, if none has been defined for a share." +#~ msgstr "Denna login används, om ingen annan är definerad för en katalog." + +#~ msgid "" +#~ "You forgot to enter the default login and password.\n" +#~ "Do you want to enter them now?" +#~ msgstr "" +#~ "Du glömde ange grundinställning för login och lösenord.\n" +#~ "Vill du ange den nu?" + +#~ msgid "" +#~ "You forgot to enter the default login.\n" +#~ "Do you want to enter it now?" +#~ msgstr "" +#~ "Du glömde att ange grundinställning för login. \n" +#~ "Vill du ange den nu?" + +#~ msgid "" +#~ "You forgot to enter the default password.\n" +#~ "Do you want to enter it now?" +#~ msgstr "" +#~ "Du glömde ange grundinställning för lösenord. \n" +#~ "Vill du ange den nu?" + +#~ msgid "Printer:" +#~ msgstr "Skriva:" + +#~ msgid "Copies" +#~ msgstr "Kopia" + +#, fuzzy +#~ msgid "The program '%1' could not be found." +#~ msgstr "Katalogen %1 kan inte hittas." + +#, fuzzy +#~ msgid "The kernel (%1) does not support this operation." +#~ msgstr "Kärnan (%1) kann inte den här operation." + +#~ msgid "Smb4K - The SMB/CIFS Share Browser" +#~ msgstr "Smb4K - SMB/CIFS katalog browser" + +#, fuzzy +#~ msgid "Jump to Search Dialog (Alternative)" +#~ msgstr "Söker..." + +#~ msgid "WINS server" +#~ msgstr "WINS-server:" + +#~ msgid "Browse list retrieval" +#~ msgstr "Bläddra i listan" + +#~ msgid "Version" +#~ msgstr "Version" + +#, fuzzy +#~ msgid "Master" +#~ msgstr "Master:" + +#~ msgid "Aborting..." +#~ msgstr "Avslutar..." + +#~ msgid "Opening host..." +#~ msgstr "Datorn öppnas..." + +#~ msgid "Searching for host..." +#~ msgstr "Sök datorn..." + +#~ msgid "Unmounting all shares..." +#~ msgstr "Avmonterar alla kataloger..." + +#~ msgid "Mounted &Shares" +#~ msgstr "Utdelat &Kataloger" + +#~ msgid "&Search" +#~ msgstr "&Sök" + +#, fuzzy +#~ msgid "Size:" +#~ msgstr "Fil:" + +#, fuzzy +#~ msgid "Range Scan" +#~ msgstr "Avsök igen" + +#, fuzzy +#~ msgid "" +#~ "You forgot to enter the IP address ranges you want to scan to retrieve " +#~ "the browse list.\n" +#~ "Do you want to enter them now?" +#~ msgstr "" +#~ "Du glömde ange vilken dator som du vill importera listan från.\n" +#~ "Vill du ange den nu?" + +#~ msgid "Set the UID to:" +#~ msgstr "Ställ in UID på:" + +#~ msgid "Set the GID to:" +#~ msgstr "Ställ in GID på:" + +#~ msgid "Sending file to printer..." +#~ msgstr "Skickar filen till skrivaren..." + +#~ msgid "Converting file to Postscript..." +#~ msgstr "Konvertera filen till Postscript..." + +#~ msgid "The net command '%1' is not supported by Smb4K." +#~ msgstr "\"net\" kommandon \"%1\" fungera inte tillsammans med Smb4k." + +#~ msgid "An error occurred while trying to get the browse list." +#~ msgstr "Ett fel uppstott,när vi få browse listan!" + +#~ msgid "An error occurred while trying to get the list of workgroup members." +#~ msgstr "Ett fel uppsod, när vi har fick browse listan." + +#~ msgid "An error occurred while trying to get the preview." +#~ msgstr "Ett fel uppstod, när vi fick förhandsgranskning." + +#~ msgid "An error occurred while trying to mount the share." +#~ msgstr "Ett fel uppstod, vid montering an kataloger." + +#~ msgid "An error occurred while trying to unmount the share." +#~ msgstr "Ett fel uppstod, vid montering an katalog." + +#~ msgid "An error occurred while trying to unmount all shares." +#~ msgstr "Ett fel uppstod, vid avmontering alla kataloger." + +#~ msgid "An error occurred." +#~ msgstr "Ett fel uppstod." + +#~ msgid "The hostname could not be determined." +#~ msgstr "Datornamn kann inte hittas." + +#~ msgid "The file %1 could not be written successfully." +#~ msgstr "Filen %1 kann jag inte skriva." + +#~ msgid "The wallet \"%1\" could not be opened." +#~ msgstr "Wallet %1 kan inte öppnas." + +#~ msgid "An error occurred while trying to print." +#~ msgstr "Ett fel uppstod, vid skrivning." + +#~ msgid "An error occurred while trying to create a temporary directory." +#~ msgstr "Ett fel uppstod, när vi tillverka en katalog." + +#~ msgid "An error occurred while trying to create a temporary file." +#~ msgstr "Ett fel uppstod, när vi tillverka ett fil." + +#~ msgid "An error occurred while determining file permissions." +#~ msgstr "Ett fel uppstod ..." + +#, fuzzy +#~ msgid "An error occurred during synchronization." +#~ msgstr "Ett fel uppstod, vid skrivning." + +#, fuzzy +#~ msgid "Workgroup/Domain" +#~ msgstr "Arbetsgrupp:" + +#~ msgid "" +#~ "You forgot to enter the path where Smb4K will mount the shares to.\n" +#~ "Do you want to enter it now?" +#~ msgstr "" +#~ "Du glömde ange förteckningen där Smb4K ska montera katalogerna.\n" +#~ "Vill du ange den nu?" + +#~ msgid "Mount shares:" +#~ msgstr "Montera kataloger:" + +#, fuzzy +#~ msgid "" +#~ "(c) 2003, Alexander Reinholdt \n" +#~ "(c) 2004, Alexander Reinholdt, Franck Babin \n" +#~ "(c) 2005, Alexander Reinholdt & the Smb4K team" +#~ msgstr "" +#~ "(c) 2003, Alexander Reinholdt\n" +#~ "(c) 2004, Alexander Reinholdt, Franck Babin\n" +#~ "(c) 2005, The Smb4K team" + +#~ msgid "Documentation" +#~ msgstr "Dokumentation" + +#~ msgid "This computer is already in the list." +#~ msgstr "Datorn är redan i listan." + +#~ msgid "This share cannot be added." +#~ msgstr "Ressursan kann inte tillagd." + +#~ msgid "file to open" +#~ msgstr "fil att öppna" + +#~ msgid "Tab Widget" +#~ msgstr "Flikkomponent" + +#~ msgid "Share" +#~ msgstr "Utdelad katalog" + +#~ msgid "Show network tab" +#~ msgstr "Visa nätverktab" + +#~ msgid "Show Share tab" +#~ msgstr "Visa katalogtab" + +#~ msgid "Show Search tab" +#~ msgstr "Visa sökningstab" + +#~ msgid "Looking for IP addresses..." +#~ msgstr "Leta efter IP-adresser..." + +#~ msgid "Unmount" +#~ msgstr "Avmontera" + +#~ msgid "This share has already been mounted." +#~ msgstr "Resursen är redan monterad." + +#~ msgid "" +#~ "As of version 0.5.0, the entries in the super.tab file are stored in a " +#~ "different format. Smb4K is now going to convert the old ones." +#~ msgstr "" +#~ "Från version 0.5.0 spara Smb4K filen \"super.tab\" i olika format. Smb4K " +#~ "konvertera nu detta." + +#~ msgid "" +#~ "Smb4K is going to modify the entries in the super.tab file in order to " +#~ "work properly." +#~ msgstr "Smb4k ändra nu filen \" supber.tab\", för att fungera bättre." + +#~ msgid "Input" +#~ msgstr "Input" + +#~ msgid "" +#~ "The mimetype (%1) indicates that this is a text file. Printing it, " +#~ "however, might fail. Do you want to continue?" +#~ msgstr "" +#~ "Minmetypen (%1) kann evtuellt inte fungera. Vill du skriva det ut, nu?" + +#~ msgid "&Rescan" +#~ msgstr "Avs&ök igen" + +#~ msgid "NetBIOS name/IP address:" +#~ msgstr "NetBIOS namn/IP-adress:" + +#~ msgid "Use authentication when querying the workgroup master browsers" +#~ msgstr "Använd autentisering för att söka workgroup master browsers" + +#~ msgid "WINS server used by the system:" +#~ msgstr "WINS dator använd av systemet:" + +#~ msgid "Network" +#~ msgstr "Nätverk" + +#~ msgid "OS:" +#~ msgstr "Operativsystem:" + +#~ msgid "S&earch" +#~ msgstr "&Sök" + +#~ msgid "A&dd" +#~ msgstr "&Lägg till" + +#~ msgid "" +#~ "This is the directory under which the shares will be mounted. Adjust it " +#~ "according to your wishes." +#~ msgstr "" +#~ "Detta är standardkatalogen för att montera Kataloger. Ändra den enligt " +#~ "dina önskningar." + +#~ msgid "Share" +#~ msgstr "Utdelad katalog" + +#~ msgid "Contents:" +#~ msgstr "Innehåll" + +#~ msgid "%1 Item " +#~ msgstr "%1 objekt ..." + +#~ msgid "%1 Items " +#~ msgstr "%1 Objekt ..." + +#~ msgid "(%1 Directory, " +#~ msgstr "(%1 Katalog, " + +#~ msgid "(%1 Directories, " +#~ msgstr "(%1 Kataloger, " + +#~ msgid "%1 File)" +#~ msgstr "%1 fil)" + +#~ msgid "%1 Files)" +#~ msgstr "%1 filer)" + +#~ msgid "super (recommended)" +#~ msgstr "super (rekommenderat)" + +#~ msgid "sudo" +#~ msgstr "sudo" diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 0000000..4db3734 --- /dev/null +++ b/po/uk.po @@ -0,0 +1,3722 @@ +# Translation of uk.po to Ukrainian +# Ivan Petrouchtchak , 2004, 2005, 2006, 2007. +msgid "" +msgstr "" +"Project-Id-Version: uk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-20 08:48+0200\n" +"PO-Revision-Date: 2007-08-27 23:18-0700\n" +"Last-Translator: Ivan Petrouchtchak \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: smb4k/smb4k.cpp:84 +msgid "&Dock Widgets" +msgstr "" + +#: smb4k/smb4k.cpp:108 smb4k/smb4k.cpp:112 smb4k/smb4k.cpp:287 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:170 +msgid "Network Browser" +msgstr "Навігатор мережі" + +#: smb4k/smb4k.cpp:118 smb4k/smb4k.cpp:122 smb4k/smb4k.cpp:316 +#: plugin/smb4k_konqplugin.cpp:149 +msgid "Search Dialog" +msgstr "Вікно пошуку" + +#: smb4k/smb4k.cpp:156 +#, fuzzy +msgid "Shares Vie&w" +msgstr "Перегляд спільних ресурсів" + +#: smb4k/smb4k.cpp:159 +#, fuzzy +msgid "&Icon View" +msgstr "У вигляді &піктограм" + +#: smb4k/smb4k.cpp:163 +#, fuzzy +msgid "List Vie&w" +msgstr "Перегляд спільних ресурсів" + +#: smb4k/smb4k.cpp:203 smb4k/smb4k.cpp:771 +msgid "Ready." +msgstr "Готовий." + +#: smb4k/smb4k.cpp:264 +#, fuzzy +msgid "Jump to shares view" +msgstr "Перегляд спільних ресурсів" + +#: smb4k/smb4k.cpp:293 +#, fuzzy +msgid "Jump to network browser" +msgstr "Навігатор мережі" + +#: smb4k/smb4k.cpp:332 +#, fuzzy +msgid "Jump to search dialog" +msgstr "Вікно пошуку" + +#: smb4k/smb4k.cpp:463 +#, fuzzy +msgid "" +"Closing the main window will keep Smb4K running in the system tray. Use " +"\"Quit\" from the \"File\" menu to quit the application." +msgstr "" +"Після закриття головного вікна програма Smb4K продовжує працювати у " +"системному лотку. Використовуйте \"Вихід\" з меню \"Файл\", щоб вийти з " +"програми." + +#: smb4k/smb4k.cpp:465 +msgid "Docking in System Tray" +msgstr "Швартується в системному лотку" + +#: smb4k/smb4k.cpp:496 +#, fuzzy +msgid "Exiting..." +msgstr "Друк файла..." + +#: smb4k/smb4k.cpp:649 +msgid "Looking up workgroups and domains..." +msgstr "" + +#: smb4k/smb4k.cpp:655 +#, fuzzy +msgid "Querying current master browser..." +msgstr "Запит поточному головному навігатору робочої групи" + +#: smb4k/smb4k.cpp:661 +#, fuzzy +msgid "Querying master browser %1..." +msgstr "Запит цьому головному навігатору:" + +#: smb4k/smb4k.cpp:667 +#, fuzzy +msgid "Scanning broadcast areas..." +msgstr "Трансляційна адреса:" + +#: smb4k/smb4k.cpp:681 +msgid "Opening workgroup..." +msgstr "Відкривається робоча група..." + +#: smb4k/smb4k.cpp:687 +#, fuzzy +msgid "Retrieving list of shares..." +msgstr "Повторна спроба відкриття вузла..." + +#: smb4k/smb4k.cpp:693 +#, fuzzy +msgid "Retrieving additional information..." +msgstr "Отримання інформації..." + +#: smb4k/smb4k.cpp:699 +msgid "Searching..." +msgstr "Пошук..." + +#: smb4k/smb4k.cpp:705 +#, fuzzy +msgid "Retrying to retrieve list of shares..." +msgstr "Повторна спроба відкриття вузла..." + +#: smb4k/smb4k.cpp:711 smb4k/smb4k.cpp:729 smb4k/smb4k.cpp:741 +#: smb4k/smb4k.cpp:753 smb4k/smb4k.cpp:765 +msgid "Done." +msgstr "Завершено." + +#: smb4k/smb4k.cpp:717 +msgid "Mounting share..." +msgstr "Монтування спільного ресурсу..." + +#: smb4k/smb4k.cpp:723 +msgid "Unmounting share..." +msgstr "Демонтування спільного ресурсу..." + +#: smb4k/smb4k.cpp:735 +msgid "Printing file..." +msgstr "Друк файла..." + +#: smb4k/smb4k.cpp:747 +msgid "Synchronizing data..." +msgstr "Синхронізація даних..." + +#: smb4k/smb4k.cpp:759 +msgid "Generating preview..." +msgstr "Підготовка перегляду..." + +#: smb4k/smb4k.cpp:819 smb4k/smb4ksystemtray.cpp:236 +msgid "&Edit Bookmarks" +msgstr "&Редагувати закладки" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:55 +msgid "Default Destination" +msgstr "Типове місце призначення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:59 +msgid "Rsync prefix:" +msgstr "Префікс Rsync:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:63 +#: smb4k/configdlg/smb4krsyncoptions.cpp:166 +#: smb4k/configdlg/smb4krsyncoptions.cpp:209 +msgid "General" +msgstr "Загальне" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:67 +msgid "Archive mode" +msgstr "Режим архівування" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:68 +msgid "Recurse into directories" +msgstr "Рекурсивно заходити в каталоги" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:69 +msgid "Skip files that are newer in target directory" +msgstr "Пропускати файли, які новіші в каталозі цілі" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:70 smb4k/core/smb4ksettings.cpp:819 +msgid "Update destination files in place" +msgstr "Оновити файли, які знаходяться в місці призначення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:71 smb4k/core/smb4ksettings.cpp:823 +#, fuzzy +msgid "Use relative path names" +msgstr "Вживати відносні назви шляхів (-R)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:72 +#, fuzzy +msgid "Don't send implied directories" +msgstr "Сховані файли і каталоги" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:73 smb4k/core/smb4ksettings.cpp:831 +msgid "Transfer directories without recursing" +msgstr "Перенести каталоги не-рекурсивно" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:74 smb4k/core/smb4ksettings.cpp:835 +msgid "Compress data during transfer" +msgstr "Стискати дані під час перенесення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:76 +msgid "Links" +msgstr "Посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:79 smb4k/core/smb4ksettings.cpp:839 +msgid "Preserve symlinks" +msgstr "Зберігати символьні посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:80 smb4k/core/smb4ksettings.cpp:843 +msgid "Transform symlinks" +msgstr "Перетворювати символічні посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:81 smb4k/core/smb4ksettings.cpp:847 +#, fuzzy +msgid "Only transform unsafe symlinks" +msgstr "Перетворювати тільки небезпечні посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:82 smb4k/core/smb4ksettings.cpp:851 +#, fuzzy +msgid "Ignore unsafe symlinks" +msgstr "Зберігати символьні посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:83 smb4k/core/smb4ksettings.cpp:855 +msgid "Preserve hard links" +msgstr "Зберігати тверді посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:84 smb4k/core/smb4ksettings.cpp:859 +msgid "Keep directory symlinks" +msgstr "Зберігати символічні посилання каталогу" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:86 +msgid "File Permissions, etc." +msgstr "Права доступу до файлів, та ін." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:90 smb4k/core/smb4ksettings.cpp:863 +msgid "Preserve permissions" +msgstr "Зберігати дозволи" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:91 smb4k/core/smb4ksettings.cpp:867 +msgid "Preserve group" +msgstr "Зберігати групу" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:92 +#, fuzzy +msgid "Preserve owner" +msgstr "Зберігати групу" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:93 smb4k/core/smb4ksettings.cpp:875 +#, fuzzy +msgid "Preserve device and special files" +msgstr "Зберігати символьні посилання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:94 smb4k/core/smb4ksettings.cpp:879 +msgid "Preserve times" +msgstr "Зберігати час" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:95 smb4k/core/smb4ksettings.cpp:883 +msgid "Omit directories when preserving times" +msgstr "Пропускати каталоги, коли зберігається час" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:105 +msgid "Copying" +msgstr "Копіювання" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:115 +msgid "File Deletion" +msgstr "Видалення файлів" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:118 smb4k/core/smb4ksettings.cpp:887 +msgid "Remove synchronized source files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:119 smb4k/core/smb4ksettings.cpp:891 +msgid "Delete extraneous files" +msgstr "" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:120 smb4k/core/smb4ksettings.cpp:895 +#, fuzzy +msgid "Delete files before transfer" +msgstr "Перед перенесенням видалити файли в місці призначення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:121 smb4k/core/smb4ksettings.cpp:899 +#, fuzzy +msgid "Delete files after transfer" +msgstr "Після перенесення видалити файли в місці призначення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:122 smb4k/core/smb4ksettings.cpp:903 +#, fuzzy +msgid "Delete files during transfer" +msgstr "Під час перенесення видалити файли в місці призначення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:123 +#, fuzzy +msgid "Also delete excluded files" +msgstr "Також видалити в місці призначення не включені файли" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:124 smb4k/core/smb4ksettings.cpp:911 +msgid "Delete even if I/O errors occur" +msgstr "Видалити, навіть, якщо станеться помилка В/В" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:125 smb4k/core/smb4ksettings.cpp:915 +msgid "Force deletion of non-void directories" +msgstr "Примусити видалення не-порожніх каталогів" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:127 +msgid "Restrictions" +msgstr "Обмеження" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:130 +msgid "Don't delete more than this many files:" +msgstr "Не видаляти більше файлів, ніж:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:133 +msgid "File Transfer" +msgstr "Перенесення файла" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:137 +#, fuzzy +msgid "Don't transfer any file smaller than:" +msgstr "Не переносити файли менші, ніж" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:140 +#, fuzzy +msgid "Don't transfer any file larger than:" +msgstr "Не переносити файли більші, ніж" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:143 smb4k/core/smb4ksettings.cpp:943 +msgid "Keep partially transferred files" +msgstr "Зберігати файли, які частково перенесено" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:145 +#, fuzzy +msgid "Put a partially transferred file into:" +msgstr "Покласти частково перенесений файл у" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:156 +msgid "File Deletion && Transfer" +msgstr "Видалення і перенесення файлів" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:170 smb4k/core/smb4ksettings.cpp:954 +msgid "Auto-ignore files in the same way CVS does" +msgstr "Авто-ігнорувати файли так, як це робить CVS" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:172 +msgid "Exclude files matching this pattern:" +msgstr "Виключати файли, які відповідають цьому взірцю:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:174 +#, fuzzy +msgid "Read exclude patterns from:" +msgstr "Прочитати взірці виключення з" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:177 +msgid "Don't exclude files matching this pattern:" +msgstr "Не виключати файли, які відповідають цьому взірцю:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:179 +#, fuzzy +msgid "Read include patterns from:" +msgstr "Прочитати взірці включення з" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:183 +msgid "Filter Rules" +msgstr "Правила фільтра" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:186 +#, fuzzy +msgid "" +"The rules defined below will be added to the \"rsync\" command as they are. " +"Thus, you have to start with the --filter=... argument." +msgstr "" +"Визначені вище правила будуть додаватися до команди rsync у такому " +"вигляді як вони є. Тому, потрібно починати з аргументу \"--filter=\". Також, " +"спочатку радимо прочитати сторінку довідки для rsync." + +#: smb4k/configdlg/smb4krsyncoptions.cpp:189 +#, fuzzy +msgid "Special filter rules:" +msgstr "Правила фільтра" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:190 +#, fuzzy +msgid "Use --filter='dir-merge /.rsync-filter' filter rule" +msgstr "Вживати правило фільтрування \"--filter='- .rsync-filter'\"" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:191 +#, fuzzy +msgid "Use --filter='exclude .rsync-filter' filter rule" +msgstr "Вживати правило фільтрування \"--filter='- .rsync-filter'\"" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:199 +msgid "Filtering" +msgstr "Фільтрування" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:213 smb4k/core/smb4ksettings.cpp:998 +msgid "Handle sparse files efficiently" +msgstr "Ефективно опрацьовувати розріджені файли" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:214 smb4k/core/smb4ksettings.cpp:1002 +msgid "Copy files whole (no rsync algorithm)" +msgstr "Копіювати файли цілими (без алгоритму rsync)" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:215 +msgid "Don't cross file system boundaries" +msgstr "Не пересікати межі файлових систем" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:216 +msgid "Only update files that already exist" +msgstr "Тільки оновляти файли, які вже існують" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:217 +msgid "Ignore files that already exist" +msgstr "Ігнорувати файли, які вже існують" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:218 +#, fuzzy +msgid "Delay updates until the end of transfer" +msgstr "Після перенесення видалити файли в місці призначення" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:220 +msgid "Backup" +msgstr "Резервування" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:223 smb4k/core/smb4ksettings.cpp:1022 +msgid "Make backups" +msgstr "Робити резервні копії" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:225 +msgid "Backup suffix:" +msgstr "Суфікс резервних копій:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:227 +msgid "Backup directory:" +msgstr "Каталог резервних копій:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:231 +msgid "Checksums" +msgstr "Суми перевірки" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:234 +msgid "Force fixed checksum block size:" +msgstr "Примушувати фіксований розмір блоків контрольної суми:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:236 +msgid "Set block/file checksum seed:" +msgstr "Вказати розсадження блоків/файлів контрольної суми:" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:238 +msgid "Skip files based on checksum" +msgstr "Попускати файли на основі контрольної суми" + +#: smb4k/configdlg/smb4krsyncoptions.cpp:248 +msgid "Advanced" +msgstr "Додатково" + +#: smb4k/configdlg/smb4kshareoptions.cpp:53 +msgid "Directories" +msgstr "Каталоги" + +#: smb4k/configdlg/smb4kshareoptions.cpp:59 +msgid "Mount prefix:" +msgstr "Префікс монтування:" + +#: smb4k/configdlg/smb4kshareoptions.cpp:66 +msgid "Force generated subdirectories to be lower case" +msgstr "Примушувати, щоб назви новостворених підтек були в нижньому регістрі" + +#: smb4k/configdlg/smb4kshareoptions.cpp:69 +msgid "Mounting and Unmounting" +msgstr "Монтування і демонтування" + +#: smb4k/configdlg/smb4kshareoptions.cpp:70 +msgid "Unmount all shares of user %1 on exit" +msgstr "Під час виходу демонтувати всі спільні ресурси користувача %1" + +#: smb4k/configdlg/smb4kshareoptions.cpp:72 +msgid "Remount recently used shares on program start" +msgstr "Під час запуску програми монтувати недавно вживані спільні ресурси" + +#: smb4k/configdlg/smb4kshareoptions.cpp:74 +msgid "Allow the unmounting of shares that are owned by other users" +msgstr "" +"Дозволяти демонтування спільних ресурсів, які належать іншим користувачам" + +#: smb4k/configdlg/smb4kshareoptions.cpp:77 +msgid "Checks" +msgstr "Перевірки" + +#: smb4k/configdlg/smb4kshareoptions.cpp:79 +msgid "Interval between checks:" +msgstr "Інтервал між перевірками:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:50 +msgid "Browse List" +msgstr "Список навігації" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:53 +#, fuzzy +msgid "Scan the network neighborhood for available workgroups and domains" +msgstr "Виявити в мережі доступні робочі групи і домени" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:55 +msgid "Query the current workgroup master browser" +msgstr "Запит поточному головному навігатору робочої групи" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:62 +msgid "Query this master browser:" +msgstr "Запит цьому головному навігатору:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:65 +#, fuzzy +msgid "Scan broadcast areas:" +msgstr "Трансляційна адреса:" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:80 +msgid "Network Search" +msgstr "Мережний пошук" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:85 +#, fuzzy +msgid "" +"Smb4K uses \"nmblookup\" by default to search for remote hosts. This method " +"is very reliable but fails sometimes if your network neighborhood is " +"configured uncommonly. In this case you should try to use \"smbclient\"." +msgstr "" +"Для мережних пошуків Smb4K типово використовує nmblookup. Це дуже " +"надійний метод, але часом може зазнати невдачі, якщо ваше мережне оточення " +"незвично налаштоване. В цьому випадку спробуйте smbclient." + +#: smb4k/configdlg/smb4knetworkoptions.cpp:88 +msgid "Use nmblookup (recommended)" +msgstr "Вживати nmblookup (рекомендовано)" + +#: smb4k/configdlg/smb4knetworkoptions.cpp:91 +msgid "Use smbclient" +msgstr "Вживати smbclient" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:162 +msgid "User Interface" +msgstr "Інтерфейс користувача" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:163 +#: smb4k/browser/smb4knetworkbrowser.cpp:50 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:186 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:319 +msgid "Network" +msgstr "Мережа" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:164 +#: smb4k/listview/smb4kshareslistview_part.cpp:144 +#: smb4k/listview/smb4kshareslistview_part.cpp:346 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:141 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:232 +msgid "Shares" +msgstr "Спільні ресурси" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:165 +#: smb4k/configdlg/smb4ksambaoptions.cpp:89 +#: smb4k/core/smb4kpasswordhandler.cpp:237 +msgid "Authentication" +msgstr "Автентифікація" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:166 +msgid "Samba" +msgstr "Samba" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:167 +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:47 +msgid "Synchronization" +msgstr "Синхронізація" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:168 +msgid "Super User" +msgstr "Суперкористувач" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:327 +#: smb4k/configdlg/smb4kconfigdialog.cpp:328 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1039 +#: smb4k/configdlg/smb4ksambaoptions.cpp:400 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:180 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:253 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:874 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:970 +msgid "auto" +msgstr "авто" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:331 +#: smb4k/configdlg/smb4kconfigdialog.cpp:352 +#: smb4k/configdlg/smb4kconfigdialog.cpp:441 +#: smb4k/configdlg/smb4kconfigdialog.cpp:451 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1098 +#: smb4k/configdlg/smb4ksambaoptions.cpp:428 +msgid "yes" +msgstr "так" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:332 +#: smb4k/configdlg/smb4kconfigdialog.cpp:353 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1099 +#: smb4k/configdlg/smb4ksambaoptions.cpp:427 +msgid "no" +msgstr "ні" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:360 +#: smb4k/configdlg/smb4kconfigdialog.cpp:458 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1060 +#: smb4k/configdlg/smb4ksambaoptions.cpp:215 +#: smb4k/configdlg/smb4ksambaoptions.cpp:418 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:289 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:422 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:704 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:913 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-write" +msgstr "читання-запис" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:361 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1061 +#: smb4k/configdlg/smb4ksambaoptions.cpp:216 +#: smb4k/configdlg/smb4ksambaoptions.cpp:419 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:290 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:423 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:988 +msgid "read-only" +msgstr "тільки читання" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:460 +#: smb4k/configdlg/smb4kconfigdialog.cpp:465 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1072 +#: smb4k/configdlg/smb4kconfigdialog.cpp:1082 +#: smb4k/configdlg/smb4ksambaoptions.cpp:141 +#: smb4k/configdlg/smb4ksambaoptions.cpp:167 +msgid "default" +msgstr "типові" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:707 +msgid "[Network] The custom master browser has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:722 +msgid "[Network] The broadcast areas have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:733 +#, fuzzy +msgid "[Shares] The mount prefix is empty.\n" +msgstr "Префікс монтування:" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:748 +msgid "[Authentication] The default user name has not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:759 +msgid "[Samba] The file mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:770 +msgid "[Samba] The directory mask is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:781 +msgid "[Samba] The UID is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:792 +msgid "[Samba] The GID is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:803 +msgid "[Synchronization] The rsync prefix is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:816 +#, fuzzy +msgid "" +"[Synchronization] The directory where partially transferred files should be " +"stored is empty.\n" +msgstr "Покласти частково перенесений файл у" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:829 +msgid "[Synchronization] The exclude patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:842 +msgid "[Synchronization] The path of the exclude file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:855 +msgid "[Synchronization] The include patterns have not been entered.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:868 +msgid "[Synchronization] The path of the include file is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:887 +msgid "[Synchronization] The backup suffix has not been defined.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:900 +msgid "[Synchronization] The backup directory is empty.\n" +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:908 +msgid "" +"The configuration could not be written, because one setting is incomplete:\n" +"%1Please correct this issue." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:912 +msgid "" +"The configuration could not be written, because %1 settings are incomplete:\n" +"%1Please correct these issues." +msgstr "" + +#: smb4k/configdlg/smb4kconfigdialog.cpp:1191 +msgid "Smb4KConfigDialog" +msgstr "Smb4KConfigDialog" + +#: smb4k/configdlg/smb4kauthoptions.cpp:52 +msgid "Password Storage" +msgstr "Збереження пароля" + +#: smb4k/configdlg/smb4kauthoptions.cpp:53 +#, fuzzy +msgid "Save the authentication data in a wallet" +msgstr "Будь ласка, введіть автентифікаційні дані для спільного ресурсу %1." + +#: smb4k/configdlg/smb4kauthoptions.cpp:55 +#, fuzzy +msgid "If no wallet is used, remember authentication data during run time" +msgstr "" +"Якщо не вживається торбинка, запам'ятовувати паролі під час виконання " +"програми" + +#: smb4k/configdlg/smb4kauthoptions.cpp:58 +msgid "Default Login" +msgstr "Типова реєстрація" + +#: smb4k/configdlg/smb4kauthoptions.cpp:62 +msgid "Use default login" +msgstr "Вживати типову реєстрацію" + +#: smb4k/configdlg/smb4kauthoptions.cpp:69 +#: smb4k/core/smb4kpasswordhandler.cpp:291 +#: smb4k/core/smb4khomesshareshandler.cpp:89 +msgid "User:" +msgstr "Користувач:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:72 +msgid "This login name is used by default to authenticate to a remote server." +msgstr "" + +#: smb4k/configdlg/smb4kauthoptions.cpp:73 +#: smb4k/core/smb4kpasswordhandler.cpp:311 +msgid "Password:" +msgstr "Пароль:" + +#: smb4k/configdlg/smb4kauthoptions.cpp:77 +msgid "" +"This password is used by default to authenticate to a remote server. It may " +"be empty." +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:70 +msgid "General Options" +msgstr "Загальні параметри" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:73 +msgid "NetBIOS name:" +msgstr "Назва NetBIOS:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:76 +msgid "Domain:" +msgstr "Домен:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:79 +msgid "Socket options:" +msgstr "Параметри сокетів:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:82 +#, fuzzy +msgid "NetBIOS scope:" +msgstr "Назва NetBIOS:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:85 +msgid "Remote SMB port:" +msgstr "Віддалений порт SMB:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:91 +msgid "Try to authenticate with Kerberos" +msgstr "Спробувати автентифікуват з Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:92 +msgid "Authenticate as machine account" +msgstr "Автентифікувати як вузловий рахунок" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:100 +msgid "General Settings" +msgstr "Загальні параметри" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:110 +#: smb4k/configdlg/smb4ksambaoptions.cpp:384 +#: smb4k/listview/smb4kshareslistview.cpp:56 +msgid "File System" +msgstr "Файлова система" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:120 +#, fuzzy +msgid "" +"NOTE: You might need to enable support for either \"super\" or \"sudo\" in " +"the Super User page." +msgstr "" +"ПРИМІТКА: Можливо, буде необхідно ввімкнути підтримку або для super, " +"або sudo у вкладці суперкористувача." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:124 +msgid "User and Group" +msgstr "Користувач і група" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:127 +#: smb4k/configdlg/smb4ksambaoptions.cpp:430 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:292 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:317 +msgid "User ID:" +msgstr "ІД користувача:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:131 +#: smb4k/configdlg/smb4ksambaoptions.cpp:435 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:296 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:321 +msgid "Group ID:" +msgstr "ІД групи:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:136 +msgid "Charset and Codepage" +msgstr "Набір символів та кодова сторінка" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:139 +msgid "Client charset:" +msgstr "Набір символів клієнта:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:165 +msgid "Server codepage:" +msgstr "Кодова сторінка сервера:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:202 +msgid "Permissions" +msgstr "Права доступу" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:205 +msgid "File mask:" +msgstr "Маска файлів:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:209 +msgid "Directory mask:" +msgstr "Маска каталогів:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:213 +#: smb4k/configdlg/smb4ksambaoptions.cpp:414 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:286 +msgid "Write access:" +msgstr "Доступ запису:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:220 +msgid "Advanced CIFS Options" +msgstr "Додаткові параметри CIFS" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:227 smb4k/core/smb4ksettings.cpp:692 +#, fuzzy +msgid "Do permission checks" +msgstr "Права доступу" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:229 +msgid "Attempt to set UID and GID" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:231 smb4k/core/smb4ksettings.cpp:700 +msgid "Use server inode numbers" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:233 smb4k/core/smb4ksettings.cpp:704 +msgid "Do not cache inode data" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:235 smb4k/core/smb4ksettings.cpp:708 +msgid "Translate reserved characters" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:237 smb4k/core/smb4ksettings.cpp:712 +msgid "Do not use locking" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:244 +msgid "Additional options:" +msgstr "Додаткові параметри:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:248 +msgid "Advanced SMBFS Options" +msgstr "Додаткові параметри SMBFS" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:251 +msgid "Use Unicode when communicating with the server" +msgstr "Для зв'язку з сервером вживати unicode" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:252 +#, fuzzy +msgid "Use large file support" +msgstr "Вживати підтримку великих файлових систем" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:258 +msgid "Caching time of directory listings:" +msgstr "Час зберігання списку каталогів в кешу:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:289 +msgid "Protocol Hint" +msgstr "Підказка протоколу" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:291 +msgid "Automatic detection" +msgstr "Автоматичне виявлення" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:293 +#, fuzzy +msgid "RPC: Modern operating systems" +msgstr "Операційна система:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:295 +#, fuzzy +msgid "RAP: Older operating systems" +msgstr "Операційна система:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:297 +msgid "ADS: Active Directory environment (LDAP/Kerberos)" +msgstr "ADS: Active Directory environment (LDAP/Kerberos)" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:318 +#, fuzzy +msgid "Name resolve order:" +msgstr "Порядок перегляду:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:321 +msgid "Buffer size:" +msgstr "Розмір буфера:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:323 +msgid " Bytes" +msgstr " байтів" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:325 +msgid "Signing state:" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:327 +msgid "none" +msgstr "немає" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:328 +msgid "on" +msgstr "ввімк." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:329 +msgid "off" +msgstr "вимк." + +#: smb4k/configdlg/smb4ksambaoptions.cpp:330 +msgid "required" +msgstr "" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:354 +msgid "Broadcast address:" +msgstr "Трансляційна адреса:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:357 +msgid "Try and bind to UDP port 137 to send and receive UDP datagrams" +msgstr "" +"Спробувати прив'язати порт UDP 137 для відсилання і прийняття датаграм UDP" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:381 +#: smb4k/listview/smb4kshareslistview.cpp:51 +msgid "Item" +msgstr "Елемент" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:382 +msgid "Protocol" +msgstr "Протокол" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:385 +msgid "Write Access" +msgstr "Доступ запису" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:387 +msgid "Kerberos" +msgstr "Kerberos" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:388 +msgid "UID" +msgstr "UID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:389 +msgid "GID" +msgstr "GID" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:390 +msgid "Port" +msgstr "Порт" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:396 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:177 +msgid "Protocol:" +msgstr "Протокол:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:407 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:136 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:279 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:136 +msgid "File system:" +msgstr "Файлова система:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:423 +msgid "Kerberos:" +msgstr "Kerberos:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:440 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:164 +msgid "Port:" +msgstr "Порт:" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:451 +msgid "Remove All" +msgstr "Вилучити всі" + +#: smb4k/configdlg/smb4ksambaoptions.cpp:493 +msgid "Custom" +msgstr "Нетипове" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:52 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:171 +msgid "Shares View" +msgstr "Перегляд спільних ресурсів" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:55 +#, fuzzy +msgid "Show mounted shares in an icon view" +msgstr "Показувати спільні ресурси у вигляді списку, а не піктограм" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:57 +#, fuzzy +msgid "Show mounted shares in a list view" +msgstr "Показувати спільні ресурси у вигляді списку, а не піктограм" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:62 +#: smb4k/core/smb4ksettings.cpp:117 +msgid "Show custom bookmark label if available" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:64 +msgid "System Tray" +msgstr "Системний лоток" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:67 +msgid "Embed application into the system tray" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:83 +msgid "Remote Shares" +msgstr "Віддалені спільні ресурси" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:85 +#: smb4k/core/smb4ksettings.cpp:144 +msgid "Show printer shares" +msgstr "Показувати спільні принтери" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:86 +#: smb4k/core/smb4ksettings.cpp:148 +msgid "Show hidden shares" +msgstr "Показувати сховані спільні ресурси" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:87 +msgid "Show IPC$ shares" +msgstr "Показувати спільні ресурси IPC$" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:88 +msgid "Show ADMIN$ shares" +msgstr "Показувати спільні ресурси ADMIN$" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:90 +msgid "Columns" +msgstr "Стовпчики" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:92 +msgid "Show type" +msgstr "Показувати тип" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:93 +msgid "Show IP address" +msgstr "Показати адресу IP" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:94 +msgid "Show comment" +msgstr "Показати коментар" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:96 +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:124 +msgid "Tooltips" +msgstr "Підказки" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:98 +msgid "Show tooltip with information about a network item" +msgstr "Показувати підказку з інформацією про мережний елемент" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:114 +#: smb4k/smb4ksystemtray.cpp:67 +msgid "Mounted Shares" +msgstr "Змонтовані спільні ресурси" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:116 +msgid "Show mount point instead of share name" +msgstr "Замість назви спільного ресурсу показувати точку підключення" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:117 +#: smb4k/core/smb4ksettings.cpp:180 +msgid "Show all shares that are mounted on the system" +msgstr "Показати всі спільні ресурси, які змонтовано у системі" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:119 +msgid "Drag and Drop" +msgstr "Перетягти і вкинути" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:121 +#, fuzzy +msgid "Allow dropping of files and directories onto shares" +msgstr "Дозволити вкидання файлів і тек в спільні ресурси" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:122 +msgid "Allow dragging of shares" +msgstr "Дозволити перетягання спільних ресурсів" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:126 +msgid "Show tooltip with information about a share" +msgstr "Показувати підказку з інформацією про спільний ресурс" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:128 +#, fuzzy +msgid "List View" +msgstr "Перегляд спільних ресурсів" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:132 +#: smb4k/core/smb4ksettings.cpp:200 +msgid "Show owner and group (SMBFS only)" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:133 +#: smb4k/core/smb4ksettings.cpp:204 +msgid "Show login (CIFS only)" +msgstr "" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:135 +#, fuzzy +msgid "Show owner and group" +msgstr "Користувач і група" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:137 +#: smb4k/core/smb4ksettings.cpp:208 +msgid "Show file system" +msgstr "Показувати файлову систему" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:138 +#: smb4k/core/smb4ksettings.cpp:212 +msgid "Show free disk space" +msgstr "Показувати вільне місце на диску" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:139 +#: smb4k/core/smb4ksettings.cpp:216 +msgid "Show used disk space" +msgstr "Показувати вжите місце на диску" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:140 +#: smb4k/core/smb4ksettings.cpp:220 +msgid "Show total disk space" +msgstr "Показувати всього місця на диску" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:141 +#: smb4k/core/smb4ksettings.cpp:224 +msgid "Show disk usage" +msgstr "Показувати вжиток диска" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:158 +msgid "Hidden Files and Directories" +msgstr "Сховані файли і каталоги" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:159 +msgid "Preview hidden files and directories" +msgstr "Перегляд схованих файлів і каталогів" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:169 +#, fuzzy +msgid "Main Window && System Tray" +msgstr "Швартується в системному лотку" + +#: smb4k/configdlg/smb4kuserinterfaceoptions.cpp:172 +msgid "Preview Dialog" +msgstr "Вікно перегляду" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:52 +msgid "Programs" +msgstr "Програми" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:55 +msgid "Use the following program to gain super user privileges:" +msgstr "" +"Для отримання привілеїв суперкористувача використовувати наступну програму:" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:59 +msgid "Actions" +msgstr "Дії" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:62 +#, fuzzy +msgid "" +"Use super user privileges to force the unmounting of (inaccessible) shares" +msgstr "" +"Застосовувати привілеї суперкористувача для монтування та демонтування " +"спільних ресурсів" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:64 +#: smb4k/core/smb4ksettings.cpp:1082 +msgid "Use super user privileges to mount and unmount shares" +msgstr "" +"Застосовувати привілеї суперкористувача для монтування та демонтування " +"спільних ресурсів" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:67 +msgid "Remove Entries" +msgstr "Вилучити елементи" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:68 +msgid "Remove entries from the configuration file" +msgstr "" + +#: smb4k/configdlg/smb4ksuperuseroptions.cpp:69 +msgid "" +"Depending on your choice under \"Programs\", all entries that were written " +"by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. " +"Additionally, all your choices under \"Actions\" will be cleared." +msgstr "" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:109 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:154 +#: smb4k/dialogs/smb4kprintdialog.cpp:92 smb4k/dialogs/smb4kmountdialog.cpp:79 +msgid "Workgroup:" +msgstr "Робоча група:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +msgid "Pseudo master browser:" +msgstr "Псевдо-головний навігатор:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:112 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:158 +msgid "Master browser:" +msgstr "Головний навігатор:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:116 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:136 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:140 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:144 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:160 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:213 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:292 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:301 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:310 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:331 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:335 +#: smb4k/dialogs/smb4kprintdialog.cpp:88 +msgid "Unknown" +msgstr "Невідомо" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:129 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:207 +#: smb4k/dialogs/smb4kprintdialog.cpp:83 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +msgid "Host:" +msgstr "Вузол:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:132 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:185 +msgid "Comment:" +msgstr "Коментар:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:135 +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:211 +#: smb4k/dialogs/smb4kprintdialog.cpp:86 +msgid "IP address:" +msgstr "Адреса IP:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:139 +msgid "Operating system:" +msgstr "Операційна система:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:143 +msgid "Server string:" +msgstr "Рядок сервера:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:182 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:120 +#: smb4k/dialogs/smb4kmountdialog.cpp:70 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:160 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:120 +msgid "Share:" +msgstr "Спільний ресурс:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:188 +msgid "Type:" +msgstr "Тип:" + +#: smb4k/browser/smb4knetworkbrowsertooltip.cpp:196 +msgid "Mounted:" +msgstr "Змонтовано:" + +#: smb4k/browser/smb4knetworkbrowser.cpp:51 +msgid "Type" +msgstr "Тип" + +#: smb4k/browser/smb4knetworkbrowser.cpp:52 +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:63 +msgid "IP Address" +msgstr "Адреса IP" + +#: smb4k/browser/smb4knetworkbrowser.cpp:53 +msgid "Comment" +msgstr "Коментар" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:141 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:532 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:552 +msgid "Scan Netwo&rk" +msgstr "Сканувати &мережу" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:144 +msgid "&Abort" +msgstr "П&ерервати" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:149 smb4k/smb4ksystemtray.cpp:72 +msgid "M&ount Manually" +msgstr "Змо&нтувати вручну" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:154 +msgid "Au&thentication" +msgstr "Ав&тентифікація" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:157 +msgid "&Custom Options" +msgstr "Не&типові параметри" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:160 +msgid "Add &Bookmark" +msgstr "&Додати закладку" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:163 +msgid "Pre&view" +msgstr "Перегля&д" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:166 +msgid "&Print File" +msgstr "&Надрукувати файл" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:169 +msgid "&Mount" +msgstr "&Змонтувати" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:203 +#: smb4k/listview/smb4kshareslistview_part.cpp:111 +#: smb4k/smb4ksystemtray.cpp:790 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:108 +msgid "&Unmount" +msgstr "&Демонтувати" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:345 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:370 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:400 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:462 +msgid "Scan Compute&r" +msgstr "Сканувати комп'юте&р" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:383 +#: smb4k/browser/smb4knetworkbrowser_part.cpp:486 +msgid "Scan Wo&rkgroup" +msgstr "Сканувати ро&бочу групу" + +#: smb4k/browser/smb4knetworkbrowser_part.cpp:1905 +msgid "Smb4KNetworkBrowserPart" +msgstr "Smb4KNetworkBrowserPart" + +#: smb4k/core/smb4kcore.cpp:248 +msgid "" +"Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will " +"hang if you try to access it.\n" +"Do you want to continue?" +msgstr "" +"До версії KDE 3.3.x, KIO і Konqueror не можуть працювати зі спільними " +"ресурсами CIFS. Konqueror зависає при спробі доступу до них.\n" +"Хочете продовжити?" + +#: smb4k/core/smb4kfileio.cpp:923 smb4k/core/smb4kfileio.cpp:1057 +msgid "Buffer size exceeded" +msgstr "Перевищено розмір буфера" + +#: smb4k/core/smb4kmounter.cpp:815 smb4k/core/smb4kmounter.cpp:862 +msgid "Do you really want to force the unmounting of this share?" +msgstr "Ви справді хочете примусово демонтувати цей спільний ресурс?" + +#: smb4k/core/smb4ksettings.cpp:30 +msgid "The path to the program \"grep\"" +msgstr "Шлях до програми \"grep\"" + +#: smb4k/core/smb4ksettings.cpp:33 +msgid "The path to the program \"awk\"" +msgstr "Шлях до програми \"awk\"" + +#: smb4k/core/smb4ksettings.cpp:36 +msgid "The path to the program \"sed\"" +msgstr "Шлях до програми \"sed\"" + +#: smb4k/core/smb4ksettings.cpp:39 +msgid "The path to the program \"xargs\"" +msgstr "Шлях до програми \"xargs\"" + +#: smb4k/core/smb4ksettings.cpp:42 +msgid "The path to the program \"rmdir\"" +msgstr "Шлях до програми \"rmdir\"" + +#: smb4k/core/smb4ksettings.cpp:45 +msgid "The path to the program \"nmblookup\"" +msgstr "Шлях до програми \"nmblookup\"" + +#: smb4k/core/smb4ksettings.cpp:48 +msgid "The path to the program \"smbclient\"" +msgstr "Шлях до програми \"smbclient\"" + +#: smb4k/core/smb4ksettings.cpp:51 +msgid "The path to the program \"smbspool\"" +msgstr "Шлях до програми \"smbspool\"" + +#: smb4k/core/smb4ksettings.cpp:54 +msgid "The path to the program \"net\"" +msgstr "Шлях до програми \"net\"" + +#: smb4k/core/smb4ksettings.cpp:57 +msgid "The path to the program \"mount.cifs\"" +msgstr "Шлях до програми \"mount.cifs\"" + +#: smb4k/core/smb4ksettings.cpp:60 +msgid "The path to the program \"umount.cifs\"" +msgstr "Шлях до програми \"umount.cifs\"" + +#: smb4k/core/smb4ksettings.cpp:63 +msgid "The path to the program \"smbmount\"" +msgstr "Шлях до програми \"smbmount\"" + +#: smb4k/core/smb4ksettings.cpp:66 +msgid "The path to the program \"smbumount\"" +msgstr "Шлях до програми \"smbumount\"" + +#: smb4k/core/smb4ksettings.cpp:69 +msgid "The path to the program \"mount\"" +msgstr "Шлях до програми \"mount\"" + +#: smb4k/core/smb4ksettings.cpp:72 +msgid "The path to the program \"mount_smbfs\" (FreeBSD only)" +msgstr "Шлях до програми \"mount_smbfs\" (тільки FreeBSD)" + +#: smb4k/core/smb4ksettings.cpp:75 +msgid "The path to the program \"smbutil\" (FreeBSD only)" +msgstr "Шлях до програми \"smbutil\" (тільки FreeBSD)" + +#: smb4k/core/smb4ksettings.cpp:78 +msgid "The path to the program \"umount\"" +msgstr "Шлях до програми \"umount\"" + +#: smb4k/core/smb4ksettings.cpp:81 +msgid "The path to the program \"smb4k_mount\"" +msgstr "Шлях до програми \"smb4k_mount\"" + +#: smb4k/core/smb4ksettings.cpp:84 +msgid "The path to the program \"smb4k_umount\"" +msgstr "Шлях до програми \"smb4k_umount\"" + +#: smb4k/core/smb4ksettings.cpp:87 +msgid "The path to the program \"smb4k_kill\"" +msgstr "Шлях до програми \"smb4k_kill\"" + +#: smb4k/core/smb4ksettings.cpp:90 +msgid "The path to the program \"smb4k_cat\"" +msgstr "Шлях до програми \"smb4k_cat\"" + +#: smb4k/core/smb4ksettings.cpp:93 +msgid "The path to the program \"smb4k_mv\"" +msgstr "Шлях до програми \"smb4k_mv\"" + +#: smb4k/core/smb4ksettings.cpp:96 +msgid "The path to the program \"super\" (optional)" +msgstr "Шлях до програми \"super\" (необов'язково)" + +#: smb4k/core/smb4ksettings.cpp:99 +msgid "The path to the program \"sudo\" (optional)" +msgstr "Шлях до програми \"sudo\" (необов'язково)" + +#: smb4k/core/smb4ksettings.cpp:102 +msgid "The path to the program \"dvips\" (optional)" +msgstr "Шлях до програми \"dvips\" (необов'язково)" + +#: smb4k/core/smb4ksettings.cpp:105 +msgid "The path to the program \"enscript\" (optional)" +msgstr "Шлях до програми \"enscript\" (необов'язково)" + +#: smb4k/core/smb4ksettings.cpp:108 +msgid "The path to the program \"rsync\" (optional)" +msgstr "Шлях до програми \"rsync\" (необов'язково)" + +#: smb4k/core/smb4ksettings.cpp:111 +msgid "The path to the program \"konsole\" (optional)" +msgstr "Шлях до програми \"konsole\" (необов'язково)" + +#: smb4k/core/smb4ksettings.cpp:118 +msgid "" +"Do not show the name of the share that is represented by the bookmark but " +"the custom label that was defined in the bookmark editor." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:121 +msgid "Embed application into system tray" +msgstr "Вбудувати програму в системний лоток" + +#: smb4k/core/smb4ksettings.cpp:122 +msgid "" +"Embed the application into the system tray. The system tray widget provides " +"a popup menu with several commonly used tasks so that you do not need to " +"bring up the main window everytime. If this setting is chosen you have to " +"use \"Quit\" from the \"File\" menu or the system tray widget to exit the " +"application." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:125 +msgid "Start docked" +msgstr "Запускати в системний лоток" + +#: smb4k/core/smb4ksettings.cpp:126 +msgid "" +"Start the application docked to the system tray, i.e. only the system tray " +"widget is shown and the main window is hidden. You can bring the main window " +"up by clicking on the system tray widget or by choosing \"Restore\" from its " +"popup menu." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:140 +msgid "How the shares should be displayed" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:141 +msgid "" +"Choose the kind of view you prefer for displaying the mounted shares. There " +"is an icon view or a list view available." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:145 +msgid "Printer shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:149 +msgid "" +"Hidden shares will be displayed in the network browser. Hidden shares are " +"ending with a $ sign, e.g. Musik$ or IPC$." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:152 +msgid "Show hidden IPC$ shares" +msgstr "Показувати сховані спільні ресурси IPC$" + +#: smb4k/core/smb4ksettings.cpp:153 +msgid "Hidden IPC$ shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:156 +msgid "Show hidden ADMIN$ shares" +msgstr "Показувати сховані спільні ресурси ADMIN$" + +#: smb4k/core/smb4ksettings.cpp:157 +msgid "Hidden ADMIN$ shares will be displayed in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:160 +msgid "Show the type of a share" +msgstr "Показувати тип спільного ресурсу" + +#: smb4k/core/smb4ksettings.cpp:161 +msgid "" +"The type of a share will be displayed in a separate column in the network " +"browser. It can either be Disk, Print or IPC." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:164 +msgid "Show the IP address of a server" +msgstr "Показувати адресу IP сервера" + +#: smb4k/core/smb4ksettings.cpp:165 +msgid "" +"The IP address of the server will be displayed in a separate column in the " +"network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:168 +msgid "Show the comment of a share" +msgstr "Показувати коментар спільного ресурсу" + +#: smb4k/core/smb4ksettings.cpp:169 +msgid "" +"The comment describing the server or share will be displayed in a separate " +"column in the network browser." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:172 +msgid "Show a tooltip with information about the network item" +msgstr "Показувати підказку з інформацією про мережний елемент" + +#: smb4k/core/smb4ksettings.cpp:173 +#, fuzzy +msgid "The tooltip shows various information about the current network item." +msgstr "Показувати підказку з інформацією про мережний елемент" + +#: smb4k/core/smb4ksettings.cpp:176 +msgid "Show the mount point of a share instead of its name" +msgstr "Замість назви спільного ресурсу показувати точку монтування" + +#: smb4k/core/smb4ksettings.cpp:177 +msgid "" +"A share is normally displayed with its name in the shares view. Choosing " +"this feature will cause the exchange of the share name by the mount point." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:181 +msgid "" +"You will not only see the shares that were mounted and are owned by you, but " +"also all other mounts using the SMBFS and CIFS file system that are present " +"on the system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:184 +msgid "Allow the dropping of files and directories onto share icons" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:185 +msgid "" +"This setting allows you to drop files or whole directories onto the share " +"icons, which will cause them to be copied." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:188 +msgid "Allow the dragging of share icons" +msgstr "Дозволити перетягання піктограм спільних ресурсів" + +#: smb4k/core/smb4ksettings.cpp:189 +msgid "" +"This setting allows you to drag a share item out of Smb4K and onto the " +"desktop or into a file manager. Only enable it if you think you absolutely " +"need it and read the handbook before you mark this checkbox." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:192 +msgid "Show a tooltip with information about the share" +msgstr "Показувати підказку з інформацією про спільний ресурс" + +#: smb4k/core/smb4ksettings.cpp:193 +#, fuzzy +msgid "The tooltip shows various information about the current share." +msgstr "Показувати підказку з інформацією про спільний ресурс" + +#: smb4k/core/smb4ksettings.cpp:196 +#, fuzzy +msgid "Show hidden files and directories when previewing a share" +msgstr "Перегляд схованих файлів і каталогів" + +#: smb4k/core/smb4ksettings.cpp:197 +msgid "" +"Display hidden files and directories in the preview dialog. The names of " +"hidden files and directories are beginning with a period and are usually " +"needed for very specific purposes (configuration file of an application, " +"etc.). Since they are not of any importance for your regular work, you " +"normally do not need to enable this feature." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:201 +msgid "" +"Show the UID and GID that own all files on the mounted file system. At the " +"moment the column will only contain an entry if the share was mounted with " +"the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:205 +msgid "" +"Show the login that was used to authenticate to the server. The column will " +"only contain an entry if the share was mounted with the CIFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:209 +msgid "Show the file system that was used for mounting the share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:213 +msgid "Show the free disk space that is left on the share." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:217 +#, fuzzy +msgid "Show the disk space that is already used on the share." +msgstr "Показати всі спільні ресурси, які змонтовано у системі" + +#: smb4k/core/smb4ksettings.cpp:221 +#, fuzzy +msgid "Show the total disk space of the share." +msgstr "Показувати тип спільного ресурсу" + +#: smb4k/core/smb4ksettings.cpp:225 +msgid "Show the space that is used on the share in percent." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:252 +msgid "Method how to retrieve the browse list" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:253 +msgid "" +"Choose the method how to compile the initial browse list. There are four " +"options available: The first one is the default one and employs \"nmblookup -" +"M -- -\" to discover all workgroups, domains, and their master browsers on " +"your network neighborhood. The second one instructs Smb4K to query the " +"current master browser of your workgroup or domain to retrieve the browse " +"list. The third is similar to the second one except that you can define the " +"master browser that should be queried. If you choose the last option, the " +"provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x." +"x -- '*'\"." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:256 +msgid "A custom master browser that is to be queried" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:257 +msgid "" +"Enter the name or IP address of a master browser here that should be queried " +"to compile the initial browse list." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:260 +msgid "A custom list of broadcast addresses" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:261 +msgid "" +"Enter a comma-separated list of broadcast addresses here (e.g. " +"192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the " +"respective broadcast areas." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:275 +msgid "Method for searching for remote hosts" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:276 +msgid "" +"Smb4K is able to search for remote hosts either using nmblookup or " +"smbclient. The nmblookup method is very reliable and works well. However, if " +"your network is configured uncommonly and you experience problems when " +"searching, you should try the smbclient method. But please note that you " +"lose the ability to search for IP addresses in that case." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:282 +#, fuzzy +msgid "The mount prefix" +msgstr "Префікс монтування:" + +#: smb4k/core/smb4ksettings.cpp:283 +msgid "" +"This is the prefix where Smb4K will create the mount points and mount the " +"remote shares." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:286 +#, fuzzy +msgid "Force the subdirectories created by Smb4K to be lowercase" +msgstr "Примушувати, щоб назви новостворених підтек були в нижньому регістрі" + +#: smb4k/core/smb4ksettings.cpp:287 +#, fuzzy +msgid "" +"All names of the subdirectories created by Smb4K below the mount prefix will " +"be lowercase." +msgstr "Примушувати, щоб назви новостворених підтек були в нижньому регістрі" + +#: smb4k/core/smb4ksettings.cpp:290 +#, fuzzy +msgid "Unmount the shares owned by the user on exit" +msgstr "Під час виходу демонтувати всі спільні ресурси користувача %1" + +#: smb4k/core/smb4ksettings.cpp:291 +#, fuzzy +msgid "Unmount all shares that belong to you when the program exits." +msgstr "Під час виходу демонтувати всі спільні ресурси користувача %1" + +#: smb4k/core/smb4ksettings.cpp:294 +msgid "Remount shares" +msgstr "Віддалені спільні ресурси" + +#: smb4k/core/smb4ksettings.cpp:295 +msgid "" +"Remount all your shares that were still mounted when you exited the program. " +"Shares that were mounted by other users are ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:298 +#, fuzzy +msgid "Allow the unmounting of shares owned by other users" +msgstr "" +"Дозволяти демонтування спільних ресурсів, які належать іншим користувачам" + +#: smb4k/core/smb4ksettings.cpp:299 +msgid "" +"Allow the unmounting of shares that were mounted by other users. In most " +"cases you need super user privileges for this. Please think before you " +"enable this option!" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:304 +msgid "Interval between checks for new and inaccessible shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:305 +msgid "" +"This is the time that elapses until Smb4K checks again for new mounts and " +"unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note " +"that the smaller the interval gets the higher is your system load." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:311 +#, fuzzy +msgid "Use a wallet to store authentication data" +msgstr "Будь ласка, введіть автентифікаційні дані для%1." + +#: smb4k/core/smb4ksettings.cpp:312 +msgid "" +"Use a wallet to store the authentication data. The login name and the " +"password name are stored encrypted on your hard drive. If this setting is " +"disabled, the authentication data is not stored permanently but only " +"temporarily." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:315 +msgid "Remember passwords if no wallet is used" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:316 +msgid "" +"If you decided to store the login names and passwords only temporarily, " +"Smb4K will remember them until the program exits. If you disable this " +"setting, you will have to provide the authentication data everytime it is " +"needed." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:319 +msgid "Use a default login" +msgstr "Вживати типовий вхід" + +#: smb4k/core/smb4ksettings.cpp:320 +msgid "" +"Enable the usage of a default login name and password. The authentication " +"data provided below is then used by default to authenticate to a remote " +"server. This is very useful e.g. if you are working in an Active Directory " +"environment or an NT domain." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:326 +msgid "The NetBIOS name of this computer" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:327 +msgid "" +"This is the NetBIOS name of this computer that is used by Smb4K. By default, " +"it is either the NetBIOS name that is defined in the smb.conf file or the " +"host name." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:330 +msgid "The name of the workgroup/domain this computer is in" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:331 +msgid "" +"This is the workgroup or domain this computer is or should be in. By " +"default, it is the workgroup that is defined in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:334 +#, fuzzy +msgid "The socket options" +msgstr "Параметри сокетів:" + +#: smb4k/core/smb4ksettings.cpp:335 +msgid "" +"These are the TCP socket options that are used by nmblookup, smbmount and " +"smbclient. Socket options are controls on the networking layer of the " +"operating systems which allow the connection to be tuned. See the manual " +"page of smb.conf for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:338 +#, fuzzy +msgid "The NetBIOS scope" +msgstr "Назва NetBIOS:" + +#: smb4k/core/smb4ksettings.cpp:339 +msgid "" +"This sets the NetBIOS scope that nmblookup, smbmount and smbclient will " +"operate under. It should not be set unless every machine on your network " +"neighborhood sets this value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:344 +msgid "The remote SMB port" +msgstr "Віддалений порт SMB" + +#: smb4k/core/smb4ksettings.cpp:345 +msgid "" +"This is the port that is to be used for connecting to remote servers. Please " +"note that this is independent of the settings in the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:348 +msgid "Use Kerberos for authentication" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:349 +msgid "" +"Try to authenticate with Kerberos. This is only useful in an Active " +"Directory environment. The setting affects the smbmount and smbclient " +"command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:352 +msgid "Use machine account for login" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:353 +msgid "" +"Make queries to the remote server using the machine account of the local " +"server. The setting affects the net and the smbclient command." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:367 +msgid "The file system that is used for mounting remote shares" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:368 +msgid "" +"This is the file system that will be used to mount the remote shares. The " +"Common Internet File System (CIFS) is supported by Windows 2000 and above as " +"well as by Samba. It offers many improvements and advancements compared to " +"the Server Message Block File System (SMBFS) which is used by Windows 9x and " +"below." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:487 +msgid "The charset used by the client" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:488 +msgid "" +"This is the charset that is used by the client side (i.e. your side) either " +"to convert local path names to and from Unicode in case of the CIFS file " +"system or for codepage to charset translations (NLS) in case of the SMBFS " +"file system. If you keep the default setting, Smb4K will try to " +"automatically determine the charset by looking up the \"unix charset\" " +"option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:657 +msgid "The codepage used by the server" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:658 +msgid "" +"This is the codepage that is used by the server. The setting is only " +"available with the SMBFS file system. If you keep the default setting, Smb4K " +"will try to automatically determine the codepage by looking up the \"dos " +"charset\" option in the smb.conf." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:661 +msgid "The user ID that is to be used for mounting" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:662 +msgid "" +"Here you can enter the user ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:665 +msgid "The group ID that is to be used for mounting" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:666 +msgid "" +"Here you can enter the group ID (a number) that the files and directories of " +"the mounted share will have. If you are using the CIFS file system and the " +"remote server supports the CIFS Unix Extentions, this setting will be " +"ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:669 +msgid "The file mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:670 +msgid "" +"This is the mask that will be used for creating files. It must be defined in " +"octal. In case the CIFS file system is used, this setting only takes effect " +"if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:673 +msgid "The directory mask for a share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:674 +msgid "" +"This is the mask that will be used for creating directories. It must be " +"defined in octal. In case the CIFS file system is used, this setting only " +"takes effect if the server does not support the CIFS Unix Extensions." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:688 +msgid "The write access granted for the share" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:689 +msgid "" +"Here you can choose if the shares should be mounted in read and write mode " +"or only read-only." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:693 +msgid "" +"The client side (i.e. your side) will check if you have the right UID/GID to " +"manipulate a file or directory. You might want to switch this feature off if " +"the server(s) support the CIFS Unix Extensions and you are not allowed to " +"access the files and directories. This setting does not affect the normal " +"ACL check." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:696 +msgid "Set UID and GID" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:697 +msgid "" +"In case the server supports the CIFS Unix Extensions, the client side (i.e. " +"your side) attempts to set the effective UID and GID of the current process " +"on newly created files, directories and devices. If this feature is turned " +"off, the default UID and GID defined for the share will be used. It is " +"recommended that you read the manual page of mount.cifs before you change " +"this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:701 +msgid "" +"Use inode numbers (unique persistent file identifiers) returned by the " +"server instead of automatically generating temporary inode numbers on the " +"client side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:705 +msgid "" +"Directly read from and write to files opened on the share. In some cases " +"this can provide better performance than the default behavior which caches " +"reads and writes." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:709 +msgid "" +"Translate six of the seven reserved characters (including the colon, " +"question mark, pipe, asterisk, greater than and less than characters but not " +"the backslash) to remap range (above 0xF000). This allows you to open files " +"that were created with such characters. This has no effect if the server " +"does not support Unicode." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:713 +msgid "Do not use locking. Do not start lockd." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:716 +msgid "Advanced custom options for the CIFS file system" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:717 +msgid "" +"Here you can enter advanced options for the CIFS file system in a comma-" +"separated list (refer to the manual page of mount.cifs to learn more). The " +"list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not " +"enter options that have already been defined in the configuration dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:720 +msgid "Determines how long directory listings are cached" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:721 +msgid "" +"This setting determines how long a directory listing is cached in " +"milliseconds. A high value means it takes longer until changes on the server " +"are noticed on the client side (i.e. your side), but it can also give you an " +"increase in performance on large directories, especially on long distances. " +"You need Linux kernel 2.4.2 or later to take advantage of this setting." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:724 +msgid "Unicode support" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:725 +msgid "" +"Use Unicode when communicating with the server. This will give you better " +"support for non-ASCII character sets with the SMBFS file system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:728 +#, fuzzy +msgid "Long file support" +msgstr "Вживати підтримку великих файлових систем" + +#: smb4k/core/smb4ksettings.cpp:729 +msgid "" +"Large file support (LFS) enables you to read and write \n" +"files bigger than 2 GB on shares that were mounted with the SMBFS file " +"system." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:754 +msgid "The protocol that is used with the net command" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:755 +msgid "" +"Here you can choose the protocol that will be used by the net command for " +"the communication with remote servers if appropriate. In most cases the " +"automatic detection will work fine and you should not need to change the " +"default setting. However, if you experience problems, use the RPC protocol " +"for newer operating systems (Windows NT4 and above) and the RAP protocol for " +"older ones (Windows 98/NT3 and below). Functions that need the ADS protocol " +"(for Active Directory environments) have not been implemented yet, so you " +"can ignore that one for now." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:758 +msgid "Name resolve order used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:759 +msgid "" +"This option is used to determine what naming services and in what order are " +"used to resolve host names and IP addresses. It takes a space-separated list " +"of up to four different name resolution options. Those are: lmhost, host, " +"wins, bcast. See the manual page of smbclient for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:763 +msgid "Transmit/send buffer size used by smbclient" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:764 +msgid "" +"This option changes the transmit/send buffer size when getting or putting a " +"file from/to the server. The default is 65520 bytes. Setting this value " +"smaller has been observed to speed up file transfers to and from Windows 9x " +"servers." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:788 +msgid "Signing state" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:789 +msgid "Set the signing state for smbclient." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:792 +msgid "The broadcast address used by nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:793 +msgid "" +"Queries performed with nmblookup will be send to the given broadcast " +"address. Without this option the default behavior is to send the queries to " +"the broadcast address of the network interface that was either auto-detected " +"or defined in the \"interfaces\" parameter of the smb.conf file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:796 +msgid "Use UDP port 137 with nmblookup" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:797 +msgid "" +"Try and bind to UDP port 137 to send and receive UDP datagrams. The reason " +"for this option is a bug in Windows 95 where it ignores the source port of " +"the requesting packet and only replies to UDP port 137. Unfortunately, on " +"most Unix systems super user privileges are needed to bind to this port. " +"Please read the manual page of nmblookup for more information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:803 +#, fuzzy +msgid "Prefix for synchronization" +msgstr "Типове місце призначення" + +#: smb4k/core/smb4ksettings.cpp:804 +msgid "" +"This is the path where Smb4K will store the files and directories during " +"synchronization. If you plan to synchronize only with one remote share, then " +"you can put the data directly in this directory. If you want to synchronize " +"with several remote shares, then you should create a subdirectory for each " +"share and choose the appropriate one in the synchronization dialog." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:807 +msgid "Use archive mode" +msgstr "Вживати режим архівування" + +#: smb4k/core/smb4ksettings.cpp:808 +msgid "Use archive mode (-a, --archive). This is a short form of -rlptgoD." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:811 +#, fuzzy +msgid "Recurse into subdirectories" +msgstr "Рекурсивно заходити в каталоги" + +#: smb4k/core/smb4ksettings.cpp:812 +#, fuzzy +msgid "Recurse into directories (-r, --recursive)." +msgstr "Рекурсивно заходити в каталоги" + +#: smb4k/core/smb4ksettings.cpp:815 +#, fuzzy +msgid "Skip files that are newer in the target directory" +msgstr "Пропускати файли, які новіші в каталозі цілі" + +#: smb4k/core/smb4ksettings.cpp:816 +msgid "" +"Update files in the destination directory that are older than in the source " +"directory (-u, --update)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:820 +msgid "" +"Update destination files in-place (--inplace). By default, rsync first " +"creates a new copy of a file and moves it into place after its transfer " +"finished. If you enable this feature, no copy will be created but the " +"destination file will immediately be overwritten instead. An exception to " +"this is if you combine this option with --backup." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:824 +msgid "" +"Use relative paths (-R, --relative). This means that the full path names " +"specified on the command line are sent to the server rather than just the " +"last parts of the file names." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:827 +msgid "Don't send implied directories with --relative" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:828 +msgid "" +"Don't send implied directories with --relative (--no-implied-dirs). This " +"means that the corresponding path elements on the destination system are " +"left unchanged if they exist, and any missing implied directories are " +"created with default attributes. This even allows these implied path " +"elements to have big differences, such as being a symlink to a directory on " +"one side of the transfer, and a real directory on the other side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:832 +msgid "" +"Transfer directories without recursing (-d, --dirs). This means that all top-" +"level subdirectories are transferred but without their contents." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:836 +msgid "" +"Compress data during transfer (-z, --compress). This significantly reduces " +"the amount of data that is being transferred. You may want to use this " +"option, if you have a slow connection." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:840 +msgid "Copy symlinks as symlinks (-l, --links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:844 +msgid "" +"Transform symlinks into the items they are pointing to (-L, --copy-links)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:848 +msgid "" +"Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-" +"links). This means that only those symlinks are transformed that point to " +"items that are outside the copied tree. Absolute symlinks are treated the " +"same way. This option has no additional effect if --copy-links has also been " +"specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:852 +msgid "" +"Ignore symlinks that point outside the copied tree (--safe-links). All " +"absolute symlinks are also ignored. If you use this option in conjunction " +"with --relative you might get unexpected results." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:856 +msgid "" +"Preserve hard links (-H, --hard-links). This options causes rsync to " +"preserve the hard links that are found during the transfer. Without it, hard " +"links are treated as though they were separate files." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:860 +msgid "" +"Treat symlinked directories on the receiving side as though they were real " +"ones (-K, --keep-dirlinks). This only works if the symlink matches a real " +"directory from the sending side. Without this option, the receiver's symlink " +"will be deleted and replaced with a real directory." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:864 +msgid "" +"Preserve permissions (-p, --perms). The permissions of the destination file " +"will be same as the source file. For what happens if this option is switched " +"off, please read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:868 +msgid "" +"Preserve the group (-g, --group). The group of the destination file will be " +"set to the same value as the source file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:871 +#, fuzzy +msgid "Preserve owner (super user only)" +msgstr "Зберігати власника (тільки root)" + +#: smb4k/core/smb4ksettings.cpp:872 +msgid "" +"Preserve the owner (-o, --owner). The owner of the destination file will be " +"set to the same value as the source file, but only if the receiving rsync is " +"run as the super user. Without this option, the owner is set to the invoking " +"user on the receiving side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:876 +msgid "" +"Preserve device and special files (-D, --devices --specials). This option " +"causes rsync to transfer character and block devices as well as special " +"files such as named sockets and fifos. It works only partially if rsync is " +"not run as super user and the --super option is not specified." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:880 +msgid "" +"Preserve times (-t, --times). The modification times are transferred along " +"with the files. For what happens if this option is switched off, please read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:884 +msgid "" +"Omit directories when preserving times (-O, --omit-dir-times). This means " +"that directories are omitted when modification times are being preserved. " +"Thus, this feature only works in conjunction with --times." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:888 +msgid "" +"Remove all synchronized source files (--remove-source-files). This tells " +"rsync to remove from the sending side the non-directory items that are a " +"part of the transfer and have been successfully duplicated on the receiving " +"side." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:892 +msgid "" +"Delete extraneous files from destination (--delete). This tells rsync to " +"delete all files from the receiving side that are not present on the sending " +"side, but only for the directories that are being synchronized." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:896 +msgid "" +"Delete files on the receiving side before the transfer starts (--delete-" +"before). This is the default behavior if --delete or --delete-excluded is " +"specified without one of the --delete-WHEN options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:900 +msgid "" +"Delete files on the receiving side after the transfer has completed (--" +"delete-after, --del)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:904 +msgid "" +"Delete files on the receiving side during the transfer (--delete-during). " +"This method is faster than --delete-before or --delete-after, but it is only " +"supported with rsync 2.6.4 or later." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:907 +#, fuzzy +msgid "Also delete excluded files from destination directory" +msgstr "Також видалити в місці призначення не включені файли" + +#: smb4k/core/smb4ksettings.cpp:908 +msgid "" +"Also delete excluded files from destination directory (--delete-excluded). " +"In addition to deleting the files on the receiving side that are not on the " +"sending side, this tells rsync to also delete any files on the receiving " +"side that are excluded. Refer to rsync's manual page for further information." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:912 +msgid "" +"Delete even if I/O errors occur (--ignore-errors). This option has to be " +"specified in conjunction with --delete to take effect." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:916 +msgid "" +"Force deletion of directories even if they are not empty (--force). This " +"option tells rsync to delete a non-empty directory when it is to be replaced " +"by a non-directory. This is only relevant if deletions are not active." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:919 +msgid "Only delete a maximum number of files" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:920 +msgid "" +"Only delete as many files as defined here (--max-delete=NUM). This tells " +"rsync not to delete more than NUM files or directories (NUM must be non-" +"zero). This is useful when mirroring very large trees to prevent disasters." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:924 +msgid "Value for DeleteMaximum config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:927 smb4k/core/smb4ksettings.cpp:935 +#, fuzzy +msgid "Don't transfer any file smaller than SIZE" +msgstr "Не переносити файли менші, ніж" + +#: smb4k/core/smb4ksettings.cpp:928 +msgid "" +"This option causes rsync to not transfer any file that is smaller than the " +"specified size (--min-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:932 +msgid "Value for MinimalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:936 +msgid "" +"This option causes rsync to not transfer any file that is larger than the " +"specified size (--max-size=SIZE)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:940 +msgid "Value for MamximalTransferSize config entry" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:944 +msgid "" +"Keep partially transferred files (--partial). The default behavor is that " +"any partially transferred file is deleted if the transfer is interrupted." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:947 +#, fuzzy +msgid "The directory where to put a partially transferred file into." +msgstr "Покласти частково перенесений файл у" + +#: smb4k/core/smb4ksettings.cpp:948 +msgid "" +"Put a partially transferred file into this directory (--partial-dir=DIR). " +"This is a better way than the --partial option to keep partial files, " +"because the partially transferred file is kept in a different directory and " +"the destination file is not overwritten." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:951 +msgid "The data for the UsePartialDirectory option" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:955 +msgid "" +"Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a " +"useful shorthand for excluding a broad range of files that you often do not " +"want to transfer between systems. This option uses the same algorithm that " +"CVS uses to determine if a file should be ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:958 +#, fuzzy +msgid "Exclude files that match a certain pattern" +msgstr "Виключати файли, які відповідають цьому взірцю:" + +#: smb4k/core/smb4ksettings.cpp:959 +msgid "" +"Exclude files that match a certain pattern (--exclude=PATTERN). This is a " +"special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:962 +msgid "Pattern that is used for file exclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:965 +#, fuzzy +msgid "Read exclude patterns from a file" +msgstr "Прочитати взірці виключення з" + +#: smb4k/core/smb4ksettings.cpp:966 +msgid "" +"Read exclude patterns from a file (--exclude-from=FILE). This option is " +"similar to the --exclude=PATTERN option except that the exclude patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:969 +msgid "The file from which the exclude patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:972 +#, fuzzy +msgid "Do not exclude files matching a certain pattern" +msgstr "Не виключати файли, які відповідають цьому взірцю:" + +#: smb4k/core/smb4ksettings.cpp:973 +msgid "" +"Do not exclude files matching a certain pattern (--include=PATTERN). This is " +"a special filter rule. For further information on filter rules see rsync's " +"manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:976 +msgid "Pattern that is used for file inclusion" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:979 +#, fuzzy +msgid "Read include patterns from a file" +msgstr "Прочитати взірці включення з" + +#: smb4k/core/smb4ksettings.cpp:980 +msgid "" +"Read include patterns from a file (--include-from=FILE). This option is " +"similar to the --include=PATTERN option except that the include patterns are " +"read from a file. This is a special filter rule. For further information on " +"filter rules see rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:983 +msgid "The file from which the include patterns are read" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:986 +msgid "Add custom file-filtering rules" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:987 +msgid "" +"Add custom file-filtering rules (-f, --filter=RULE). This option allows you " +"to add rules to selectively exclude certain files from the list of files to " +"be transferred." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:990 +#, fuzzy +msgid "Use -F filter rule" +msgstr "Правила фільтра" + +#: smb4k/core/smb4ksettings.cpp:991 +msgid "" +"This filter rule tells rsync to look for per-directory .rsync-filter files " +"that have been sprinkled through the hierarchy and use their rules to filter " +"the files in the transfer. It has no effect, if you also choose to use the --" +"filter='exclude .rsync-filter' rule." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:994 +#, fuzzy +msgid "Use -FF filter rule" +msgstr "Правила фільтра" + +#: smb4k/core/smb4ksettings.cpp:995 +msgid "" +"This rule filters out the .rsync-filter files from the transfer. These files " +"normally contain filter rules that can be activated by choosing the --" +"filter='dir-merge /.rsync-filter' rule and deselecting this one." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:999 +msgid "" +"Handle sparse files efficiently (-S, --sparse) so that they take up less " +"space on the destination. This option conflicts with --inplace. For further " +"information read rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1003 +msgid "" +"Copy files whole (-W, --whole-file). With this option the incremental rsync " +"algorithm is not used and the whole file is sent as-is instead." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1006 +#, fuzzy +msgid "Do not cross file system boundaries" +msgstr "Не пересікати межі файлових систем" + +#: smb4k/core/smb4ksettings.cpp:1007 +msgid "" +"Do not cross file system boundaries (-x, --one-file-system). This tells " +"rsync to avoid crossing a filesystem boundary when recursing. For further " +"information on this option, read the manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1010 +msgid "Skip creating new files on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1011 +msgid "" +"Skip creating new files on the receiving side (--existing). This tells rsync " +"to skip creating files (including directories) that do not exist yet on the " +"destination. If this option is combined with the --ignore-existing option, " +"no files will be updated (which can be useful if all you want to do is to " +"delete extraneous files)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1014 +msgid "Skip updating files that exist on the receiving side" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1015 +msgid "" +"Skip updating files that already exist on the receiving side (--ignore-" +"existing). Existing directories are not ignored." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1018 +#, fuzzy +msgid "Delay updates until the end of the transfer" +msgstr "Після перенесення видалити файли в місці призначення" + +#: smb4k/core/smb4ksettings.cpp:1019 +msgid "" +"Delay updates until the end of the transfer (--delay-updates). This option " +"puts the temporary file from each updated file into a holding directory " +"until the end of the transfer, at which time all the files are renamed and " +"copied into place in rapid succession." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1023 +msgid "" +"Make backups (-b, --backup). With this option, preexisting destination files " +"are renamed as each file is transferred or deleted. You can control where " +"the backup file goes and what (if any) suffix gets appended using the --" +"backup-dir=DIR and --suffix=SUFFIX options." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1026 +msgid "Use a suffix for backups" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1027 +msgid "Use this suffix for backups (--suffix=SUFFIX)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1030 +#, fuzzy +msgid "Backup suffix" +msgstr "Суфікс резервних копій:" + +#: smb4k/core/smb4ksettings.cpp:1033 +msgid "Put backups into a certain directory" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1034 +msgid "Store backups in this directory (--backup-dir=DIR)." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1037 +#, fuzzy +msgid "Backup directory" +msgstr "Каталог резервних копій:" + +#: smb4k/core/smb4ksettings.cpp:1040 +#, fuzzy +msgid "Force a fixed checksum block-size" +msgstr "Примушувати фіксований розмір блоків контрольної суми:" + +#: smb4k/core/smb4ksettings.cpp:1041 +msgid "" +"Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the " +"block size used in the rsync algorithm to a fixed value." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1045 +msgid "The block size" +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1048 +#, fuzzy +msgid "Set block/file checksum seed" +msgstr "Вказати розсадження блоків/файлів контрольної суми:" + +#: smb4k/core/smb4ksettings.cpp:1049 +msgid "" +"Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum " +"seed to this integer. This 4 byte checksum seed is included in each block " +"and file MD4 checksum calculation. By default the checksum seed is generated " +"by the server and defaults to the current time." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1053 +#, fuzzy +msgid "The checksum seed" +msgstr "Вказати розсадження блоків/файлів контрольної суми:" + +#: smb4k/core/smb4ksettings.cpp:1056 +#, fuzzy +msgid "Skip files based on a checksum" +msgstr "Попускати на основі контрольної суми" + +#: smb4k/core/smb4ksettings.cpp:1057 +msgid "" +"Skip files based on a checksum and not based on modification time and size (-" +"c, --checksum). For further information on how this feature works read " +"rsync's manual page." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1074 +#, fuzzy +msgid "The program that should be used to gain super user privileges" +msgstr "" +"Для отримання привілеїв суперкористувача використовувати наступну програму:" + +#: smb4k/core/smb4ksettings.cpp:1075 +msgid "" +"Choose the program that will grant you limited super user privileges for " +"mounting and unmounting remote shares. You can either select sudo, the " +"standard tool for this purpose on most distributions, or super." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1078 +#, fuzzy +msgid "Use super user privileges to unmount inaccessible shares" +msgstr "" +"Застосовувати привілеї суперкористувача для монтування та демонтування " +"спільних ресурсів" + +#: smb4k/core/smb4ksettings.cpp:1079 +msgid "" +"Unmount a share under Linux by force. This even works if the file system is " +"\"busy\", because it is immediately detached from the file system hierarchy " +"and all references to it are cleaned up later when it is not busy anymore. " +"Linux kernel 2.4.11 or later is needed to take advantage of this feature. " +"Use with case! Note, that you will need the root password to write the " +"necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4ksettings.cpp:1083 +msgid "" +"Use super user privileges for mounting and unmounting remote shares. This " +"feature is only needed, if you are not allowed to use smbmount, smbumount, " +"mount.cifs and umount.cifs as normal user. Note, that you will need the root " +"password to write the necessary changes to the configuration file." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:42 +#, fuzzy +msgid "" +"The browse list could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося отримати список перегляду.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:46 +#, fuzzy +msgid "" +"The browse list could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося отримати список перегляду.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:55 +#, fuzzy +msgid "" +"The list of servers could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося отримати список серверів.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:59 +#, fuzzy +msgid "" +"The list of servers could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося отримати список серверів.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:68 +#, fuzzy +msgid "" +"The list of shares could not be retrieved.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося отримати список спільних ресурсів.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:72 +#, fuzzy +msgid "" +"The list of shares could not be retrieved.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося отримати список спільних ресурсів.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:81 +#, fuzzy +msgid "" +"The preview could not be compiled.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося створити попередній перегляд.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:85 +#, fuzzy +msgid "" +"The preview could not be compiled.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося створити попередній перегляд.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:92 +#, fuzzy +msgid "" +"The wallet \"%1\" could not be opened. KWallet support will be disabled for " +"this session." +msgstr "Помилка відкриття торбинки \"%1\". Підтримку KWallet буде вимкнено." + +#: smb4k/core/smb4kerror.cpp:100 +#, fuzzy +msgid "" +"Some file permissions could not be determined.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалось визначити деякі права доступу до файлів.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:104 +#, fuzzy +msgid "" +"Some file permissions could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалось визначити деякі права доступу до файлів.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:111 +msgid "" +"You are not allowed to unmount this share, because it is owned by another " +"user." +msgstr "" +"Вам не дозволяється демонтувати цей спільний ресурс, бо його власником є " +"інший користувач." + +#: smb4k/core/smb4kerror.cpp:119 +#, fuzzy +msgid "" +"The share \"%1\" could not be mounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося змонтувати спільний ресурс \"%1\".\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:123 +#, fuzzy +msgid "" +"The share \"%1\" could not be mounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося змонтувати спільний ресурс \"%1\".\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:132 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося демонтувати спільний ресурс \"%1\".\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:136 +#, fuzzy +msgid "" +"The share \"%1\" could not be unmounted.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося демонтувати спільний ресурс \"%1\".\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:143 +#, fuzzy +msgid "The file \"%1\" could not be found." +msgstr "Не вдалося знайти файл \"%1\"." + +#: smb4k/core/smb4kerror.cpp:151 +#, fuzzy +msgid "The file \"%1\" could not be read." +msgstr "Не вдалось прочитати файл \"%1\"." + +#: smb4k/core/smb4kerror.cpp:155 +#, fuzzy +msgid "" +"The file \"%1\" could not be read.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося демонтувати цей спільний ресурс, бо рядок точки підключення " +"порожній." + +#: smb4k/core/smb4kerror.cpp:164 +#, fuzzy +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося визначити назву комп'ютера за допомогою системного виклику " +"gethostname().\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:168 +#, fuzzy +msgid "" +"The name of your computer could not be determined by using the gethostname() " +"system call.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося визначити назву комп'ютера за допомогою системного виклику " +"gethostname().\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:175 +msgid "" +"Either your PATH environment variable is not set properly or there are the " +"following programs missing on your system:\n" +"%1\n" +"Please correct this and restart Smb4K." +msgstr "" +"Або ваша змінна PATH правильно не встановлена, або у вашій системі відсутні " +"наступні програми:\n" +"%1\n" +"Будь ласка, виправте це і заново запустіть Smb4K." + +#: smb4k/core/smb4kerror.cpp:181 +#, fuzzy +msgid "" +"The file \"%1\" is currently being edited by user %2. To avoid any problems, " +"access to this file is denied at the moment. Please try again later." +msgstr "" +"В даний час файл %1 редагується користувачем %2. Щоб запобігти будь-яким " +"проблемам, поки що доступ до цього файла заборонений. Будь ласка, спробуйте " +"знов пізніше." + +#: smb4k/core/smb4kerror.cpp:187 +#, fuzzy +msgid "The directory \"%1\" could not be created." +msgstr "Не вдалось створити каталог \"%1\"." + +#: smb4k/core/smb4kerror.cpp:193 +#, fuzzy +msgid "The file \"%1\" could not be written." +msgstr "Не вдалось записати файл \"%1\"." + +#: smb4k/core/smb4kerror.cpp:199 +#, fuzzy +msgid "" +"The share could not be unmounted, because the mount point string was empty." +msgstr "" +"Не вдалося демонтувати цей спільний ресурс, бо рядок точки підключення " +"порожній." + +#: smb4k/core/smb4kerror.cpp:205 +msgid "This feature has not been enabled." +msgstr "Цю функціональність не увімкнено." + +#: smb4k/core/smb4kerror.cpp:211 +msgid "Printers cannot be bookmarked." +msgstr "До принтерів не можна робити закладки." + +#: smb4k/core/smb4kerror.cpp:217 +msgid "" +"IP addresses are not supported with this search method. Please choose \"Use " +"nmblookup\" in the configuration dialog and try again." +msgstr "" +"Вибраний метод пошуку не підтримує адреси IP. Будь ласка, виберіть у вікні " +"налаштування \"Вживати nmblookup.\" і спробуйте знов." + +#: smb4k/core/smb4kerror.cpp:225 +#, fuzzy +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося імпортувати список змонтованих спільних ресурсів SMBFS і CIFS.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:229 +#, fuzzy +msgid "" +"The list of mounted SMBFS and CIFS shares could not be imported.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося імпортувати список змонтованих спільних ресурсів SMBFS і CIFS.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:236 +#, fuzzy +msgid "The command \"%1\" could not be found." +msgstr "Не вдалось знайти команду \"%1\"." + +#: smb4k/core/smb4kerror.cpp:244 +#, fuzzy +msgid "" +"The file \"%1\" could not be printed.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося надрукувати файл \"%1\".\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:248 +#, fuzzy +msgid "" +"The file \"%1\" could not be printed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося надрукувати файл \"%1\".\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:257 +#, fuzzy +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося створити тимчасовий каталог \"%1\".\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:261 +#, fuzzy +msgid "" +"The temporary directory \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося створити тимчасовий каталог \"%1\".\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:270 +#, fuzzy +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося створити тимчасовий файл \"%1\".\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:274 +#, fuzzy +msgid "" +"The temporary file \"%1\" could not be created.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося створити тимчасовий файл \"%1\".\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:281 +#, fuzzy +msgid "The directory \"%1\" could not be found." +msgstr "Не вдалось знайти каталог \"%1\"." + +#: smb4k/core/smb4kerror.cpp:287 +msgid "" +"The file \"%1\" is irregular. That means it is either a symlink, a fifo, or " +"something similar. This could indicate that someone is trying to exploit " +"your system. Please inform your system administrator." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:295 +#, fuzzy +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Не вдалося успішно виконати синхронізацію.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:299 +#, fuzzy +msgid "" +"The synchronization could not the accomplished successfully.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося успішно виконати синхронізацію.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:308 +#, fuzzy +msgid "The file \"%1\" could not be opened." +msgstr "Не вдалось відкрити файл \"%1\"." + +#: smb4k/core/smb4kerror.cpp:312 +#, fuzzy +msgid "" +"The file \"%1\" could not be opened.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося демонтувати цей спільний ресурс, бо рядок точки підключення " +"порожній." + +#: smb4k/core/smb4kerror.cpp:321 +#, fuzzy +msgid "The file \"%1\" could not be closed." +msgstr "Не вдалось відкрити файл \"%1\"." + +#: smb4k/core/smb4kerror.cpp:325 +#, fuzzy +msgid "" +"The file \"%1\" could not be closed.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося демонтувати цей спільний ресурс, бо рядок точки підключення " +"порожній." + +#: smb4k/core/smb4kerror.cpp:332 +#, fuzzy +msgid "" +"The list of arguments for the \"net\" command could not be assembled.\n" +"At the moment it reads: %1" +msgstr "" +"Не вдалося скласит список аргументів для команди \"net\".\n" +"В даний момент він виглядає так: %1" + +#: smb4k/core/smb4kerror.cpp:340 +msgid "The list of supplementary group IDs could not be determined." +msgstr "" + +#: smb4k/core/smb4kerror.cpp:344 +#, fuzzy +msgid "" +"The list of supplementary group IDs could not be determined.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Не вдалося демонтувати цей спільний ресурс, бо рядок точки підключення " +"порожній." + +#: smb4k/core/smb4kerror.cpp:354 +#, fuzzy +msgid "" +"An unknown error occurred.\n" +"Detailed information cannot be provided because there was no error message." +msgstr "" +"Виникла невідома помилка.\n" +"Докладнішої інформації неможливо надати, тому що не було повідомлення " +"помилки." + +#: smb4k/core/smb4kerror.cpp:358 +#, fuzzy +msgid "" +"An unknown error occurred.\n" +"Read the error message under \"Details\" to find out more." +msgstr "" +"Виникла невідома помилка.\n" +"Щоб дізнатись більше, прочитайте повідомлення помилки в \"Подробицях\"." + +#: smb4k/core/smb4kerror.cpp:385 +#, fuzzy +msgid "" +"The mimetype \"%1\" is not supported. Please convert the file to PostScript " +"or PDF." +msgstr "" +"Тип Mime \"%1\"не підтримується. Будь ласка, перетворіть файл у PostScript " +"або PDF." + +#: smb4k/core/smb4kerror.cpp:391 +#, fuzzy +msgid "" +"You previously chose to use \"%1\", but now it is missing on your system. " +"Smb4K will disable this feature." +msgstr "" +"Ви попередньо вказали, щоб використовувати \"%1\", але тепер вона відсутня у " +"вашій системі. Smb4K вимкне цю функціональність." + +#: smb4k/core/smb4kerror.cpp:397 +msgid "" +"The label \"%1\" is used more than once. It will automatically be renamed " +"for bookmark \"%2\" to avoid confusion." +msgstr "" + +#: smb4k/core/smb4kpasswordhandler.cpp:258 +msgid "The access was denied. " +msgstr "У доступі відмовлено. " + +#: smb4k/core/smb4kpasswordhandler.cpp:261 +msgid "The password is not correct. " +msgstr "Неправильний пароль. " + +#: smb4k/core/smb4kpasswordhandler.cpp:264 +msgid "The permission was denied. " +msgstr "У доступі було відмовлено. " + +#: smb4k/core/smb4kpasswordhandler.cpp:267 +msgid "An authentication error occurred. " +msgstr "Трапилась помилка автентифікації. " + +#: smb4k/core/smb4kpasswordhandler.cpp:270 +msgid "The logon failed. " +msgstr "Вхід (logon) зазнав невдачі. " + +#: smb4k/core/smb4kpasswordhandler.cpp:278 +msgid "Please enter authentication data for server %1." +msgstr "Будь ласка, введіть автентифікаційні дані для сервера %1." + +#: smb4k/core/smb4kpasswordhandler.cpp:282 +msgid "Please enter authentication data for share %1." +msgstr "Будь ласка, введіть автентифікаційні дані для спільного ресурсу %1." + +#: smb4k/core/smb4knetworkitems.cpp:202 +msgid "Disk" +msgstr "Диск" + +#: smb4k/core/smb4knetworkitems.cpp:206 smb4k/dialogs/smb4kprintdialog.cpp:71 +msgid "Printer" +msgstr "Принтер" + +#: smb4k/core/smb4khomesshareshandler.cpp:73 +msgid "Specify User" +msgstr "Вказати користувача" + +#: smb4k/core/smb4khomesshareshandler.cpp:74 +msgid "Clear List" +msgstr "Очистити список" + +#: smb4k/core/smb4khomesshareshandler.cpp:87 +msgid "Please specify a user name." +msgstr "Будь ласка, вкажіть ім'я користувача." + +#: smb4k/listview/smb4kshareslistview.cpp:52 +msgid "Owner" +msgstr "" + +#: smb4k/listview/smb4kshareslistview.cpp:54 +#, fuzzy +msgid "Login" +msgstr "Посилання" + +#: smb4k/listview/smb4kshareslistview.cpp:57 +#, fuzzy +msgid "Free" +msgstr "Вільно:" + +#: smb4k/listview/smb4kshareslistview.cpp:58 +#, fuzzy +msgid "Used" +msgstr "Використано:" + +#: smb4k/listview/smb4kshareslistview.cpp:59 +#, fuzzy +msgid "Total" +msgstr "Всього:" + +#: smb4k/listview/smb4kshareslistview.cpp:60 +#, fuzzy +msgid "Usage" +msgstr "Вжиток:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:122 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:122 +msgid "Mount point:" +msgstr "Точка монтування:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:211 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:211 +msgid "Free:" +msgstr "Вільно:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:215 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:215 +msgid "Used:" +msgstr "Використано:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:219 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:219 +msgid "Total:" +msgstr "Всього:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:223 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:223 +msgid "Usage:" +msgstr "Вжиток:" + +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:229 +#: smb4k/listview/smb4kshareslistviewtooltip.cpp:388 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:229 +#: smb4k/iconview/smb4ksharesiconviewtooltip.cpp:388 +msgid "This share is inaccessible." +msgstr "" + +#: smb4k/listview/smb4kshareslistview_part.cpp:115 +#: smb4k/smb4ksystemtray.cpp:794 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:112 +msgid "&Force Unmounting" +msgstr "&Примусити демонтування" + +#: smb4k/listview/smb4kshareslistview_part.cpp:119 +#: smb4k/smb4ksystemtray.cpp:446 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:116 +msgid "U&nmount All" +msgstr "Демо&нтувати всі" + +#: smb4k/listview/smb4kshareslistview_part.cpp:122 +#: smb4k/smb4ksystemtray.cpp:799 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:119 +msgid "S&ynchronize" +msgstr "С&инхронізувати" + +#: smb4k/listview/smb4kshareslistview_part.cpp:125 +#: smb4k/smb4ksystemtray.cpp:804 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:122 +#, fuzzy +msgid "Open with Konso&le" +msgstr "Konso&le" + +#: smb4k/listview/smb4kshareslistview_part.cpp:128 +#: smb4k/smb4ksystemtray.cpp:809 +#: smb4k/iconview/smb4ksharesiconview_part.cpp:125 +#, fuzzy +msgid "Open with &Konqueror" +msgstr "&Konqueror" + +#: smb4k/listview/smb4kshareslistview_part.cpp:676 +#, fuzzy +msgid "Smb4KSharesListViewPart" +msgstr "Smb4KSharesIconViewPart" + +#: smb4k/searchdlg/smb4ksearchdialog_part.cpp:254 +msgid "Smb4KSearchDialogPart" +msgstr "Smb4KSearchDialogPart" + +#: smb4k/searchdlg/smb4ksearchdialogitem.cpp:80 +msgid "The search failed." +msgstr "Пошук за зазнав невдачі." + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:52 +#, fuzzy +msgid "Enter the search string here." +msgstr "Введіть тут назву вузла" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:57 plugin/smb4k_konqplugin.cpp:71 +msgid "Search" +msgstr "Пошук" + +#: smb4k/searchdlg/smb4ksearchdialog.cpp:63 +msgid "Search Results" +msgstr "Результати пошуку" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize" +msgstr "Синхронізувати" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:52 +msgid "Synchronize the destination with the source" +msgstr "Синхронізувати місце призначення з джерелом" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap Paths" +msgstr "Шляхи свопінгу" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:53 +msgid "Swap source and destination" +msgstr "Джерело і місце призначення свопінгу" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:60 +msgid "Source:" +msgstr "Джерело:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:65 +msgid "Destination:" +msgstr "Призначення:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:85 +msgid "Files transferred:" +msgstr "Перенесено файлів:" + +#: smb4k/dialogs/smb4ksynchronizationdialog.cpp:90 +msgid "Transfer rate:" +msgstr "Швидкість перенесення:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:46 +msgid "Print File" +msgstr "Надрукувати файл" + +#: smb4k/dialogs/smb4kprintdialog.cpp:74 +msgid "Name:" +msgstr "Назва:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:98 +msgid "File:" +msgstr "Файл:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:107 +msgid "Copies:" +msgstr "Копій:" + +#: smb4k/dialogs/smb4kprintdialog.cpp:155 +msgid "You haven't specified a file." +msgstr "Ви не вказали файл." + +#: smb4k/dialogs/smb4kmountdialog.cpp:48 +msgid "Mount Share" +msgstr "Змонтувати спільний ресурс" + +#: smb4k/dialogs/smb4kmountdialog.cpp:75 +msgid "IP Address:" +msgstr "Адреса IP:" + +#: smb4k/dialogs/smb4kmountdialog.cpp:83 +msgid "Add this share to the bookmarks" +msgstr "Додати цей спільний ресурс до закладок" + +#: smb4k/dialogs/smb4kmountdialog.cpp:140 +#, fuzzy +msgid "" +"The format of the share you entered is not correct. It must have the form //" +"HOST/SHARE." +msgstr "" +"Неправильний ввід спільного ресурсу. Він має бути у вигляді //HOST/SHARE." + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:46 +msgid "Preview" +msgstr "Перегляд" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:111 +msgid "Forward" +msgstr "Вперед" + +#: smb4k/dialogs/smb4kpreviewdialog.cpp:112 +msgid "Up" +msgstr "Вгору" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:93 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:106 +msgid "Custom Options" +msgstr "Нетипові параметри" + +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:185 +#: smb4k/dialogs/smb4kcustomoptionsdialog.cpp:301 +msgid "Try to authenticate with Kerberos (Active Directory)" +msgstr "Спробувати автентифікуват з Kerberos (Active Directory)" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:52 +msgid "Bookmark Editor" +msgstr "Редактор закладок" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:61 +msgid "Bookmark" +msgstr "Закладка" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:62 +msgid "Workgroup" +msgstr "Робоча група" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:64 +msgid "Label" +msgstr "Надпис" + +#: smb4k/dialogs/smb4kbookmarkeditor.cpp:76 +msgid "Remove &All" +msgstr "Вилучити в&сі" + +#: smb4k/smb4ksystemtray.cpp:59 smb4k/main.cpp:64 +msgid "Smb4K" +msgstr "Smb4K" + +#: smb4k/main.cpp:51 +msgid "" +"Smb4K is an advanced network neighborhood browser and a\n" +"front end to the programs of the Samba software suite." +msgstr "" + +#: smb4k/main.cpp:66 +msgid "" +"(c) 2003-2008, Alexander Reinholdt\n" +"(c) 2004-2008, Massimo Callegari\n" +"(c) 2004, Franck Babin" +msgstr "" + +#: smb4k/main.cpp:69 smb4k/main.cpp:70 smb4k/main.cpp:71 +msgid "Developer" +msgstr "Розробник" + +#: smb4k/main.cpp:74 +msgid "Catalan translation" +msgstr "Каталонський переклад" + +#: smb4k/main.cpp:75 smb4k/main.cpp:100 +msgid "Polish translation" +msgstr "Польський переклад" + +#: smb4k/main.cpp:76 +msgid "Chinese Simplified translation" +msgstr "Китайський (спрощений) переклад" + +#: smb4k/main.cpp:77 +msgid "Russian translation" +msgstr "Російський переклад" + +#: smb4k/main.cpp:78 +msgid "Swedish translation and intensive testing" +msgstr "Шведський переклад та інтенсивне тестування" + +#: smb4k/main.cpp:79 smb4k/main.cpp:96 +msgid "Brazilian Portuguese translation" +msgstr "Бразильський португальський переклад" + +#: smb4k/main.cpp:80 +msgid "Ukrainian translation" +msgstr "Український переклад" + +#: smb4k/main.cpp:81 +msgid "Hungarian translation" +msgstr "Угорський переклад" + +#: smb4k/main.cpp:82 smb4k/main.cpp:90 +msgid "Spanish translation" +msgstr "Іспанський переклад" + +#: smb4k/main.cpp:83 +msgid "Slovak translation" +msgstr "Словацький переклад" + +#: smb4k/main.cpp:84 +msgid "French translation" +msgstr "Французький переклад" + +#: smb4k/main.cpp:85 +msgid "Japanese translation" +msgstr "Японський переклад" + +#: smb4k/main.cpp:86 +msgid "Bulgarian translation" +msgstr "Болгарський переклад" + +#: smb4k/main.cpp:87 +msgid "Italian translation" +msgstr "Італійський переклад" + +#: smb4k/main.cpp:88 +msgid "Norwegian translations" +msgstr "Норвезький переклад" + +#: smb4k/main.cpp:89 +msgid "Czech translation" +msgstr "Чеський переклад" + +#: smb4k/main.cpp:91 smb4k/main.cpp:97 +msgid "Turkish translation" +msgstr "Турецький переклад" + +#: smb4k/main.cpp:92 smb4k/main.cpp:98 +msgid "Chinese Traditional translation" +msgstr "Традиційний китайський переклад" + +#: smb4k/main.cpp:93 +msgid "Icelandic translation" +msgstr "Ісландський переклад" + +#: smb4k/main.cpp:94 +msgid "Danish translation" +msgstr "Датський переклад" + +#: smb4k/main.cpp:95 +msgid "Dutch translation" +msgstr "Нідерландський переклад" + +#: smb4k/main.cpp:99 +msgid "Testing of Smb4K under FreeBSD" +msgstr "Тестування Smb4K на FreeBSD" + +#: smb4k/main.cpp:129 +msgid "" +"Smb4K now uses a different configuration system. Thus, your old settings are " +"obsolete and you have to reconfigure the application.\n" +"To assure a clean transition, the current configuration file will be removed." +msgstr "" + +#: smb4k/iconview/smb4ksharesiconview_part.cpp:549 +msgid "Smb4KSharesIconViewPart" +msgstr "Smb4KSharesIconViewPart" + +#. i18n: file ./smb4k/smb4k_shell.rc line 7 +#. i18n: file ./smb4k/browser/smb4knetworkbrowser_part.rc line 4 +#: rc.cpp:6 rc.cpp:27 +#, no-c-format +msgid "&Network" +msgstr "&Мережа" + +#. i18n: file ./smb4k/smb4k_shell.rc line 9 +#: rc.cpp:9 +#, no-c-format +msgid "Sh&ares" +msgstr "&Спільні ресурси" + +#. i18n: file ./smb4k/smb4k_shell.rc line 27 +#: rc.cpp:18 +#, no-c-format +msgid "Network ToolBar" +msgstr "Пенал мережі" + +#. i18n: file ./smb4k/smb4k_shell.rc line 29 +#: rc.cpp:21 +#, no-c-format +msgid "Shares View ToolBar" +msgstr "Пенал перегляду спільних ресурсів" + +#. i18n: file ./smb4k/smb4k_shell.rc line 31 +#: rc.cpp:24 +#, no-c-format +msgid "Main ToolBar" +msgstr "Головний пенал" + +#. i18n: file ./smb4k/listview/smb4kshareslistview_part.rc line 4 +#. i18n: file ./smb4k/iconview/smb4ksharesiconview_part.rc line 4 +#: rc.cpp:30 rc.cpp:33 +#, no-c-format +msgid "&Shares" +msgstr "&Спільні ресурси" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Іван Петрущак" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "ivanpetrouchtchak@yahoo.com" + +#: plugin/smb4k_konqplugin.cpp:70 +msgid "Scan Network" +msgstr "Сканувати мережу" + +#: plugin/smb4k_konqplugin.cpp:122 +msgid "Samba Browser" +msgstr "Навігатор Samba" + +#~ msgid "Network neighborhood" +#~ msgstr "Мережне оточення" diff --git a/smb4k.kdevelop b/smb4k.kdevelop new file mode 100644 index 0000000..ca216d8 --- /dev/null +++ b/smb4k.kdevelop @@ -0,0 +1,274 @@ + + + + Alexander Reinholdt + dustpuppy@users.berlios.de + KDevKDEAutoProject + C++ + + KDE + Qt + + . + false + CVS_HEAD + + + + kdevcvsservice + smb4k + + + + + smb4k + default + smb4k/widgets/print/libprint.a + + + + + + false + 1 + false + + + + + + 0 + + + + \s-O0 -g3 -Wall + + + executable + / + smb4k/smb4k + + false + true + + + + + + + + + + + + /home/alex/Entwicklung/smb4k_head/./ + + + + + --enable-debug=full + + + + + kdevgccoptions + kdevgppoptions + kdevpgf77options + + + + + + + + + + + + + + + + + + + false + false + + + + false + false + + + + + gtk + gnustep + python + php + perl + + + api-docs/html/ + api-docs/html/ + + + + + + + + + libtool + + + + + + true + false + false + false + + + false + true + 10 + + + + -f + + + + -dP + -f + -C -d -P + -u3 -p + + + + + + true + true + true + false + true + true + true + 250 + 400 + 250 + false + 0 + true + true + false + std=_GLIBCXX_STD;__gnu_cxx=std + true + false + false + false + true + true + true + false + .; + false + false + + + + set + m_,_ + theValue + true + true + + + false + 3 + /usr/share/qt3 + 3 + EmbeddedKDevDesigner + /usr/bin/qmake-qt3 + /usr/bin/designer + + + + false + true + Vertical + + + + + + A new empty header file for C or C++. + + + A new empty C++ file. + + + + + + + .h + .cpp + + + + true + false + + smb4k + 0.4.0cvs + + + + + + + + + false + false + false + 0 + false + false + false + false + + + + true + true + true + true + -C + + + + + + /home/alex/Entwicklung/smb4k_head/smb4k-api + + + + + + + + VisualBoyAdvance + + + false + false + -f0 + -1 + + diff --git a/smb4k.kdevelop.pcs b/smb4k.kdevelop.pcs new file mode 100644 index 0000000..bbffccb Binary files /dev/null and b/smb4k.kdevelop.pcs differ diff --git a/smb4k.kdevses b/smb4k.kdevses new file mode 100644 index 0000000..9145cd1 --- /dev/null +++ b/smb4k.kdevses @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smb4k.lsm b/smb4k.lsm new file mode 100644 index 0000000..1682d86 --- /dev/null +++ b/smb4k.lsm @@ -0,0 +1,14 @@ +Begin3 +Title: Smb4K +Version: 0.1.1 +Entered-date: +Description: +Keywords: +Author: Alexander Reinholdt +Maintained-by: Alexander Reinholdt +Primary-site: +Home-page: http://smb4k.berlios.de +Original-site: +Platforms: Linux and other Unices +Copying-policy: GNU Public License +End diff --git a/smb4k/Makefile.am b/smb4k/Makefile.am new file mode 100644 index 0000000..792b035 --- /dev/null +++ b/smb4k/Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +SUBDIRS = icons core configdlg dialogs browser iconview listview searchdlg + +# Main program +bin_PROGRAMS = smb4k + +smb4k_SOURCES = main.cpp smb4k.cpp smb4ksystemtray.cpp +smb4k_LDADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(top_builddir)/smb4k/dialogs/libsmb4kdialogs.la $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_KPARTS) $(LIB_QT) +smb4k_LDFLAGS = $(all_libraries) $(KDE_RPATH) + + +KDE_ICON = smb4k + +xdg_apps_DATA = smb4k.desktop + +rcdir = $(kde_datadir)/smb4k +rc_DATA = smb4k_shell.rc + +noinst_HEADERS = smb4ksystemtray.h diff --git a/smb4k/browser/Makefile.am b/smb4k/browser/Makefile.am new file mode 100644 index 0000000..1e0d279 --- /dev/null +++ b/smb4k/browser/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO +kde_module_LTLIBRARIES = libsmb4knetworkbrowser.la +noinst_HEADERS = smb4knetworkbrowser_part.h smb4knetworkbrowser.h \ + smb4knetworkbrowseritem.h smb4knetworkbrowsertooltip.h +libsmb4knetworkbrowser_la_SOURCES = smb4knetworkbrowser_part.cpp \ + smb4knetworkbrowser.cpp smb4knetworkbrowseritem.cpp \ + smb4knetworkbrowsertooltip.cpp +libsmb4knetworkbrowser_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(top_builddir)/smb4k/dialogs/libsmb4kdialogs.la $(LIB_KDECORE) \ + $(LIB_KDEUI) $(KDE_PLUGIN) $(LIB_KPARTS) $(LIB_QT) +libsmb4knetworkbrowser_la_LDFLAGS = -module -no-undefined $(all_libraries) + +partrcdir = $(kde_datadir)/smb4knetworkbrowserpart +partrc_DATA = smb4knetworkbrowser_part.rc diff --git a/smb4k/browser/smb4knetworkbrowser.cpp b/smb4k/browser/smb4knetworkbrowser.cpp new file mode 100644 index 0000000..67c7b87 --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowser.cpp @@ -0,0 +1,211 @@ +/*************************************************************************** + smb4knetworkbrowser - The network browser widget of Smb4K. + ------------------- + begin : Mo Jan 8 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include + +// application specific includes +#include "smb4knetworkbrowser.h" +#include "smb4knetworkbrowseritem.h" +#include "smb4knetworkbrowsertooltip.h" +#include "../core/smb4ksettings.h" + + +Smb4KNetworkBrowser::Smb4KNetworkBrowser( QWidget *parent, const char *name ) +: KListView( parent, name ) +{ + setRootIsDecorated( true ); + setAllColumnsShowFocus( false ); + setMouseTracking( true ); + + m_tooltip = NULL; + m_block_tooltip = false; + + addColumn( i18n( "Network" ), -1 ); + addColumn( i18n( "Type" ), -1 ); + addColumn( i18n( "IP Address" ), -1 ); + addColumn( i18n( "Comment" ), -1 ); + + // Add some connections: + connect( this, SIGNAL( expanded( QListViewItem * ) ), + this, SLOT( slotItemExpandedCollapsed( QListViewItem * ) ) ); + + connect( this, SIGNAL( collapsed( QListViewItem * ) ), + this, SLOT( slotItemExpandedCollapsed( QListViewItem * ) ) ); + + connect( this, SIGNAL( executed( QListViewItem * ) ), + this, SLOT( slotItemExecuted( QListViewItem * ) ) ); +} + + +Smb4KNetworkBrowser::~Smb4KNetworkBrowser() +{ +} + + +void Smb4KNetworkBrowser::blockToolTips( bool block ) +{ + if ( block ) + { + delete m_tooltip; + m_tooltip = NULL; + } + + m_block_tooltip = block; +} + + +void Smb4KNetworkBrowser::contentsMouseMoveEvent( QMouseEvent *e ) +{ + // Store the *global* position of the mouse: + m_pos = e->globalPos(); + + // Find the item over which the user moved the mouse: + Smb4KNetworkBrowserItem *item = static_cast( itemAt( viewport()->mapFromGlobal( m_pos ) ) ); + + if ( item ) + { + // Check if we are on the root decoration: + bool on_root = true; + + if ( viewport()->mapFromGlobal( m_pos ).x() > header()->sectionPos( header()->mapToIndex( 0 ) ) + + treeStepSize() * ( item->depth() + ( rootIsDecorated() ? 1 : 0 ) ) + itemMargin() || + viewport()->mapFromGlobal( m_pos ).x() < header()->sectionPos( header()->mapToIndex( 0 ) ) ) + { + on_root = false; + } + + if ( !on_root ) + { + if ( m_tooltip ) + { + if ( m_tooltip->item() != item ) + { + delete m_tooltip; + + if ( !m_block_tooltip && hasMouse() && isExecuteArea( viewport()->mapFromGlobal( m_pos ) ) && + Smb4KSettings::showNetworkItemToolTip() ) + { + m_tooltip = new Smb4KNetworkBrowserToolTip( item ); + + QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) ); + } + else + { + m_tooltip = NULL; + } + } + else + { + // Do nothing + } + } + else + { + if ( !m_block_tooltip && hasMouse() && isExecuteArea( viewport()->mapFromGlobal( m_pos ) ) && + Smb4KSettings::showNetworkItemToolTip() ) + { + m_tooltip = new Smb4KNetworkBrowserToolTip( item ); + + QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) ); + } + else + { + // Do nothing + } + } + } + else + { + delete m_tooltip; + m_tooltip = NULL; + } + } + else + { + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + } + + KListView::contentsMouseMoveEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KNetworkBrowser::slotItemExpandedCollapsed( QListViewItem *item ) +{ + // Explicitly select the item, because this won't be + // done if the user clicked on the root decoration. + + setSelected( item, true ); +} + + +void Smb4KNetworkBrowser::slotItemExecuted( QListViewItem *item ) +{ + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + + if ( item && item->isExpandable() ) + { + setOpen( item, !item->isOpen() ); + } +} + + +void Smb4KNetworkBrowser::slotShowToolTip() +{ + Smb4KNetworkBrowserItem *item = static_cast( itemAt( viewport()->mapFromGlobal( m_pos ) ) ); + + if ( !m_block_tooltip && m_tooltip && hasMouse() && + isExecuteArea( viewport()->mapFromGlobal( m_pos ) ) && + Smb4KSettings::showNetworkItemToolTip() && + (m_tooltip->item() == item) ) + { + emit aboutToShowToolTip( item ); + + m_tooltip->showTip( m_pos ); + } + else + { + delete m_tooltip; + m_tooltip = NULL; + } +} + +#include "smb4knetworkbrowser.moc" diff --git a/smb4k/browser/smb4knetworkbrowser.h b/smb4k/browser/smb4knetworkbrowser.h new file mode 100644 index 0000000..ade9e64 --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowser.h @@ -0,0 +1,153 @@ +/*************************************************************************** + smb4knetworkbrowser - The network browser widget of Smb4K. + ------------------- + begin : Mo Jan 8 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KNETWORKBROWSER_H +#define SMB4KNETWORKBROWSER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include + +// forward declarations +class Smb4KNetworkBrowserItem; +class Smb4KNetworkBrowserToolTip; + +class Smb4KNetworkBrowser : public KListView +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent widget + * + * @param name The widget name + */ + Smb4KNetworkBrowser( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KNetworkBrowser(); + + /** + * Enumeration for the columns in the list view. + */ + enum Columns{ Network = 0, Type = 1, IP = 2, Comment = 3 }; + + /** + * Returns the global position of the mouse with respect + * to the viewport. + * + * @returns the position of the mouse. + */ + const QPoint &mousePosition() { return m_pos; } + + /** + * Returns a pointer to the current tool tip or NULL, if there + * is no tool tip at the moment. Please note, that the tool tip + * is generated 2 sec before it is shown. + * + * @returns a pointer to the current tool tip. + */ + Smb4KNetworkBrowserToolTip *tooltip() { return m_tooltip; } + + /** + * Block the showing of tool tips. If @p block is set to TRUE, the + * current tool tip gets deleted (if there is one) and no tool tip + * will be shown until @p block is reset to FALSE. + * + * @param block Set this parameter to TRUE to block the showing + * of tool tips. + */ + void blockToolTips( bool block ); + + signals: + /** + * This signal is emitted when the tool tip is about to be shown. + * + * @param item The item for which the tool tip should be shown. + */ + void aboutToShowToolTip( Smb4KNetworkBrowserItem *item ); + + /** + * This signal is emitted when the tool tip has been closed. + */ + void closedToolTip(); + + protected: + /** + * Reimplemented from QListView. This slot keeps track of the + * mouse position and handles the tool tips. + * + * @param e The mouse event + */ + void contentsMouseMoveEvent( QMouseEvent *e ); + + protected slots: + /** + * This slot is called whenever a QListViewItem is expanded or + * collapsed. At the moment it is only used to select the item. + * + * @param item The list view item that has been + * expanded/collapsed. + */ + void slotItemExpandedCollapsed( QListViewItem *item ); + + /** + * This slot is called when the user executed an item. It is used + * to open the item if it is expandable. + * + * @param item The item that has been executed. + */ + void slotItemExecuted( QListViewItem *item ); + + /** + * This slot shows the tool tip. + */ + void slotShowToolTip(); + + private: + /** + * The global position of the mouse with respect to the widget. + */ + QPoint m_pos; + + /** + * The tool tip for the network browser + */ + Smb4KNetworkBrowserToolTip *m_tooltip; + + /** + * Block tool tips + */ + bool m_block_tooltip; +}; + +#endif diff --git a/smb4k/browser/smb4knetworkbrowser_part.cpp b/smb4k/browser/smb4knetworkbrowser_part.cpp new file mode 100644 index 0000000..2773872 --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowser_part.cpp @@ -0,0 +1,1929 @@ +/*************************************************************************** + smb4knetworkbrowser_part - This Part encapsulates the network + browser of Smb4K. + ------------------- + begin : Fr Jan 5 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4knetworkbrowser_part.h" +#include "smb4knetworkbrowser.h" +#include "smb4knetworkbrowseritem.h" +#include "smb4knetworkbrowsertooltip.h" +#include "../dialogs/smb4kcustomoptionsdialog.h" +#include "../dialogs/smb4kmountdialog.h" +#include "../dialogs/smb4kprintdialog.h" +#include "../dialogs/smb4kpreviewdialog.h" +#include "../core/smb4kcore.h" +#include "../core/smb4knetworkitems.h" +#include "../core/smb4kshare.h" +#include "../core/smb4kglobal.h" +#include "../core/smb4kpasswordhandler.h" +#include "../core/smb4ksettings.h" +#include "../core/smb4kbookmark.h" +#include "../core/smb4kdefs.h" + +using namespace Smb4KGlobal; + +KInstance *Smb4KNetworkBrowserPartFactory::m_instance = 0L; +KAboutData *Smb4KNetworkBrowserPartFactory::m_about = 0L; + + +Smb4KNetworkBrowserPart::Smb4KNetworkBrowserPart( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, Mode mode ) +: KParts::Part( parent, name ), m_mode( mode ) +{ + // First of all we need an instance: + setInstance( Smb4KNetworkBrowserPartFactory::instance() ); + + // Set the XML file: + setXMLFile( "smb4knetworkbrowser_part.rc" ); + + // Set the widget of this part: + m_widget = new Smb4KNetworkBrowser( parentWidget, widgetName ); + setWidget( m_widget ); + + // Set up the actions. + // Do not put this before setWidget() or the shortcuts of the + // actions will not be shown. + setupActions(); + + // Load the settings + loadSettings(); + + // Add some connections: + connect( m_widget, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint & , int ) ), + this, SLOT( slotContextMenuRequested( QListViewItem *, const QPoint &, int ) ) ); + + connect( m_widget, SIGNAL( selectionChanged( QListViewItem * ) ), + this, SLOT( slotSelectionChanged( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( pressed( QListViewItem * ) ), + this, SLOT( slotPressed( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( expanded( QListViewItem * ) ), + this, SLOT( slotItemExpanded( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( collapsed( QListViewItem * ) ), + this, SLOT( slotItemCollapsed( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( executed( QListViewItem * ) ), + this, SLOT( slotItemExecuted( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( aboutToShowToolTip( Smb4KNetworkBrowserItem * ) ), + this, SLOT( slotAboutToShowToolTip( Smb4KNetworkBrowserItem * ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( workgroups( const QValueList & ) ), + this, SLOT( slotWorkgroups( const QValueList & ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( members( const QString &, const QValueList & ) ), + this, SLOT( slotWorkgroupMembers( const QString &, const QValueList & ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( shares( const QString &, const QValueList & ) ), + this, SLOT( slotShares( const QString &, const QValueList & ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( ipAddress( Smb4KHostItem * ) ), + this, SLOT( slotAddIPAddress( Smb4KHostItem * ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( info( Smb4KHostItem * ) ), + this, SLOT( slotAddInformation( Smb4KHostItem * ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( hostAdded( Smb4KHostItem * ) ), + this, SLOT( slotInsertHost( Smb4KHostItem * ) ) ); + + connect( Smb4KCore::mounter(), SIGNAL( updated() ), + this, SLOT( slotMarkMountedShares() ) ); + + connect( Smb4KCore::self(), SIGNAL( runStateChanged() ), + this, SLOT( slotRunStateChanged() ) ); +} + + +Smb4KNetworkBrowserPart::~Smb4KNetworkBrowserPart() +{ +} + + +void Smb4KNetworkBrowserPart::setupActions() +{ + KAction *rescan = new KAction( i18n( "Scan Netwo&rk" ), "reload", KShortcut( CTRL+Key_R ), + this, SLOT( slotRescan() ), + actionCollection(), "rescan_action" ); + KAction *abort = new KAction( i18n( "&Abort" ) , "stop", KShortcut( CTRL+Key_A ), + this, SLOT( slotAbort() ), + actionCollection(), "abort_action" ); + KActionSeparator *sep1 = new KActionSeparator( actionCollection(), + "separator_1" ); + KAction *manual_mount = new KAction( i18n( "M&ount Manually" ), "connect_creating", KShortcut( CTRL+Key_O ), + this, SLOT( slotMountManually() ), + actionCollection(), "mount_manually_action" ); + KActionSeparator *sep2 = new KActionSeparator( actionCollection(), + "separator_2" ); + KAction *auth = new KAction( i18n( "Au&thentication" ), "identity", KShortcut( CTRL+Key_T ), + this, SLOT( slotAuthentication() ), + actionCollection(), "askpass_action" ); + KAction *custom = new KAction( i18n( "&Custom Options" ), "samba", KShortcut( CTRL+Key_C ), + this, SLOT( slotCustomOptions() ), + actionCollection(), "custom_action" ); + KAction *bookmark = new KAction( i18n( "Add &Bookmark" ), "bookmark_add", KShortcut( CTRL+Key_B ), + this, SLOT( slotBookmark() ), + actionCollection(), "bookmark_action" ); + KAction *preview = new KAction( i18n( "Pre&view" ), "view_icon", KShortcut( CTRL+Key_V ), + this, SLOT( slotPreview() ), + actionCollection(), "preview_action" ); + KAction *print = new KAction( i18n( "&Print File" ), "printer1", KShortcut( CTRL+Key_P ), + this, SLOT( slotPrint() ), + actionCollection(), "print_action" ); + KAction *mount = new KAction( i18n( "&Mount" ), "hdd_mount", KShortcut( CTRL+Key_M ), + this, SLOT( slotMount() ), + actionCollection(), "mount_action" ); + + // Enable/disable the actions: + rescan->setEnabled( true ); + abort->setEnabled( false ); + manual_mount->setEnabled( true ); + auth->setEnabled( false ); + custom->setEnabled( false ); + bookmark->setEnabled( false ); + preview->setEnabled( false ); + print->setEnabled( false ); + mount->setEnabled( false ); + + // Plug the actions into the action menu: + m_menu = new KActionMenu( this, "NetworkActionMenu" ); + m_menu->popupMenu()->insertTitle( SmallIcon( "network" ), i18n( "Network" ), 0 ); + m_menu->insert( rescan, 1 ); + m_menu->insert( abort, 2 ); + m_menu->insert( sep1, 3 ); + m_menu->insert( manual_mount, 4 ); + m_menu->insert( sep2, 5 ); + m_menu->insert( auth, 6 ); + m_menu->insert( custom, 7 ); + m_menu->insert( bookmark, 8 ); + m_menu->insert( preview, 9 ); + m_menu->insert( print, 10 ); + m_menu->insert( mount, 11 ); + + // If we are in Konqueror plugin mode, an unmount action + // is also needed: + if ( m_mode == KonqPlugin ) + { + KAction *unmount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut( CTRL+Key_U ), + this, SLOT( slotUnmount() ), + actionCollection(), "konq_umount_action" ); + + unmount->setEnabled( false ); + } +} + + +void Smb4KNetworkBrowserPart::loadSettings() +{ + // Show/hide columns: + if ( Smb4KSettings::showIPAddress() ) + { + m_widget->setColumnWidth( Smb4KNetworkBrowser::IP, 10 ); + m_widget->setColumnWidthMode( Smb4KNetworkBrowser::IP, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KNetworkBrowser::IP ); + } + else + { + m_widget->setColumnWidth( Smb4KNetworkBrowser::IP, 0 ); + m_widget->setColumnWidthMode( Smb4KNetworkBrowser::IP, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KNetworkBrowser::IP ); + } + + if ( Smb4KSettings::showType() ) + { + m_widget->setColumnWidth( Smb4KNetworkBrowser::Type, 10 ); + m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Type, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KNetworkBrowser::Type ); + } + else + { + m_widget->setColumnWidth( Smb4KNetworkBrowser::Type, 0 ); + m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Type, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KNetworkBrowser::Type ); + } + + if ( Smb4KSettings::showComment() ) + { + m_widget->setColumnWidth( Smb4KNetworkBrowser::Comment, 10 ); + m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Comment, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KNetworkBrowser::Comment ); + } + else + { + m_widget->setColumnWidth( Smb4KNetworkBrowser::Comment, 0 ); + m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Comment, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KNetworkBrowser::Comment ); + } + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } + + // The rest of the settings will be applied on the fly. +} + + +void Smb4KNetworkBrowserPart::customEvent( QCustomEvent *e ) +{ + switch ( e->type() ) + { + case EVENT_LOAD_SETTINGS: + { + loadSettings(); + + break; + } + case EVENT_SET_FOCUS: + { + KListView *view = static_cast( m_widget ); + + if ( view->childCount() != 0 ) + { + view->setSelected( !view->currentItem() ? + view->firstChild() : + view->currentItem(), true ); + } + + view->setFocus(); + + break; + } + case EVENT_SCAN_NETWORK: + { + slotRescan(); + + break; + } + default: + { + break; + } + } + + KParts::Part::customEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS (Smb4KNetworkBrowserPart) +///////////////////////////////////////////////////////////////////////////// + +void Smb4KNetworkBrowserPart::slotContextMenuRequested( QListViewItem *item, const QPoint &pos, + int /* column */ ) +{ + m_widget->blockToolTips( true ); + + if ( !item ) + { + m_menu->popupMenu()->changeTitle( 0, SmallIcon( "network" ), i18n( "Network" ) ); + } + else + { + m_menu->popupMenu()->changeTitle( 0, *(item->pixmap( 0 )), item->text( 0 ) ); + } + + m_menu->popupMenu()->exec( pos, 0 ); + + m_widget->blockToolTips( false ); +} + + +void Smb4KNetworkBrowserPart::slotSelectionChanged( QListViewItem *item ) +{ + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + if ( browser_item ) + { + switch ( m_mode ) + { + case Normal: + { + if ( browser_item->type() == Smb4KNetworkBrowserItem::Share ) + { + // Change the text of the rescan action: + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Compute&r" ) ); + + // Enable/disable the actions: + actionCollection()->action( "askpass_action" )->setEnabled( true ); + + if ( !browser_item->isPrinter() ) + { + actionCollection()->action( "bookmark_action" )->setEnabled( true ); + actionCollection()->action( "preview_action" )->setEnabled( true ); + actionCollection()->action( "mount_action" )->setEnabled( true ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( true ); + } + else + { + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( true ); + actionCollection()->action( "custom_action" )->setEnabled( false ); + } + } + else if ( browser_item->type() == Smb4KNetworkBrowserItem::Host ) + { + // Change the text of the rescan action: + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Compute&r" ) ); + + // Enable/disable the actions: + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "askpass_action" )->setEnabled( true ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( true ); + } + else + { + // Change the text of the rescan action: + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Wo&rkgroup" ) ); + + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "askpass_action" )->setEnabled( false ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( false ); + } + + break; + } + case KonqPlugin: + { + if ( browser_item->type() == Smb4KNetworkBrowserItem::Share ) + { + // Change the text of the rescan action: + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Compute&r" ) ); + + // Enable/disable the actions: + actionCollection()->action( "askpass_action" )->setEnabled( true ); + + if ( !browser_item->isPrinter() ) + { + actionCollection()->action( "bookmark_action" )->setEnabled( true ); + actionCollection()->action( "preview_action" )->setEnabled( true ); + actionCollection()->action( "mount_action" )->setEnabled( true ); + actionCollection()->action( "konq_umount_action" )->setEnabled( true ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( true ); + + if ( !browser_item->isMounted() ) + { + if ( actionCollection()->action( "konq_umount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "konq_umount_action" ) ); + m_menu->insert( actionCollection()->action( "mount_action" ), 11 ); + } + else + { + // Nothing to do + } + } + else + { + if ( actionCollection()->action( "mount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "mount_action" ) ); + m_menu->insert( actionCollection()->action( "konq_umount_action" ), 11 ); + } + else + { + // Nothing to do + } + } + } + else + { + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "konq_umount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( true ); + actionCollection()->action( "custom_action" )->setEnabled( false ); + + if ( actionCollection()->action( "konq_umount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "konq_umount_action" ) ); + m_menu->insert( actionCollection()->action( "mount_action" ), 11 ); + } + else + { + // Nothing to do + } + } + } + else if ( browser_item->type() == Smb4KNetworkBrowserItem::Host ) + { + // Change the text of the rescan action: + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Compute&r" ) ); + + // Enable/disable the actions: + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "askpass_action" )->setEnabled( true ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "konq_umount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( true ); + + if ( actionCollection()->action( "konq_umount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "konq_umount_action" ) ); + m_menu->insert( actionCollection()->action( "mount_action" ), 11 ); + } + else + { + // Nothing to do + } + } + else + { + // Change the text of the rescan action: + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Wo&rkgroup" ) ); + + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "askpass_action" )->setEnabled( false ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "konq_umount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( false ); + + if ( actionCollection()->action( "konq_umount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "konq_umount_action" ) ); + m_menu->insert( actionCollection()->action( "mount_action" ), 11 ); + } + else + { + // Nothing to do + } + } + + break; + } + default: + { + break; + } + } + } + else + { + // See Smb4KNetworkBrowserPart::slotPressed() + } +} + + +void Smb4KNetworkBrowserPart::slotPressed( QListViewItem *item ) +{ + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + switch ( m_mode ) + { + case Normal: + { + if ( !browser_item && !m_widget->selectedItem() ) + { + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Netwo&rk" ) ); + + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "askpass_action" )->setEnabled( false ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( false ); + } + else + { + // See Smb4KNetworkBrowserPart::slotSelectionChanged() + } + + break; + } + case KonqPlugin: + { + if ( !browser_item && !m_widget->selectedItem() ) + { + actionCollection()->action( "rescan_action" )->setText( i18n( "Scan Netwo&rk" ) ); + + actionCollection()->action( "bookmark_action" )->setEnabled( false ); + actionCollection()->action( "askpass_action" )->setEnabled( false ); + actionCollection()->action( "preview_action" )->setEnabled( false ); + actionCollection()->action( "mount_action" )->setEnabled( false ); + actionCollection()->action( "konq_umount_action" )->setEnabled( false ); + actionCollection()->action( "print_action" )->setEnabled( false ); + actionCollection()->action( "custom_action" )->setEnabled( false ); + + if ( actionCollection()->action( "konq_umount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "konq_umount_action" ) ); + m_menu->insert( actionCollection()->action( "mount_action" ), 11 ); + } + else + { + // Nothing to do + } + } + else + { + // See Smb4KNetworkBrowserPart::slotSelectionChanged() + } + + break; + } + default: + { + break; + } + } +} + + +void Smb4KNetworkBrowserPart::slotItemExpanded( QListViewItem *item ) +{ + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + if ( browser_item ) + { + switch ( browser_item->type() ) + { + case Smb4KNetworkBrowserItem::Workgroup: + { + Smb4KWorkgroupItem *i = browser_item->workgroupItem(); + Smb4KCore::scanner()->getWorkgroupMembers( i->name(), i->master(), i->masterIP() ); + break; + } + case Smb4KNetworkBrowserItem::Host: + { + Smb4KHostItem *i = browser_item->hostItem(); + Smb4KCore::scanner()->getShares( i->workgroup(), i->name(), i->ip() ); + break; + } + default: + break; + } + } + else + { + // Do nothing + } +} + + +void Smb4KNetworkBrowserPart::slotItemCollapsed( QListViewItem *item ) +{ + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + // Remove all children if we have a host item, because we + // do not want shares already displayed before the user provided + // the login data. + if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Host ) + { + while ( browser_item->childCount() != 0 ) + { + delete browser_item->firstChild(); + } + } + else + { + // Do nothing + } +} + + +void Smb4KNetworkBrowserPart::slotItemExecuted( QListViewItem *item ) +{ + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Share ) + { + if ( !browser_item->isPrinter() ) + { + slotMount(); + } + else + { + slotPrint(); + } + } +} + + +void Smb4KNetworkBrowserPart::slotAboutToShowToolTip( Smb4KNetworkBrowserItem *browser_item ) +{ + if ( browser_item ) + { + switch ( browser_item->type() ) + { + case Smb4KNetworkBrowserItem::Workgroup: + { + break; + } + case Smb4KNetworkBrowserItem::Host: + { + // Check if additional information is needed and send a request to the scanner, + // if necessary. + if ( !browser_item->hostItem()->infoChecked() ) + { + Smb4KCore::scanner()->getInfo( browser_item->hostItem()->workgroup(), + browser_item->hostItem()->name(), + browser_item->hostItem()->ip() ); + } + else + { + // Do nothing + } + + break; + } + case Smb4KNetworkBrowserItem::Share: + { + break; + } + default: + { + break; + } + } + } + else + { + // Do nothing --- BTW: Will this case occur at all? + } +} + + +void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList &list ) +{ + if ( !list.isEmpty() ) + { + // Check if the workgroups in the list view are still + // valid. Remove obsolete ones and add new ones. + + if ( m_widget->childCount() > 0 ) + { + QListViewItemIterator it( m_widget ); + + while ( it.current() ) + { + Smb4KNetworkBrowserItem *item = static_cast( it.current() ); + + // We only want to check workgroup items: + if ( item->type() == Smb4KNetworkBrowserItem::Workgroup ) + { + QValueList::ConstIterator i; + + for ( i = list.begin(); i != list.end(); ++i ) + { + if ( QString::compare( item->workgroupItem()->name(), (*i)->name() ) == 0 ) + { + QString old_master = item->workgroupItem()->master(); + + // Found the workgroup item in the new list. Update it and stop here. + item->update( *i ); + + // We update the master as well, if it changed and the workgroup item is open. + // In the case the item is closed, Smb4KScanner::getWorkgroupMembers() will be + // called by setOpen() and an update will be done by slotWorkgroupMembers(). + if ( QString::compare( old_master, (*i)->master() ) != 0 && item->isOpen() ) + { + // Get the list view items: + Smb4KNetworkBrowserItem *oldMasterItem = static_cast( m_widget->findItem( old_master, Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) ); + Smb4KNetworkBrowserItem *newMasterItem = static_cast( m_widget->findItem( (*i)->master(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) ); + + // Get the host item of the new master from the scanner. The old master + // has been removed from the internal host list, so we cannot search for + // it! + Smb4KHostItem *newMaster = Smb4KCore::scanner()->getHost( (*i)->master(), (*i)->name() ); + + if ( oldMasterItem ) + { + // The old master item is still present, so update and tell it + // that it is no master anymore. + // NOTE: We cannot decide here whether the old master has + // to be removed because it vanished from the network. This + // has to be done by slotWorkgroupMembers()! + oldMasterItem->hostItem()->setMaster( false ); + } + else + { + // Huh? It vanished...? + } + + if ( newMasterItem ) + { + // Tell the list view item that it is the new master. + // Note: Do not use Smb4KNetworkBrowserItem::update() here, + // because this will remove the comment and maybe also the + // IP address (depending on the lookup method the user chose). + // The update will be done by insertWorkgroupMembers(). + newMasterItem->hostItem()->setMaster( true ); + } + else + { + // We do not need to check if newMaster is NULL, because it won't be. + Smb4KNetworkBrowserItem *master = new Smb4KNetworkBrowserItem( item, newMaster ); + master->setExpandable( true ); + } + } + + break; + } + else + { + // Is the list entry in the list view? If not, add it to the list + // view. (If it is, it will be found and updated by the code above.) + if ( m_widget->findItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 ) + { + Smb4KNetworkBrowserItem *workgroup = new Smb4KNetworkBrowserItem( m_widget, *i ); + workgroup->setExpandable( true ); + } + + continue; + } + } + + // The workgroup has vanished. Delete it from + // the list view: + if ( i == list.end() ) + { + delete item; + } + } + + ++it; + } + } + else + { + // Put the items in the empty list view: + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + Smb4KNetworkBrowserItem *workgroup = new Smb4KNetworkBrowserItem( m_widget, *it ); + workgroup->setExpandable( true ); + } + } + } + else + { + // Nothing was found: Clear the list view and + // adjust the columns: + m_widget->clear(); + } + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } +} + + +void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, const QValueList &list ) +{ + // Get the workgroup item: + Smb4KNetworkBrowserItem *workgroupItem = NULL; + + if ( !workgroup.isEmpty() ) + { + workgroupItem = static_cast( m_widget->findItem( workgroup, Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) ); + } + else + { + return; + } + + if ( workgroupItem ) + { + if ( !list.isEmpty() ) + { + // Check if the host items are still valid. Update + // them if they are and remove them if they are not: + if ( workgroupItem->childCount() > 0 ) + { + // Traverse though the hosts: + QListViewItemIterator it( m_widget ); + + while ( it.current() ) + { + Smb4KNetworkBrowserItem *item = static_cast( it.current() ); + + // We will only take action if we have a host item that belongs + // to the workgroup 'workgroup': + if ( item->type() == Smb4KNetworkBrowserItem::Host && + QString::compare( item->hostItem()->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 ) + { + QValueList::ConstIterator i; + + for ( i = list.begin(); i != list.end(); ++i ) + { + if ( QString::compare( item->hostItem()->name(), (*i)->name() ) == 0 ) + { + // The host is already in the workgroup. Update it: + item->update( *i ); + + break; + } + else + { + // Is the list entry in the workgroup? If not, add it to it. + // (If it is, it will be found and updated by the code above.) + // Also: In case the whole list of known hosts is emitted by the + // scanner, we need omit all entries that do not belong to this + // workgroup. + if ( QString::compare( (*i)->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 && + m_widget->findItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 ) + { + Smb4KNetworkBrowserItem *hostItem = new Smb4KNetworkBrowserItem( workgroupItem, *i ); + hostItem->setExpandable( true ); + } + + continue; + } + } + + // The host has vanished. Delete it from the + // workgroup: + if ( i == list.end() ) + { + delete item; + } + } + + ++it; + } + } + else + { + // Add the children to the childless host item: + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + // In case the whole list of known hosts is emitted by the scanner, + // we need omit all entries that do not belong to this workgroup. + if ( QString::compare( (*it)->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 ) + { + Smb4KNetworkBrowserItem *hostItem = new Smb4KNetworkBrowserItem( workgroupItem, *it ); + hostItem->setExpandable( true ); + + continue; + } + else + { + continue; + } + } + } + } + else + { + // Close the item: + m_widget->setOpen( workgroupItem, false ); + + // Delete all host items in this workgroup: + QListViewItem *child = workgroupItem->firstChild(); + + while ( child ) + { + delete child; + child = workgroupItem->firstChild(); + } + } + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } + } + else + { + // The workgroup item could not be found. So, do nothing. + } +} + + +void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList &list ) +{ + // Get the host item: + Smb4KNetworkBrowserItem *hostItem = NULL; + + if ( !host.isEmpty() ) + { + hostItem = static_cast( m_widget->findItem( host, Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) ); + } + else + { + return; + } + + if ( hostItem ) + { + if ( !list.isEmpty() ) + { + // Expand the host item, if it is collapsed: + if ( !hostItem->isOpen() ) + { + m_widget->setOpen( hostItem, true ); + } + + if ( hostItem->childCount() > 0 ) + { + QListViewItemIterator it( m_widget ); + + while( it.current() ) + { + Smb4KNetworkBrowserItem *item = static_cast( it.current() ); + + // We only take action, if the shares belong to hostItem: + if ( item->type() == Smb4KNetworkBrowserItem::Share && + QString::compare( item->shareItem()->host(), hostItem->hostItem()->name() ) == 0 ) + { + QValueList::ConstIterator i; + + for ( i = list.begin(); i != list.end(); ++i ) + { + if ( QString::compare( item->shareItem()->name(), (*i)->name() ) == 0 ) + { + // Found the share. Now process it: + if ( !item->shareItem()->isHidden() ) + { + if ( !item->shareItem()->isPrinter() ) + { + // There are no restrictions for this kind of + // share. Update it. + item->update( *i ); + } + else + { + // Does the user want to see printer shares + // or not? If not, delete the entry. + if ( !Smb4KSettings::showPrinterShares() ) + { + delete item; + } + else + { + item->update( *i ); + } + } + } + else + { + // Delete or update the item depending on the + // settings the user chose: + if ( !Smb4KSettings::showHiddenShares() ) + { + delete item; + } + else + { + // Can we have hidden printers? + if ( item->shareItem()->isPrinter() ) + { + if ( !Smb4KSettings::showPrinterShares() ) + { + delete item; + } + else + { + item->update( *i ); + } + + break; + } + + if ( item->shareItem()->isIPC() ) + { + if ( !Smb4KSettings::showHiddenIPCShares() ) + { + delete item; + } + else + { + item->update( *i ); + } + + break; + } + + if ( item->shareItem()->isADMIN() ) + { + if ( !Smb4KSettings::showHiddenADMINShares() ) + { + delete item; + } + else + { + item->update( *i ); + } + + break; + } + } + } + + break; + } + else + { + // Does the host carry the list entry? If not, add it to it. + // (If it is, it will be found and updated by the code above.) + if ( m_widget->findItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 ) + { + // Respect the settings the user chose to use: + if ( !(*i)->isHidden() ) + { + if ( !(*i)->isPrinter() || (Smb4KSettings::showPrinterShares() && (*i)->isPrinter()) ) + { + (void) new Smb4KNetworkBrowserItem( hostItem, *i ); + } + else + { + // This share won't make it into the list view. + } + + continue; + } + else + { + if ( Smb4KSettings::showHiddenShares() ) + { + if ( !(*i)->isIPC() && !(*i)->isADMIN() && !(*i)->isPrinter() ) + { + // The share is no IPC$ and no ADMIN$ share. Include it. + (void) new Smb4KNetworkBrowserItem( hostItem, *i ); + + continue; + } + else + { + if ( (Smb4KSettings::showHiddenIPCShares() && (*i)->isIPC()) || + (Smb4KSettings::showHiddenADMINShares() && (*i)->isADMIN()) || + (Smb4KSettings::showPrinterShares() && (*i)->isPrinter()) ) + { + // We are allowed to put the IPC$/ADMIN$ share in: + (void) new Smb4KNetworkBrowserItem( hostItem, *i ); + + continue; + } + else + { + // The user does not want to see this item. + + continue; + } + } + } + else + { + // This item won't be included. + + continue; + } + } + } + + continue; + } + } + + // The share has vanished. Delete it from the + // host item: + if ( i == list.end() ) + { + delete item; + } + } + + ++it; + } + } + else + { + // Add the children to the childless host item: + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + // Respect the settings the user chose to use: + if ( !(*it)->isHidden() ) + { + if ( !(*it)->isPrinter() || (Smb4KSettings::showPrinterShares() && (*it)->isPrinter()) ) + { + (void) new Smb4KNetworkBrowserItem( hostItem, *it ); + } + else + { + // This share won't make it into the list view. + } + + continue; + } + else + { + if ( Smb4KSettings::showHiddenShares() ) + { + if ( !(*it)->isIPC() && !(*it)->isADMIN() && !(*it)->isPrinter() ) + { + // The share is no IPC$ and no ADMIN$ share. Include it. + (void) new Smb4KNetworkBrowserItem( hostItem, *it ); + + continue; + } + else + { + if ( (Smb4KSettings::showHiddenIPCShares() && (*it)->isIPC()) || + (Smb4KSettings::showHiddenADMINShares() && (*it)->isADMIN()) || + (Smb4KSettings::showPrinterShares() && (*it)->isPrinter()) ) + { + // We are allowed to put the IPC$/ADMIN$ share in: + (void) new Smb4KNetworkBrowserItem( hostItem, *it ); + + continue; + } + else + { + // The user does not want to see this item. + + continue; + } + } + } + else + { + // This item won't be included. + + continue; + } + } + } + } + } + else + { + // Delete all shares of this host: + m_widget->setOpen( hostItem, false ); + + QListViewItem *child = hostItem->firstChild(); + + while ( child ) + { + delete child; + child = hostItem->firstChild(); + } + } + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } + } + else + { + // The host item could not be found. So, do nothing. + } +} + + +void Smb4KNetworkBrowserPart::slotAddIPAddress( Smb4KHostItem *item ) +{ + if ( item ) + { + // Get the workgroup item the server is a child of and update + // it. + Smb4KNetworkBrowserItem *workgroup_item = static_cast( m_widget->findItem( item->workgroup(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) ); + + if ( workgroup_item && QString::compare( workgroup_item->workgroupItem()->name(), item->workgroup() ) == 0 ) + { + Smb4KWorkgroupItem *workgroup = Smb4KCore::scanner()->getWorkgroup( item->workgroup() ); + + if ( workgroup ) + { + workgroup_item->update( workgroup ); + + if ( m_widget->tooltip() && m_widget->tooltip()->isShown() && + m_widget->tooltip()->item() == workgroup_item ) + { + m_widget->tooltip()->update(); + } + } + } + + Smb4KNetworkBrowserItem *host_item = static_cast( m_widget->findItem( item->name(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) ); + + if ( host_item && host_item->parent() && QString::compare( host_item->hostItem()->workgroup(), item->workgroup() ) == 0 ) + { + host_item->update( item ); + + if ( m_widget->tooltip() && m_widget->tooltip()->isShown() && + m_widget->tooltip()->item() == host_item ) + { + m_widget->tooltip()->update(); + } + + if ( m_widget->columnWidth( Smb4KNetworkBrowser::IP ) != 0 ) + { + m_widget->adjustColumn( Smb4KNetworkBrowser::IP ); + } + } + } +} + + +void Smb4KNetworkBrowserPart::slotAddInformation( Smb4KHostItem *item ) +{ + if ( item ) + { + Smb4KNetworkBrowserItem *browser_item = static_cast( m_widget->findItem( item->name(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) ); + + if ( browser_item ) + { + // First update the browser item, if appropriate: + if ( QString::compare( browser_item->hostItem()->workgroup(), item->workgroup() ) == 0 ) + { + browser_item->update( item ); + } + + // Now update the tool tip in case it is shown: + if ( m_widget->tooltip() && m_widget->tooltip()->isShown() && + m_widget->tooltip()->item() == browser_item ) + { + m_widget->tooltip()->update(); + } + } + else + { + // Do nothing + } + } +} + + +void Smb4KNetworkBrowserPart::slotInsertHost( Smb4KHostItem *item ) +{ + Smb4KNetworkBrowserItem *workgroup_item = NULL; + + // Stop here, if we received a NULL pointer. + if ( item ) + { + // Look up the workgroup: + workgroup_item = static_cast( m_widget->findItem( item->workgroup(), + Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) ); + } + else + { + return; + } + + if ( workgroup_item ) + { + // Check if the host item is already there. We traverse + // workgroup's children for that: + Smb4KNetworkBrowserItem *host_item = static_cast( workgroup_item->firstChild() ); + + while ( host_item ) + { + if ( QString::compare( host_item->text( Smb4KNetworkBrowser::Network ).upper(), + item->name().upper() ) == 0 ) + { + break; + } + + host_item = static_cast( host_item->nextSibling() ); + } + + + if ( !host_item || (host_item && host_item->parent() && + QString::compare( host_item->hostItem()->workgroup(), item->workgroup() ) != 0) ) + { + // The host is not there. Insert it. + // NOTE: The following procedure will not produce a leak. + host_item = new Smb4KNetworkBrowserItem( workgroup_item, item ); + host_item->setExpandable( true ); + } + else + { + // Do nothing + } + } + else + { + // No item has been found that matches the workgroup name. + // Add a workgroup item and make the host a child of it. + // Since Smb4KScanner::insertHost() adds also a workgroup + // item, we get the workgroup from the scanner: + Smb4KWorkgroupItem *workgroup = Smb4KCore::scanner()->getWorkgroup( item->workgroup() ); + + if ( workgroup ) + { + workgroup_item = new Smb4KNetworkBrowserItem( m_widget, workgroup ); + workgroup_item->setExpandable( true ); + + Smb4KNetworkBrowserItem *host_item = new Smb4KNetworkBrowserItem( workgroup_item, item ); + host_item->setExpandable( true ); + } + else + { + // In this case we have the information we need, but the + // scanner does not know the workgroup. Complain about this + // and do nothing else: + kdError() << "Smb4KNetworkBrowserPart::slotInsertHost(): No workgroup found" << endl; + } + } +} + + +void Smb4KNetworkBrowserPart::slotRescan() +{ + bool viewport_has_mouse; + + // We transform the global mouse position to a local position: + QPoint pos = m_widget->mapFromGlobal( m_widget->mousePosition() ); + + if ( pos.x() <= 0 || m_widget->viewport()->width() <= pos.x() || + pos.y() <= 0 || m_widget->viewport()->height() <= pos.y() ) + { + viewport_has_mouse = false; + } + else + { + viewport_has_mouse = true; + } + + if ( m_widget->currentItem() && m_widget->selectedItem() && viewport_has_mouse ) + { + Smb4KNetworkBrowserItem *browser_item = static_cast( m_widget->currentItem() ); + + if ( !m_widget->currentItem()->isOpen() && m_widget->currentItem()->isExpandable() ) + { + // When opening the expandable item, slotItemExpanded() will be invoked + // automatically. It carries code that will activate the scan of the + // network. + m_widget->setOpen( browser_item, true ); + } + else + { + // If the item is already open or if the user activated the action for + // a share item, we need to "manually" invoke the scanner here. + // NOTE: We do not use slotItemExpanded(), because that only works for + // workgroups and hosts: + switch ( browser_item->type() ) + { + case Smb4KNetworkBrowserItem::Workgroup: + { + Smb4KWorkgroupItem *item = browser_item->workgroupItem(); + Smb4KCore::scanner()->getWorkgroupMembers( item->name(), item->master(), item->masterIP() ); + + break; + } + case Smb4KNetworkBrowserItem::Host: + { + Smb4KHostItem *item = browser_item->hostItem(); + Smb4KCore::scanner()->getShares( item->workgroup(), item->name(), item->ip() ); + + break; + } + case Smb4KNetworkBrowserItem::Share: + { + Smb4KHostItem *item = static_cast( browser_item->parent() )->hostItem(); + Smb4KCore::scanner()->getShares( item->workgroup(), item->name(), item->ip() ); + + break; + } + default: + { + break; + } + } + } + } + else + { + // FIXME: Do we want to clear the list view here? + + Smb4KCore::scanner()->rescan(); + } +} + + +void Smb4KNetworkBrowserPart::slotAbort() +{ + if ( Smb4KCore::scannerIsRunning() && + Smb4KCore::scannerState() != SCANNER_SEARCHING ) + { + Smb4KCore::scanner()->abort(); + } + + if ( Smb4KCore::mounterIsRunning() && + Smb4KCore::mounterState() != MOUNTER_UNMOUNTING ) + { + Smb4KCore::mounter()->abort(); + } +} + + +void Smb4KNetworkBrowserPart::slotMountManually() +{ + Smb4KMountDialog *dlg = static_cast( m_widget->child( "MountDialog", "Smb4KMountDialog", true ) ); + + if ( !dlg ) + { + dlg = new Smb4KMountDialog( m_widget, "MountDialog" ); + } + + // The dialog will be closed destructively. + if ( !dlg->isShown() ) + { + dlg->exec(); + } +} + + +void Smb4KNetworkBrowserPart::slotAuthentication() +{ + Smb4KNetworkBrowserItem *item = static_cast( m_widget->currentItem() ); + + if ( item ) + { + switch ( item->type() ) + { + case Smb4KNetworkBrowserItem::Host: + { + passwordHandler()->askpass( item->hostItem()->workgroup(), + item->hostItem()->name(), + QString::null, + Smb4KPasswordHandler::NewData, + m_widget, + "AuthenticationDialog" ); + + break; + } + case Smb4KNetworkBrowserItem::Share: + { + passwordHandler()->askpass( item->shareItem()->workgroup(), + item->shareItem()->host(), + item->shareItem()->name(), + Smb4KPasswordHandler::NewData, + m_widget, + "AuthenticationDialog" ); + + break; + } + default: + { + break; + } + } + } +} + + +void Smb4KNetworkBrowserPart::slotCustomOptions() +{ + Smb4KCustomOptionsDialog *dlg = static_cast( + m_widget->child( "CustomOptionsDialog", "Smb4KCustomOptionsDialog", true ) ); + Smb4KNetworkBrowserItem *item = static_cast( m_widget->currentItem() ); + + if ( !dlg && item ) + { + switch ( item->type() ) + { + case Smb4KNetworkBrowserItem::Host: + { + dlg = new Smb4KCustomOptionsDialog( item->hostItem(), m_widget, "CustomOptionsDialog" ); + + break; + } + case Smb4KNetworkBrowserItem::Share: + { + dlg = new Smb4KCustomOptionsDialog( item->shareItem(), m_widget, "CustomOptionsDialog" ); + + break; + } + default: + { + break; + } + } + } + + if ( dlg && !dlg->isShown() ) + { + if ( dlg->isInitialized() ) + { + dlg->exec(); + } + else + { + delete dlg; + } + } +} + + +void Smb4KNetworkBrowserPart::slotBookmark() +{ + Smb4KNetworkBrowserItem *item = static_cast( m_widget->currentItem() ); + + if ( item && item->type() == Smb4KNetworkBrowserItem::Share ) + { + Smb4KNetworkBrowserItem *parent_item = static_cast( item->parent() ); + + // Add a bookmark. The alternative label can be set in the bookmark editor, + // so we won't do anything about it here. + Smb4KCore::bookmarkHandler()->addBookmark( new Smb4KBookmark( item->shareItem(), parent_item->hostItem()->ip() ) ); + } +} + + +void Smb4KNetworkBrowserPart::slotPreview() +{ + // The user should be able to open several dialogs at a time, so + // do not check for existing dialogs and use show() here. + Smb4KNetworkBrowserItem *item = static_cast( m_widget->currentItem() ); + Smb4KPreviewDialog *dlg = NULL; + + if ( item && item->type() == Smb4KNetworkBrowserItem::Share && + !item->shareItem()->isPrinter() ) + { + dlg = new Smb4KPreviewDialog( item->shareItem(), m_widget, "PreviewDialog" ); + } + + if ( dlg && !dlg->isShown() ) + { + if ( dlg->isInitialized() ) + { + dlg->show(); + } + else + { + delete dlg; + } + } +} + + +void Smb4KNetworkBrowserPart::slotPrint() +{ + Smb4KPrintDialog *dlg = static_cast( m_widget->child( "PrintDialog", "Smb4KPrintDialog", true ) ); + Smb4KNetworkBrowserItem *item = static_cast( m_widget->currentItem() ); + + if ( !dlg && item ) + { + switch( item->type() ) + { + case Smb4KNetworkBrowserItem::Share: + { + if ( item->shareItem()->isPrinter() ) + { + dlg = new Smb4KPrintDialog( item->shareItem(), m_widget, "PrintDialog" ); + } + + break; + } + default: + { + break; + } + } + } + + if ( dlg && !dlg->isShown() ) + { + dlg->exec(); + } +} + + +void Smb4KNetworkBrowserPart::slotMount() +{ + // Get the current item: + Smb4KNetworkBrowserItem *browser_item = static_cast( m_widget->currentItem() ); + + if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Share ) + { + // If the item is a share item, get its parent and start mounting it: + Smb4KNetworkBrowserItem *parent_browser_item = static_cast( browser_item->parent() ); + + Smb4KCore::mounter()->mountShare( browser_item->shareItem()->workgroup(), + browser_item->shareItem()->host(), + parent_browser_item->hostItem()->ip() /* There is no better way ATM */, + browser_item->shareItem()->name() ); + } +} + + +void Smb4KNetworkBrowserPart::slotUnmount() +{ + if ( m_mode == KonqPlugin ) + { + // Get the current item: + Smb4KNetworkBrowserItem *browser_item = static_cast( m_widget->currentItem() ); + + if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Share && + browser_item->isMounted() ) + { + QString share_name = QString( "//%1/%2" ).arg( browser_item->shareItem()->host(), + browser_item->shareItem()->name() ); + + QValueList list = Smb4KCore::mounter()->findShareByName( share_name ); + Smb4KShare *share = NULL; + + for ( QValueList::Iterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it).isForeign() ) + { + share = &(*it); + + break; + } + else + { + continue; + } + } + + if ( !share ) + { + share = &list.first(); + } + + // FIXME: Implement forced unmounting? + Smb4KCore::mounter()->unmountShare( share, false, false ); + } + else + { + // Do nothing + } + } + else + { + // Do nothing + } +} + + +void Smb4KNetworkBrowserPart::slotMarkMountedShares() +{ + QListViewItemIterator it( m_widget ); + QListViewItem *item; + + while ((item = it.current()) != 0 ) + { + ++it; + + if ( item->depth() == 2 ) + { + Smb4KShareItem *share_item = static_cast( item )->shareItem(); + + QValueList list = Smb4KCore::mounter()->findShareByName( QString( "//%1/%2" ).arg( share_item->host(), share_item->name() ) ); + + if ( list.isEmpty() ) + { + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + if ( browser_item->isMounted() ) + { + browser_item->setMounted( false ); + + if ( m_mode == KonqPlugin ) + { + // In case the user wants to unmount the share again + // immediately, we need to exchange the actions: + if ( actionCollection()->action( "konq_umount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "konq_umount_action" ) ); + m_menu->insert( actionCollection()->action( "mount_action" ), 11 ); + } + else + { + // Do nothing + } + } + } + + continue; + } + else + { + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it).isForeign() || Smb4KSettings::showAllShares() ) + { + Smb4KNetworkBrowserItem *browser_item = static_cast( item ); + + if ( !browser_item->isMounted() ) + { + browser_item->setMounted( true ); + + if ( m_mode == KonqPlugin ) + { + // In case the user wants to unmount the share again + // immediately, we need to exchange the actions: + if ( actionCollection()->action( "mount_action" )->isPlugged( m_menu->popupMenu() ) ) + { + m_menu->remove( actionCollection()->action( "mount_action" ) ); + m_menu->insert( actionCollection()->action( "konq_umount_action" ), 11 ); + } + else + { + // Do nothing + } + } + } + + break; + } + else + { + continue; + } + } + } + } + else + { + continue; + } + } +} + + +void Smb4KNetworkBrowserPart::slotRunStateChanged() +{ + switch ( Smb4KCore::currentState() ) + { + case SCANNER_INIT: + case SCANNER_OPENING_WORKGROUP: + case SCANNER_OPENING_HOST: + case SCANNER_RETRYING_OPENING_HOST: + case SCANNER_RETRIEVING_INFO: + { + actionCollection()->action( "rescan_action" )->setEnabled( false ); + actionCollection()->action( "abort_action" )->setEnabled( true ); + + break; + } + case MOUNTER_MOUNTING: + { + actionCollection()->action( "abort_action" )->setEnabled( true ); + + break; + } + case SCANNER_STOP: + case MOUNTER_STOP: + case CORE_STOP: + { + actionCollection()->action( "rescan_action" )->setEnabled( true ); + + if ( Smb4KCore::scannerState() == SCANNER_SEARCHING || + Smb4KCore::scannerState() == SCANNER_STOP || + Smb4KCore::mounterState() != MOUNTER_MOUNTING ) + { + actionCollection()->action( "abort_action" )->setEnabled( false ); + } + + break; + } + default: + { + break; + } + } +} + + + +///////////////////////////////////////////////////////////////////////////// +// FACTORY STUFF +///////////////////////////////////////////////////////////////////////////// + +Smb4KNetworkBrowserPartFactory::Smb4KNetworkBrowserPartFactory() +: KParts::Factory() +{ +} + + +Smb4KNetworkBrowserPartFactory::~Smb4KNetworkBrowserPartFactory() +{ + delete m_instance; + delete m_about; + + m_instance = 0L; +} + + +KParts::Part *Smb4KNetworkBrowserPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, +QObject *parent, const char *name, const char *, const QStringList &args ) +{ + Smb4KNetworkBrowserPart *obj = NULL; + + for ( QStringList::ConstIterator it = args.begin(); it != args.end(); ++it ) + { + QString arg = (*it).section( "=", 0, 0 ).stripWhiteSpace(); + QString value = (*it).section( "=", 1, -1 ).stripWhiteSpace(); + + if ( QString::compare( arg, "konqplugin" ) == 0 ) + { + if ( QString::compare( value, "\"true\"" ) == 0 ) + { + obj = new Smb4KNetworkBrowserPart( parentWidget, widgetName, parent, name, Smb4KNetworkBrowserPart::KonqPlugin ); + } + else + { + obj = new Smb4KNetworkBrowserPart( parentWidget, widgetName, parent, name, Smb4KNetworkBrowserPart::Normal ); + } + } + } + + if ( !obj ) + { + obj = new Smb4KNetworkBrowserPart( parentWidget, widgetName, parent, name, Smb4KNetworkBrowserPart::Normal ); + } + + return obj ; +} + + +KInstance *Smb4KNetworkBrowserPartFactory::instance() +{ + if( !m_instance ) + { + m_about = new KAboutData( "smb4knetworkbrowserpart", I18N_NOOP( "Smb4KNetworkBrowserPart" ), "1.0" ); + m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de"); + m_about->setLicense( KAboutData::License_GPL ); + m_instance = new KInstance( m_about ); + } + + return m_instance; +} + + +///////////////////////////////////////////////////////////////////////////// +// INIT +///////////////////////////////////////////////////////////////////////////// + +extern "C" +{ + void *init_libsmb4knetworkbrowser() + { + KGlobal::locale()->insertCatalogue( "smb4k" ); + return new Smb4KNetworkBrowserPartFactory; + } +} + + +#include "smb4knetworkbrowser_part.moc" diff --git a/smb4k/browser/smb4knetworkbrowser_part.h b/smb4k/browser/smb4knetworkbrowser_part.h new file mode 100644 index 0000000..a3351dc --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowser_part.h @@ -0,0 +1,377 @@ +/*************************************************************************** + smb4knetworkbrowser_part - This Part encapsulates the network + browser of Smb4K. + ------------------- + begin : Fr Jan 5 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KNETWORKBROWSERPART_H +#define SMB4KNETWORKBROWSERPART_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include +#include + +// Qt includes +#include +#include + +// forward declarations +class Smb4KNetworkBrowser; +class Smb4KNetworkBrowserItem; +class Smb4KWorkgroupItem; +class Smb4KHostItem; +class Smb4KShareItem; + +/** + * This is one of the parts of Smb4K. It contains the network browser. + * + * @author Alexander Reinholdt + */ + +class Smb4KNetworkBrowserPart : public KParts::Part +{ + Q_OBJECT + + public: + /** + * Mode enumeration + */ + enum Mode { Normal, KonqPlugin }; + + /** + * The constructor. + * + * @param parentWidget The parent widget + * + * @param widgetName The name the widget should have + * + * @param parent The parent object + * + * @param name The name this object should have + * + * @param mode Determines in which mode the KPart should be started + */ + Smb4KNetworkBrowserPart( QWidget *parentWidget = 0, + const char *widgetName = 0, + QObject *parent = 0, + const char *name = 0, + Mode mode = Normal ); + + /** + * The destructor. + */ + virtual ~Smb4KNetworkBrowserPart(); + + protected: + /** + * Reimplemented from KParts::Part. + */ + void customEvent( QCustomEvent *e ); + + protected slots: + /** + * This slot is called if the user requests the context menu. It shows + * the menu with the actions defined for the widget. + * + * @param item The item for which the popup menu has been + * requested or NULL. + * + * @param pos The position where user clicked. + * + * @param col The column where the user clicked. + */ + void slotContextMenuRequested( QListViewItem *item, const QPoint &pos, int col ); + + /** + * Is called when the selection changed. This slot takes care of the + * actions being enabled or disabled accordingly. All widget specific + * stuff has to be done in the browser widget itself. + * + * @param item The selection list view item. + */ + void slotSelectionChanged( QListViewItem *item ); + + /** + * Is called when the user pressed a mouse button somewhere in the widget. + * In addition to Smb4KNetworkBrowserPart::slotSelectionChanged() this slot + * takes care of the actions being enabled or disabled accordingly. All + * widget specific stuff has to be done in the browser widget itself. + * + * @param item The selection list view item. + */ + void slotPressed( QListViewItem *item ); + + /** + * This slot is called when an item of the browser's list view has been opened. + * It is used to invoke the functions of the scanner that need to be run. + * + * @param item The list view item that has been opened. + */ + void slotItemExpanded( QListViewItem *item ); + + /** + * This slot is called when an item of the browser's list view has been closed. + * + * @param item The list view item that has been closed. + */ + void slotItemCollapsed( QListViewItem *item ); + + /** + * This slot is invoked when the user executed an item. It is used to mount + * shares. + * + * @param item The list view item that has been executed. + */ + void slotItemExecuted( QListViewItem *item ); + + /** + * This slot is called when the user moved the mouse over an @p item in the + * network browser's list view and a tool tip is about to be shown. It will + * initiate any actions that have to be taken by the scanner to complete + * the information on the network items shown in the browser. + * + * @param item The item for which the additional info should + * be retrieved + */ + void slotAboutToShowToolTip( Smb4KNetworkBrowserItem *item ); + + /** + * This slot receives the workgroups/domains found by the scanner. It takes + * a list of workgroup items @p list and inserts the respective workgroups + * into the browser window. Obsolete items will be deleted from the network + * browser. + * + * @param list A list of Smb4KWorkgroupItem objects + */ + void slotWorkgroups( const QValueList &list ); + + /** + * This slot receives the list of workgroup/domain members that were found + * by the scanner. It takes this @p list and inserts it into the list view. + * The parent of the items is the workgroup/domain item with the name + * @p workgroup. Obsolete items will be deleted from the network browser. + * + * @param workgroup The workgroup where the hosts belong + * + * @param list A list of Smb4KHostItem objects + */ + void slotWorkgroupMembers( const QString &workgroup, const QValueList &list ); + + /** + * This slot receives the list of shared resources a host provides. It takes + * this @p list and inserts its items as children of @p host into the list + * view. Obsolete items will be deleted from the network browser. + * + * @param host The host where the shares belong + * + * @param list The list of shares that belong to @p host + */ + void slotShares( const QString &host, const QValueList &list ); + + /** + * This slot takes a Smb4KHostItem object @p item, reads the IP address entry + * from it and updates the list view item representing the host with it. + * + * @param item A Smb4KHostItem with an updated IP address. + */ + void slotAddIPAddress( Smb4KHostItem *item ); + + /** + * This slot adds additional information to a browser item. It takes an + * Smb4KHostItem @p item, searches the assossiated browser item and updates its + * contents. + * + * @param item A Smb4KHostItem with updated contents. + */ + void slotAddInformation( Smb4KHostItem *item ); + + /** + * This slots is connected to the Smb4KScanner::hostAdded() signal and inserts + * a single host in the list view. If the host is already present, nothing is + * done. + * + * @param item A Smb4KHostItem that is to be added to the + * list view. + */ + void slotInsertHost( Smb4KHostItem *item ); + + /** + * Rescan the network. This slot is connected to the 'Rescan' action. + */ + void slotRescan(); + + /** + * Abort a network scan. This slot is connected to the 'Abort' action. + */ + void slotAbort(); + + /** + * Manually mount a share. This slot is connected to the 'Mount Manually' + * action and opens a mount dialog. + */ + void slotMountManually(); + + /** + * Provide authentication for the current network object. This slot is + * connected to the 'Authentication' action. + */ + void slotAuthentication(); + + /** + * Provide custom options for a server or share. This slot is connected + * to the 'Custom Options' action. + */ + void slotCustomOptions(); + + /** + * Bookmark a remote share. This slot is connected to the 'Add Bookmark' + * action. + */ + void slotBookmark(); + + /** + * Preview a share. This slot is connected to the 'Preview' action. + */ + void slotPreview(); + + /** + * Print a document on a remote printer. This slot is connected to the + * 'Print File' action. + */ + void slotPrint(); + + /** + * Mount a remote share. This slot is connected to the 'Mount' action. + */ + void slotMount(); + + /** + * Unmount a share. This slot is only relevant in the Konqueror plugin + * mode. + */ + void slotUnmount(); + + /** + * This slot is invoked by the Smb4KMounter::updated() signal and changes + * the text and icon of all shares that are already mounted. + */ + void slotMarkMountedShares(); + + /** + * This slot is connected to the Smb4KCore::runStateChanged() signal and + * is used to enable/disable actions. + */ + void slotRunStateChanged(); + + private: + /** + * Set up the actions + */ + void setupActions(); + + /** + * Load settings for the widget or the actions. + */ + void loadSettings(); + + /** + * The action menu + */ + KActionMenu *m_menu; + + /** + * The network browser widget + */ + Smb4KNetworkBrowser *m_widget; + + /** + * Determines with which mode the KPart will be started + */ + Mode m_mode; +}; + + +class KInstance; +class KAboutData; + +class Smb4KNetworkBrowserPartFactory : public KParts::Factory +{ + Q_OBJECT + + public: + /** + * The constructor + */ + Smb4KNetworkBrowserPartFactory(); + + /** + * The destructor + */ + virtual ~Smb4KNetworkBrowserPartFactory(); + + /** + * Reimplemented from KParts::Factory. This function is used to + * create a part object. + * + * @param parentWidget The parent of the part's widget. + * + * @param widgetName The name of the part's widget. + * + * @param parent The parent of the part. + * + * @param name The name of the part. + * + * @param classname The class name of the part. This should be "KParts::Part". + * + * @param args A list of additional arguments. They have to be provided as + * name="value" pairs. At the moment this function understands + * the following pairs: + * konqplugin="true"|"false". + */ + virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args = QStringList() ); + + /** + * The instance + */ + static KInstance *instance(); + + private: + /** + * The factory's instance. + */ + static KInstance *m_instance; + + /** + * The factory's KAboutData object + */ + static KAboutData *m_about; +}; + +#endif diff --git a/smb4k/browser/smb4knetworkbrowser_part.rc b/smb4k/browser/smb4knetworkbrowser_part.rc new file mode 100644 index 0000000..8a7d938 --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowser_part.rc @@ -0,0 +1,31 @@ + + + + &Network + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smb4k/browser/smb4knetworkbrowseritem.cpp b/smb4k/browser/smb4knetworkbrowseritem.cpp new file mode 100644 index 0000000..c3f2ebe --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowseritem.cpp @@ -0,0 +1,228 @@ +/*************************************************************************** + smb4knetworkbrowseritem - Smb4K's network browser list item. + ------------------- + begin : Mo Jan 8 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4knetworkbrowseritem.h" + +Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( QListView *parent, Smb4KWorkgroupItem *item ) +: KListViewItem( parent, item->name() ), m_type( Workgroup ), m_workgroup( *item ), +m_mounted( false ) +{ + setIcon(); +} + + +Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KHostItem *item ) +: KListViewItem( parent, item->name(), QString::null, item->ip(), item->comment() ), +m_type( Host ), m_host( *item ), m_mounted( false ) +{ + setIcon(); +} + + +Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KShareItem *item ) +: KListViewItem( parent, item->name(), item->plainType(), QString::null, item->comment() ), +m_type( Share ), m_share( *item ), m_mounted( false ) +{ + setIcon(); +} + + +Smb4KNetworkBrowserItem::~Smb4KNetworkBrowserItem() +{ +} + + +void Smb4KNetworkBrowserItem::setIcon() +{ + switch ( m_type ) + { + case Workgroup: + { + m_desktop_icon = DesktopIcon( "network_local" ); + setPixmap( 0, SmallIcon( "network_local" ) ); + break; + } + case Host: + { + m_desktop_icon = DesktopIcon( "server" ); + setPixmap( 0, SmallIcon( "server" ) ); + break; + } + case Share: + { + if ( m_share.isPrinter() ) + { + m_desktop_icon = DesktopIcon( "printer1" ); + setPixmap( 0, SmallIcon( "printer1" ) ); + } + else + { + if ( m_mounted ) + { + m_desktop_icon = DesktopIcon( "folder_open", 0, KIcon::ActiveState ); + setPixmap( 0, SmallIcon( "folder_open", 0, KIcon::ActiveState ) ); + } + else + { + m_desktop_icon = DesktopIcon( "folder", 0, KIcon::DefaultState ); + setPixmap( 0, SmallIcon( "folder", 0, KIcon::DefaultState ) ); + } + } + break; + } + default: + { + break; + } + } +} + + +Smb4KNetworkBrowserItem::ItemType Smb4KNetworkBrowserItem::type() +{ + return m_type; +} + + +Smb4KWorkgroupItem *Smb4KNetworkBrowserItem::workgroupItem() +{ + return (m_type == Workgroup ? &m_workgroup : NULL); +} + + +Smb4KHostItem *Smb4KNetworkBrowserItem::hostItem() +{ + return (m_type == Host ? &m_host : NULL); +} + + +Smb4KShareItem *Smb4KNetworkBrowserItem::shareItem() +{ + return (m_type == Share ? &m_share : NULL); +} + + +void Smb4KNetworkBrowserItem::update( Smb4KWorkgroupItem *item ) +{ + m_workgroup = *item; +} + + +void Smb4KNetworkBrowserItem::update( Smb4KHostItem *item ) +{ + m_host = *item; + + if ( !m_host.ip().isEmpty() && QString::compare( text( IP ).stripWhiteSpace(), m_host.ip() ) != 0 ) + { + setText( IP, m_host.ip() ); + } + + if ( QString::compare( text( Comment ).stripWhiteSpace(), m_host.comment() ) != 0 ) + { + setText( Comment, m_host.comment() ); + } +} + + +void Smb4KNetworkBrowserItem::update( Smb4KShareItem *item ) +{ + m_share = *item; + + if ( !m_share.comment().isEmpty() && QString::compare( text( Comment ).stripWhiteSpace(), m_share.comment() ) != 0 ) + { + setText( Comment, m_share.comment() ); + } +} + + +bool Smb4KNetworkBrowserItem::isPrinter() +{ + bool is_printer = false; + + if ( m_type == Share ) + { + is_printer = m_share.isPrinter(); + } + + return is_printer; +} + + +void Smb4KNetworkBrowserItem::setMounted( bool mounted ) +{ + if ( m_type == Share && QString::compare( m_share.plainType(), "Disk" ) == 0 ) + { + m_mounted = mounted; + + setIcon(); + } + else + { + // Do nothing + } +} + + +bool Smb4KNetworkBrowserItem::isMounted() +{ + return m_mounted; +} + + +void Smb4KNetworkBrowserItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) +{ + QFont f( p->font() ); + QColorGroup colorgrp( cg ); + + if ( m_type == Share && m_mounted ) + { + f.setItalic( true ); + } + else + { + f.setItalic( false ); + } + + if ( m_type == Host && m_host.isMaster() ) + { + colorgrp.setColor( QColorGroup::Text, Qt::darkBlue ); + } + else + { + colorgrp.setColor( QColorGroup::Text, cg.text() ); + } + + p->setFont( f ); + + QListViewItem::paintCell( p, colorgrp, column, width, align ); +} diff --git a/smb4k/browser/smb4knetworkbrowseritem.h b/smb4k/browser/smb4knetworkbrowseritem.h new file mode 100644 index 0000000..141ae04 --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowseritem.h @@ -0,0 +1,222 @@ +/*************************************************************************** + smb4knetworkbrowseritem - Smb4K's network browser list item. + ------------------- + begin : Mo Jan 8 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KNETWORKBROWSERITEM_H +#define SMB4KNETWORKBROWSERITEM_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include + +// application specific includes +#include "../core/smb4knetworkitems.h" + +class Smb4KNetworkBrowser; +class Smb4KNetworkBrowserItem : public KListViewItem +{ + public: + /** + * The constructor for toplevel (workgroup) items. + * + * @param parent The parent list view. + * + * @param item The Smb4KWorkgroupItem that carries all the data + * needed to set up a "workgroup item". + */ + Smb4KNetworkBrowserItem( QListView *parent, Smb4KWorkgroupItem *item ); + + /** + * The constructor for the host items. + * + * @param parent The parent list view item. + * + * @param item The Smb4KHostItem that carries all the data. + */ + Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KHostItem *item ); + + /** + * The constructor for the share items. + * + * @param parent The parent list view item. + * + * @param item The Smb4KShareItem that carries all the data. + */ + Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KShareItem *item ); + + /** + * The destructor. + */ + virtual ~Smb4KNetworkBrowserItem(); + + /** + * Enumeration that determines the type of the item. + */ + enum ItemType{ Workgroup, Host, Share }; + + /** + * This function returns the type of the item according to the ItemType + * enumeration. + * + * @returns the type of the item. + */ + Smb4KNetworkBrowserItem::ItemType type(); + + /** + * This function returns a pointer to the Smb4KWorkgroupItem object if it + * is present or NULL if it is not. + * + * @returns a pointer to the workgroup item or NULL. + */ + Smb4KWorkgroupItem *workgroupItem(); + + /** + * This function returns a pointer to the Smb4KHostItem object if it + * is present or NULL if it is not. + * + * @returns a pointer to the host item or NULL. + */ + Smb4KHostItem *hostItem(); + + /** + * This function returns a pointer to the Smb4KShareItem object if it + * is present or NULL if it is not. + * + * @returns a pointer to the share item or NULL. + */ + Smb4KShareItem *shareItem(); + + /** + * This function updates the internal Smb4KWorkgroupItem object. + * + * @param item A Smb4KWorkgroupItem object + */ + void update( Smb4KWorkgroupItem *item ); + + /** + * This function updates the internal Smb4KHostItem object and + * changes the text that's being displayed in the browser. Use this, + * if you have to alter the item in the browser. + * + * @param item A Smb4KHostItem + */ + void update( Smb4KHostItem *item ); + + /** + * This function updates the internal Smb4KShareItem object and + * changes the text that's being displayed in the browser. Use this, + * if you have to alter the item in the browser. + * + * @param item A Smb4KShareItem + */ + void update( Smb4KShareItem *item ); + + /** + * This is a convenience function. It returns TRUE if the item is a + * printer share and FALSE otherwise. + * + * @returns TRUE if the item is a printer share and FALSE otherwise. + */ + bool isPrinter(); + + /** + * Tell the item that the share it represents is mounted. The icon will be + * changed by this function and the item text will be set to italic by + * Smb4KNetworkBrowserItem::paintCell(). + * + * @param mounted TRUE if the share is mounted and FALSE otherwise + */ + void setMounted( bool mounted = true ); + + /** + * Tells whether the respective share is shown as mounted or not. For non-share + * items this function will always return FALSE. + * + * @returns TRUE if the share is mounted and FALSE otherwise. + */ + bool isMounted(); + + /** + * Returns the icon of this item in "Desktop" size. + * + * @returns a pixmap + */ + const QPixmap &desktopIcon() { return m_desktop_icon; } + + protected: + /** + * Reimplemented from QListViewItem. + */ + void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ); + + private: + /** + * This function sets the icon of the item according to + * the type and other factors. + */ + void setIcon(); + + /** + * The type of the item. + */ + ItemType m_type; + + /** + * This enumeration enumerates the columns of the item. + */ + enum Columns{ Network = 0, Type = 1, IP = 2, Comment = 3 }; + + /** + * The workgroup item + */ + Smb4KWorkgroupItem m_workgroup; + + /** + * The host item + */ + Smb4KHostItem m_host; + + /** + * The share item + */ + Smb4KShareItem m_share; + + /** + * Tells us that the share item is mounted + */ + bool m_mounted; + + /** + * The icon in "DesktopIcon" format + */ + QPixmap m_desktop_icon; +}; + +#endif diff --git a/smb4k/browser/smb4knetworkbrowsertooltip.cpp b/smb4k/browser/smb4knetworkbrowsertooltip.cpp new file mode 100644 index 0000000..451344f --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowsertooltip.cpp @@ -0,0 +1,378 @@ +/*************************************************************************** + smb4knetworkbrowsertooltip - Tool tip for the network browser. + ------------------- + begin : Sa Jan 20 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include + +// application specific includes +#include "smb4knetworkbrowsertooltip.h" +#include "smb4knetworkbrowseritem.h" + +Smb4KNetworkBrowserToolTip::Smb4KNetworkBrowserToolTip( Smb4KNetworkBrowserItem *item ) +: QLabel( 0, "NetworkBrowserToolTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item ) +{ + setPalette( QToolTip::palette() ); + setLineWidth( 1 ); + setMidLineWidth( 1 ); + setFrameShape( Box ); + setFrameShadow( Plain ); + setMouseTracking( true ); + + m_layout = new QGridLayout( this ); + m_layout->setMargin( 10 ); + m_layout->setSpacing( 3 ); + + // We will set up the tip in the showTip() function. +} + + +Smb4KNetworkBrowserToolTip::~Smb4KNetworkBrowserToolTip() +{ + // Never touch the Smb4KNetworkBrowserItem object here +} + + +void Smb4KNetworkBrowserToolTip::showTip( const QPoint &pos ) +{ + if ( !m_item || isShown() ) + { + return; + } + + setupTip(); + + adjustSize(); + + QPoint p( pos ); + + QDesktopWidget *d = QApplication::desktop(); + + if ( p.x() + width() > d->width() ) + { + p.setX( p.x() - width() - 5 ); + } + else + { + p.setX( p.x() + 5 ); + } + + if ( p.y() + height() > d->height() ) + { + p.setY( p.y() - height() - 5 ); + } + else + { + p.setY( p.y() + 5 ); + } + + setGeometry( p.x(), p.y(), width(), height() ); + polish(); + show(); + QTimer::singleShot( 10000, this, SLOT( slotHideToolTip() ) ); +} + + +void Smb4KNetworkBrowserToolTip::setupTip() +{ + switch ( m_item->type() ) + { + case Smb4KNetworkBrowserItem::Workgroup: + { + QLabel *workgroup_label = new QLabel( i18n( "Workgroup:" ), this ); + QLabel *workgroup = new QLabel( m_item->workgroupItem()->name() , this ); + + QString master_label_entry = m_item->workgroupItem()->hasPseudoMaster() ? i18n( "Pseudo master browser:" ) : i18n( "Master browser:" ); + QLabel *master_label = new QLabel( master_label_entry, this ); + + QString master_entry = m_item->workgroupItem()->masterIP().isEmpty() ? + (m_item->workgroupItem()->master().isEmpty() ? i18n( "Unknown" ) : m_item->workgroupItem()->master()) : + m_item->workgroupItem()->master() + " ("+m_item->workgroupItem()->masterIP()+")"; + QLabel *master = new QLabel( master_entry, this, "MasterBrowser" ); + + m_layout->addWidget( workgroup_label, 0, 1, 0 ); + m_layout->addWidget( workgroup, 0, 2, 0 ); + m_layout->addWidget( master_label, 1, 1, 0 ); + m_layout->addWidget( master, 1, 2, 0 ); + + break; + } + case Smb4KNetworkBrowserItem::Host: + { + QLabel *host_label = new QLabel( i18n( "Host:" ), this ); + QLabel *host = new QLabel( m_item->hostItem()->name(), this ); + + QLabel *comment_label = new QLabel( i18n( "Comment:" ), this ); + QLabel *comment = new QLabel( m_item->hostItem()->comment(), this ); + + QLabel *ip_label = new QLabel( i18n( "IP address:" ), this ); + QString ip_entry = m_item->hostItem()->ip().isEmpty() ? i18n( "Unknown" ) : m_item->hostItem()->ip(); + QLabel *ip_address = new QLabel( ip_entry, this, "IPAddress" ); + + QLabel *os_label = new QLabel( i18n( "Operating system:" ), this ); + QLabel *operating_system = new QLabel( m_item->hostItem()->osString().isEmpty() ? i18n( "Unknown" ) : + m_item->hostItem()->osString(), this, "OSString" ); + + QLabel *server_label = new QLabel( i18n( "Server string:" ), this ); + QLabel *server_string = new QLabel( m_item->hostItem()->serverString().isEmpty() ? i18n( "Unknown" ) : + m_item->hostItem()->serverString(), this, "ServerString" ); + + QFrame *line = new QFrame( this ); + line->setLineWidth( 1 ); + line->setMidLineWidth( 0 ); + line->setFixedWidth( 100 ); + line->setFrameShape( QFrame::HLine ); + line->setFrameShadow( QFrame::Plain ); + + QLabel *workgroup_label = new QLabel( i18n( "Workgroup:" ), this ); + QLabel *workgroup = new QLabel( m_item->hostItem()->workgroup(), this ); + + Smb4KWorkgroupItem *workgroup_item = static_cast( m_item->parent() )->workgroupItem(); + QLabel *master_label = new QLabel( i18n( "Master browser:" ), this ); + QLabel *master_yes_no = new QLabel( (workgroup_item && !workgroup_item->master().isEmpty()) ? + workgroup_item->master() : i18n( "Unknown" ), this ); + + m_layout->addWidget( host_label, 0, 1, 0 ); + m_layout->addWidget( host, 0, 2, 0 ); + m_layout->addWidget( comment_label, 1, 1, 0 ); + m_layout->addWidget( comment, 1, 2, 0 ); + m_layout->addWidget( ip_label, 2, 1, 0 ); + m_layout->addWidget( ip_address, 2, 2, 0 ); + m_layout->addWidget( os_label, 3, 1, 0 ); + m_layout->addWidget( operating_system, 3, 2, 0 ); + m_layout->addWidget( server_label, 4, 1, 0 ); + m_layout->addWidget( server_string, 4, 2, 0 ); + m_layout->addMultiCellWidget( line, 5, 5, 1, 2, Qt::AlignCenter ); + m_layout->addWidget( workgroup_label, 6, 1, 0 ); + m_layout->addWidget( workgroup, 6, 2, 0 ); + m_layout->addWidget( master_label, 7, 1, 0 ); + m_layout->addWidget( master_yes_no, 7, 2, 0 ); + + break; + } + case Smb4KNetworkBrowserItem::Share: + { + QLabel *share_label = new QLabel( i18n( "Share:" ), this ); + QLabel *share = new QLabel( m_item->shareItem()->name(), this ); + + QLabel *comment_label = new QLabel( i18n( "Comment:" ), this ); + QLabel *comment = new QLabel( m_item->shareItem()->comment(), this ); + + QLabel *type_label = new QLabel( i18n( "Type:" ), this ); + QLabel *type = new QLabel( m_item->shareItem()->translatedType(), this ); + + QLabel *mounted_label = NULL; + QLabel *mounted = NULL; + + if ( !m_item->isPrinter() ) + { + mounted_label = new QLabel( i18n( "Mounted:" ), this ); + mounted = new QLabel( m_item->isMounted() ? i18n( "Yes" ) : i18n( "No" ), this ); + } + + QFrame *line = new QFrame( this ); + line->setLineWidth( 1 ); + line->setMidLineWidth( 0 ); + line->setFixedWidth( 100 ); + line->setFrameShape( QFrame::HLine ); + line->setFrameShadow( QFrame::Plain ); + + QLabel *host_label = new QLabel( i18n( "Host:" ), this ); + QLabel *host = new QLabel( m_item->shareItem()->host(), this ); + + Smb4KHostItem *host_item = static_cast( m_item->parent() )->hostItem(); + QLabel *ip_label = new QLabel( i18n( "IP address:" ), this ); + QLabel *ip_address = new QLabel( (host_item && !host_item->ip().isEmpty()) ? + host_item->ip() : i18n( "Unknown" ), this, "IPAddress" ); + + m_layout->addWidget( share_label, 0, 1, 0 ); + m_layout->addWidget( share, 0, 2, 0 ); + m_layout->addWidget( comment_label, 1, 1, 0 ); + m_layout->addWidget( comment, 1, 2, 0 ); + m_layout->addWidget( type_label, 2, 1, 0 ); + m_layout->addWidget( type, 2, 2, 0 ); + + if ( !m_item->isPrinter() ) + { + m_layout->addWidget( mounted_label, 3, 1, 0 ); + m_layout->addWidget( mounted, 3, 2, 0 ); + m_layout->addMultiCellWidget( line, 4, 4, 1, 2, Qt::AlignCenter ); + m_layout->addWidget( host_label, 5, 1, 0 ); + m_layout->addWidget( host, 5, 2, 0 ); + m_layout->addWidget( ip_label, 6, 1, 0 ); + m_layout->addWidget( ip_address, 6, 2, 0 ); + } + else + { + m_layout->addMultiCellWidget( line, 3, 3, 1, 2, Qt::AlignCenter ); + m_layout->addWidget( host_label, 4, 1, 0 ); + m_layout->addWidget( host, 4, 2, 0 ); + m_layout->addWidget( ip_label, 5, 1, 0 ); + m_layout->addWidget( ip_address, 5, 2, 0 ); + } + + break; + } + default: + { + break; + } + } + + QLabel *pix_label = new QLabel( this ); + pix_label->setPixmap( m_item->desktopIcon() ); + + m_layout->addMultiCellWidget( pix_label, 0, m_layout->numRows(), 0, 0, Qt::AlignCenter ); +} + + +void Smb4KNetworkBrowserToolTip::update() +{ + // This function updates a tool tip that + // is shown. So, if the tool tip exists, but + // is not shown, stop here. + if ( !isShown() ) + { + return; + } + + switch ( m_item->type() ) + { + case Smb4KNetworkBrowserItem::Workgroup: + { + QLabel *master_label = static_cast( child( "MasterBrowser", "QLabel", true ) ); + + if ( master_label ) + { + QString master_string = m_item->workgroupItem()->masterIP().isEmpty() ? + m_item->workgroupItem()->master() : + m_item->workgroupItem()->master() + " ("+m_item->workgroupItem()->masterIP()+")"; + + master_label->setText( master_string ); + } + + break; + } + case Smb4KNetworkBrowserItem::Host: + { + QLabel *os_label = static_cast( child( "OSString", "QLabel", true ) ); + QLabel *server_label = static_cast( child( "ServerString", "QLabel", true ) ); + QLabel *ip_label = static_cast( child( "IPAddress", "QLabel", true ) ); + + if ( os_label ) + { + QString os_string = m_item->hostItem()->osString().isEmpty() ? + i18n( "Unknown" ) : + m_item->hostItem()->osString(); + + os_label->setText( os_string ); + } + + if ( server_label ) + { + QString server_string = m_item->hostItem()->serverString().isEmpty() ? + i18n( "Unknown" ) : + m_item->hostItem()->serverString(); + + server_label->setText( server_string ); + } + + if ( ip_label ) + { + QString ip_string = m_item->hostItem()->ip().isEmpty() ? + i18n( "Unknown" ) : + m_item->hostItem()->ip(); + + ip_label->setText( ip_string ); + } + + break; + } + case Smb4KNetworkBrowserItem::Share: + { + QLabel *ip_label = static_cast( child( "IPAddress", "QLabel", true ) ); + + if ( ip_label ) + { + Smb4KHostItem *host = static_cast( m_item->parent() )->hostItem(); + QString ip_string; + + if ( host ) + { + ip_string = (host && !host->ip().isEmpty()) ? + host->ip() : + i18n( "Unknown" ); + } + else + { + ip_string = i18n( "Unknown" ); + } + + ip_label->setText( ip_string ); + } + + break; + } + default: + { + break; + } + } +} + + +void Smb4KNetworkBrowserToolTip::mousePressEvent( QMouseEvent *e ) +{ + hide(); + QLabel::mousePressEvent( e ); +} + + +void Smb4KNetworkBrowserToolTip::leaveEvent( QEvent *e ) +{ + hide(); + QLabel::leaveEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KNetworkBrowserToolTip::slotHideToolTip() +{ + if ( isShown() ) + { + hide(); + } +} + + +#include "smb4knetworkbrowsertooltip.moc" diff --git a/smb4k/browser/smb4knetworkbrowsertooltip.h b/smb4k/browser/smb4knetworkbrowsertooltip.h new file mode 100644 index 0000000..993f64c --- /dev/null +++ b/smb4k/browser/smb4knetworkbrowsertooltip.h @@ -0,0 +1,122 @@ +/*************************************************************************** + smb4knetworkbrowsertooltip - Tool tip for the network browser. + ------------------- + begin : Sa Jan 20 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KNETWORKBROWSERTOOLTIP_H +#define SMB4KNETWORKBROWSERTOOLTIP_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// Forward declarations: +class Smb4KNetworkBrowserItem; + + +/** + * This class provides the tool tip for the network browser + * of Smb4K. It shows information about the associated share. + * + * @author Alexander Reinholdt + */ + +class Smb4KNetworkBrowserToolTip : public QLabel +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param item The Smb4KNetworkBrowserItem object for which + * a tool tip should be shown. + */ + Smb4KNetworkBrowserToolTip( Smb4KNetworkBrowserItem *item ); + + /** + * The destructor + */ + ~Smb4KNetworkBrowserToolTip(); + + /** + * Show the tool tip. Please note that the tool tip will not be shown + * exactly at position @p pos but with a displacement of 5 pixels in x- + * and y-direction. + */ + void showTip( const QPoint &pos ); + + /** + * If you need to update the tool tip while it is shown, this is the function + * you want to use. It rereads the entries from the assossiated + * Smb4KNetworkBrowserItem object and modifies the tool tip if changes happened. + */ + void update(); + + /** + * Returns the Smb4KNetworkBrowserItem object for which the tool tip + * should be shown. + * + * @returns a pointer to a Smb4KNetworkBrowserItem object. + */ + Smb4KNetworkBrowserItem *item() { return m_item; } + + protected: + /** + * Reimplemented from QLabel. + */ + void mousePressEvent( QMouseEvent *e ); + + /** + * Reimplemented from QLabel. + */ + void leaveEvent( QEvent *e ); + + protected slots: + /** + * This slot hides the tool tip after 10 sec. + */ + void slotHideToolTip(); + + private: + /** + * The pointer to the Smb4KNetworkBrowserItem object + */ + Smb4KNetworkBrowserItem *m_item; + + /** + * The layout for the tool tip + */ + QGridLayout *m_layout; + + /** + * Set up the tool tip + */ + void setupTip(); +}; + +#endif diff --git a/smb4k/configdlg/Makefile.am b/smb4k/configdlg/Makefile.am new file mode 100644 index 0000000..6a85b0f --- /dev/null +++ b/smb4k/configdlg/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO +kde_module_LTLIBRARIES = libsmb4kconfigdialog.la +noinst_HEADERS = smb4kauthoptions.h smb4kconfigdialog.h smb4knetworkoptions.h \ + smb4krsyncoptions.h smb4ksambaoptions.h smb4kshareoptions.h smb4ksuperuseroptions.h \ + smb4kuserinterfaceoptions.h +libsmb4kconfigdialog_la_SOURCES = smb4kauthoptions.cpp smb4kconfigdialog.cpp \ + smb4knetworkoptions.cpp smb4krsyncoptions.cpp smb4ksambaoptions.cpp smb4kshareoptions.cpp \ + smb4ksuperuseroptions.cpp smb4kuserinterfaceoptions.cpp +libsmb4kconfigdialog_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_QT) +libsmb4kconfigdialog_la_LDFLAGS = -module $(KDE_PLUGIN) diff --git a/smb4k/configdlg/smb4kauthoptions.cpp b/smb4k/configdlg/smb4kauthoptions.cpp new file mode 100644 index 0000000..1cafc91 --- /dev/null +++ b/smb4k/configdlg/smb4kauthoptions.cpp @@ -0,0 +1,135 @@ +/*************************************************************************** + smb4kauthoptions - The configuration page for the authentication + settings of Smb4K + ------------------- + begin : Sa Nov 15 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4kauthoptions.h" + +Smb4KAuthOptions::Smb4KAuthOptions( QWidget *parent, const char *name ) +: QWidget( parent, name ) +{ + // + // Default Authentication + // + QGridLayout *grid = new QGridLayout( this ); + grid->setSpacing( 10 ); + + QButtonGroup *password_group = new QButtonGroup( 1, QButtonGroup::Horizontal, + i18n( "Password Storage" ), this ); + QCheckBox *use_wallet = new QCheckBox( i18n( "Save the authentication data in a wallet" ), + password_group, "kcfg_UseWallet" ); + (void) new QCheckBox( i18n( "If no wallet is used, remember authentication data during run time" ), + password_group, "kcfg_RememberPasswords" ); + + QGroupBox *login_box = new QGroupBox( 1, Qt::Horizontal, i18n( "Default Login" ), + this, "DefaultLoginBox" ); +// login_box->setInsideMargin( 10 ); + + QCheckBox *default_auth = new QCheckBox( i18n( "Use default login" ), + login_box, "kcfg_UseDefaultLogin" ); + + QWidget *auth_widget = new QWidget( login_box, "DefaultAuthWidget" ); + QGridLayout *auth_grid = new QGridLayout( auth_widget ); + auth_grid->setSpacing( 5 ); + + QLabel *login = new QLabel( i18n( "User:" ), auth_widget ); + KLineEdit *default_login = new KLineEdit( auth_widget, "DefaultUserName" ); + default_login->setMinimumWidth( 150 ); + QWhatsThis::add( default_login, i18n( "This login name is used by default to authenticate to a remote server." ) ); + QLabel *password = new QLabel( i18n( "Password:" ), auth_widget ); + KLineEdit *default_password = new KLineEdit( auth_widget, "DefaultPassword" ); + default_password->setEchoMode( KLineEdit::Password ); + default_password->setMinimumWidth( 150 ); + QWhatsThis::add( default_password, i18n( "This password is used by default to authenticate to a remote server. It may be empty." ) ); + + auth_grid->addWidget( login, 0, 0 ); + auth_grid->addWidget( default_login, 0, 1 ); + auth_grid->addWidget( password, 1, 0 ); + auth_grid->addWidget( default_password, 1, 1 ); + + QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + grid->addWidget( password_group, 0, 0, 0 ); + grid->addWidget( login_box, 1, 0, 0 ); + grid->addItem( spacer2, 2, 0 ); + + connect( use_wallet, SIGNAL( stateChanged( int ) ), + this, SLOT( slotKWalletButtonState( int ) ) ); + connect( default_auth, SIGNAL( stateChanged( int ) ), + this, SLOT( slotDefaultAuthButtonState( int ) ) ); + + slotKWalletButtonState( use_wallet->state() ); + slotDefaultAuthButtonState( default_auth->state() ); +} + + +Smb4KAuthOptions::~Smb4KAuthOptions() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KAuthOptions::slotKWalletButtonState( int state ) +{ + if ( state == QCheckBox::On ) + { + static_cast( child( "DefaultLoginBox", "QGroupBox", true ) )->setEnabled( true ); + } + else if ( state == QCheckBox::Off ) + { + static_cast( child( "DefaultLoginBox", "QGroupBox", true ) )->setEnabled( false ); + } +} + + +void Smb4KAuthOptions::slotDefaultAuthButtonState( int state ) +{ + if ( state == QCheckBox::On ) + { + static_cast( child( "DefaultAuthWidget", "QWidget", true ) )->setEnabled( true ); + } + else if ( state == QCheckBox::Off ) + { + static_cast( child( "DefaultAuthWidget", "QWidget", true ) )->setEnabled( false ); + } +} + + + +#include "smb4kauthoptions.moc" diff --git a/smb4k/configdlg/smb4kauthoptions.h b/smb4k/configdlg/smb4kauthoptions.h new file mode 100644 index 0000000..5428ede --- /dev/null +++ b/smb4k/configdlg/smb4kauthoptions.h @@ -0,0 +1,81 @@ +/*************************************************************************** + smb4kauthoptions - The configuration page for the authentication + settings of Smb4K + ------------------- + begin : Sa Nov 15 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KAUTHOPTIONS_H +#define SMB4KAUTHOPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + + +/** + * This is the configuration tab for the authentication settings + * of Smb4K. + * + * @author Alexander Reinholdt + */ + + +class Smb4KAuthOptions : public QWidget +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent widget + * + * @param name The name of this widget + */ + Smb4KAuthOptions( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KAuthOptions(); + + protected slots: + /** + * This slot manages the toggling of the KWallet support button in the + * Authentication tab. + * + * @param state The toggle state + */ + void slotKWalletButtonState( int state ); + /** + * This slot manages the toggling of the default authentication button. + * + * @param state The toggle state + */ + void slotDefaultAuthButtonState( int state ); +}; + +#endif diff --git a/smb4k/configdlg/smb4kconfigdialog.cpp b/smb4k/configdlg/smb4kconfigdialog.cpp new file mode 100644 index 0000000..449aec3 --- /dev/null +++ b/smb4k/configdlg/smb4kconfigdialog.cpp @@ -0,0 +1,1222 @@ +/*************************************************************************** + smb4kconfigdialog - The configuration dialog of Smb4K + ------------------- + begin : Sa Apr 14 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include +#include +#include + +// system specific includes +#include +#include + +// application specific includes +#include "smb4kconfigdialog.h" +#include "smb4kuserinterfaceoptions.h" +#include "smb4knetworkoptions.h" +#include "smb4kshareoptions.h" +#include "smb4kauthoptions.h" +#include "smb4ksuperuseroptions.h" +#include "smb4ksambaoptions.h" +#include "smb4krsyncoptions.h" +#include "../core/smb4ksettings.h" +#include "../core/smb4kglobal.h" +#include "../core/smb4ksambaoptionsinfo.h" +#include "../core/smb4ksambaoptionshandler.h" +#include "../core/smb4kcore.h" +#include "../core/smb4kauthinfo.h" +#include "../core/smb4kpasswordhandler.h" + +using namespace Smb4KGlobal; + +KInstance *Smb4KConfigDialogFactory::m_instance = 0L; +KAboutData *Smb4KConfigDialogFactory::m_about = 0L; + +// Variables we need to determine if super user entries +// have to be written to /etc/sudoers or /etc/super.tab +bool use_sudo = false; +bool use_super = false; +#ifdef __linux__ +bool force_unmount = false; +#endif +bool always_use_su = false; + +// Use this variable to determine if the dialog should be +// closed after Smb4KFileIO::finished() was emitted. +bool close_dialog = false; + + +Smb4KConfigDialog::Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent, const char *name ) +: KConfigDialog( parent, name, settings ) +{ + // FIXME: I guess, normally we would not need to close destructively, + // but at the moment there are issues with the KURLRequester in file + // mode. To work around those, we are closing the dialog destructively. + // Maybe we can remove this if we moved to KDE4. + setWFlags( Qt::WDestructiveClose ); + + // Add the pages: + Smb4KUserInterfaceOptions *interface_options = new Smb4KUserInterfaceOptions( this, "UserInterfaceOptions" ); + Smb4KNetworkOptions* network_options = new Smb4KNetworkOptions( this, "NetworkOptions" ); + Smb4KShareOptions *share_options= new Smb4KShareOptions( this, "ShareOptions" ); + Smb4KAuthOptions *auth_options = new Smb4KAuthOptions( this, "AuthenticationOptions" ); + Smb4KSambaOptions *samba_options = new Smb4KSambaOptions( this, "SambaOptions" ); + Smb4KRsyncOptions *rsync_options = new Smb4KRsyncOptions( this, "SynchronizationOptions" ); + Smb4KSuperUserOptions *super_user_options = new Smb4KSuperUserOptions( this, "SuperUserOptions" ); + + // Disable widgets if the respective programs are not installed. + if ( Smb4KSettings::rsync().isEmpty() ) + { + rsync_options->setEnabled( false ); + } + + if ( Smb4KSettings::sudo().isEmpty() && Smb4KSettings::super().isEmpty() ) + { + super_user_options->setEnabled( false ); + } + else + { + // The search for the programs and all related actions have been + // done by the core. We only need to disable widgets here. + if ( Smb4KSettings::sudo().isEmpty() ) + { + QRadioButton *sudo = static_cast( super_user_options->child( "SudoButton", "QRadioButton", true ) ); + + if ( sudo ) + { + sudo->setEnabled( false ); + } + } + else if ( Smb4KSettings::super().isEmpty() ) + { + QRadioButton *super = static_cast( super_user_options->child( "SuperButton", "QRadioButton", true ) ); + + if ( super ) + { + super->setEnabled( false ); + } + } + else + { + // Do nothing + } + } + + // There are a few settings we need to the initial values of. + // Initialize them here: + switch ( Smb4KSettings::superUserProgram() ) + { + case Smb4KSettings::EnumSuperUserProgram::Sudo: + { + use_sudo = true; + + break; + } + case Smb4KSettings::EnumSuperUserProgram::Super: + { + use_super = true; + + break; + } + default: + { + break; + } + } + + +#ifdef __linux__ + force_unmount = Smb4KSettings::useForceUnmount(); +#endif + always_use_su = Smb4KSettings::alwaysUseSuperUser(); + + // Now add the pages to the configuration dialog + addPage( interface_options, i18n( "User Interface" ), "view_choose" ); + addPage( network_options, i18n( "Network" ), "network" ); + addPage( share_options, i18n( "Shares" ), "hdd_mount" ); + addPage( auth_options, i18n( "Authentication" ), "identity" ); + addPage( samba_options, i18n( "Samba" ), "samba" ); + addPage( rsync_options, i18n( "Synchronization" ), "bottom" ); + addPage( super_user_options, i18n( "Super User" ), "penguin" ); + + // Stuff that's not managed by KConfig XT is loaded by + // Smb4KConfigDialog::showEvent()! + + // Resize the dialog + setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" ) ); + + // Connections + connect( samba_options, SIGNAL( customSettingsChanged() ), + this, SLOT( slotCustomSambaSettingsChanged() ) ); + + connect( super_user_options, SIGNAL( removeEntries() ), + this, SLOT( slotRemoveSuperUserEntries() ) ); + + connect( Smb4KCore::fileIO(), SIGNAL( failed() ), + this, SLOT( slotReceivedFileIOFailed() ) ); + + connect( Smb4KCore::fileIO(), SIGNAL( finished() ), + this, SLOT( slotReceivedFileIOFinished() ) ); +} + + +Smb4KConfigDialog::~Smb4KConfigDialog() +{ +} + + +void Smb4KConfigDialog::loadCustomSambaOptions() +{ + // Get the list view: + KListView *custom_list = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( !custom_list ) + { + return; + } + + // First of all clear the list view: + custom_list->clear(); + + // Now get the default values: + QString default_filesystem, protocol_hint, default_uid, default_gid; + bool write_access = true; + + switch( Smb4KSettings::filesystem() ) + { + case Smb4KSettings::EnumFilesystem::CIFS: + { + default_filesystem = "cifs"; + + break; + } + case Smb4KSettings::EnumFilesystem::SMBFS: + { + default_filesystem = "smbfs"; + + break; + } + default: + { + // FIXME: Set default_filesystem to "cifs"? + break; + } + } + + switch ( Smb4KSettings::protocolHint() ) + { + case Smb4KSettings::EnumProtocolHint::Automatic: + { + // In this case the user leaves it to the net + // command to determine the right protocol. + protocol_hint = QString::null; + + break; + } + case Smb4KSettings::EnumProtocolHint::RPC: + { + protocol_hint = "rpc"; + + break; + } + case Smb4KSettings::EnumProtocolHint::RAP: + { + protocol_hint = "rap"; + + break; + } + case Smb4KSettings::EnumProtocolHint::ADS: + { + protocol_hint = "ads"; + + break; + } + default: + { + protocol_hint = QString::null; + + break; + } + } + + switch( Smb4KSettings::writeAccess() ) + { + case Smb4KSettings::EnumWriteAccess::ReadWrite: + { + write_access = true; + + break; + } + case Smb4KSettings::EnumWriteAccess::ReadOnly: + { + write_access = false; + + break; + } + default: + { + break; + } + } + + const QValueList &list = optionsHandler()->customOptionsList(); + + for ( QValueList::ConstIterator it = list.begin(); + it != list.end(); ++it ) + { + // If the only modification is that the share is to be remounted, + // we will not put it into the list: + if ( (*it)->type() == Smb4KSambaOptionsInfo::Share && + (*it)->remount() && + (*it)->port() == Smb4KSettings::remotePort() && +#ifndef __FreeBSD__ + QString::compare( (*it)->filesystem(), default_filesystem ) == 0 && + (*it)->writeAccess() == write_access && + (*it)->kerberos() == Smb4KSettings::useKerberos() /* FreeBSD does not know Kerberos for mounting */ && +#endif + ((QString::compare( default_filesystem, "cifs" ) == 0 && (*it)->uid().toInt() == (int)getuid()) || + (!(*it)->uid().isEmpty() && QString::compare( (*it)->uid(), Smb4KSettings::userID() ) == 0)) && + ((QString::compare( default_filesystem, "cifs" ) == 0 && (*it)->gid().toInt() == (int)getgid()) || + (!(*it)->gid().isEmpty() && QString::compare( (*it)->gid(), Smb4KSettings::groupID() ) == 0)) ) + { + continue; + } + + // Now put the item in the list: + KListViewItem *item = new KListViewItem( custom_list ); + + item->setText( Smb4KSambaOptions::ItemName, (*it)->itemName() ); + + item->setText( Smb4KSambaOptions::Port, ((*it)->port() != -1 ? + QString( "%1" ).arg( (*it)->port() ) : + QString( "%1" ).arg( Smb4KSettings::remotePort() )) ); + + switch ( (*it)->type() ) + { + case Smb4KSambaOptionsInfo::Host: + { + item->setText( Smb4KSambaOptions::Protocol, !(*it)->protocol().isEmpty() ? + (QString::compare( (*it)->protocol(), "auto" ) == 0 ? i18n( "auto" ) : (*it)->protocol().upper()) : + (protocol_hint.isEmpty() ? i18n( "auto" ) : protocol_hint.upper()) ); + + item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ? + i18n( "yes" ) : + i18n( "no" ) ); + +#ifndef __FreeBSD__ + item->setText( Smb4KSambaOptions::FileSystem, "-" ); + + item->setText( Smb4KSambaOptions::WriteAccess, "-" ); +#endif + + item->setText( Smb4KSambaOptions::UID, "-" ); + + item->setText( Smb4KSambaOptions::GID, "-" ); + + break; + } + case Smb4KSambaOptionsInfo::Share: + { + item->setText( Smb4KSambaOptions::Protocol, "-" ); + +#ifndef __FreeBSD__ + item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ? + i18n( "yes" ) : + i18n( "no" ) ); + + item->setText( Smb4KSambaOptions::FileSystem, !(*it)->filesystem().isEmpty() ? + (*it)->filesystem().upper() : + default_filesystem.upper() ); + + item->setText( Smb4KSambaOptions::WriteAccess, (*it)->writeAccess() ? + i18n( "read-write" ) : + i18n( "read-only" ) ); +#else + // FreeBSD does not know Kerberos for mounting + item->setText( Smb4KSambaOptions::Kerberos, "-" ); +#endif + item->setText( Smb4KSambaOptions::UID, !(*it)->uid().isEmpty() ? + (*it)->uid() : + Smb4KSettings::userID() ); + + item->setText( Smb4KSambaOptions::GID, !(*it)->gid().isEmpty() ? + (*it)->gid() : + Smb4KSettings::groupID() ); + + break; + } + default: + { + break; + } + } + } + + Smb4KSambaOptions *samba_options = static_cast( child( "SambaOptions", "Smb4KSambaOptions", true ) ); + + if ( samba_options ) + { + samba_options->resetCustomTab(); + } +} + + +void Smb4KConfigDialog::saveCustomSambaOptions() +{ + // Get the list view: + KListView *custom_list = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( !custom_list ) + { + return; + } + + if ( custom_list->childCount() != 0 ) + { + // First remove all items that have been deleted in the + // configuration dialog: + QValueList list = optionsHandler()->customOptionsList(); + + for ( QValueList::Iterator it = list.begin(); it != list.end(); ++it ) + { + if ( !custom_list->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName ) ) + { + optionsHandler()->removeItem( (*it)->itemName(), false ); + + continue; + } + else + { + continue; + } + } + + // Now updated the remaining items: + QListViewItemIterator it( custom_list ); + + while ( it.current() ) + { + QListViewItem *item = it.current(); + + Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( item->text( Smb4KSambaOptions::ItemName ) ); + + if ( info ) + { + switch( info->type() ) + { + case Smb4KSambaOptionsInfo::Host: + { + info->setProtocol( (QString::compare( item->text( Smb4KSambaOptions::Protocol ), "-" ) != 0 ? + item->text( Smb4KSambaOptions::Protocol ).lower() : + QString::null) ); + + info->setKerberos( (QString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) ); + + info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() ); + + break; + } + case Smb4KSambaOptionsInfo::Share: + { +#ifndef __FreeBSD__ + // FreeBSD does not know Kerberos for mounting + info->setKerberos( (QString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) ); + + info->setFilesystem( (QString::compare( item->text( Smb4KSambaOptions::FileSystem ), "-" ) != 0 ? + item->text( Smb4KSambaOptions::FileSystem ).lower() : + QString::null) ); + + info->setWriteAccess( (QString::compare( item->text( Smb4KSambaOptions::WriteAccess ), + i18n( "read-write" ) ) == 0) ); +#endif + info->setUID( (QString::compare( item->text( Smb4KSambaOptions::UID ), i18n( "default" ) ) != 0 && + QString::compare( item->text( Smb4KSambaOptions::UID ), "-" ) != 0) ? + item->text( Smb4KSambaOptions::UID ) : + QString::null ); + + info->setGID( (QString::compare( item->text( Smb4KSambaOptions::GID ), i18n( "default" ) ) != 0 && + QString::compare( item->text( Smb4KSambaOptions::GID ), "-" ) != 0) ? + item->text( Smb4KSambaOptions::GID ) : + QString::null ); + + info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() ); + + break; + } + default: + { + break; + } + } + } + else + { + // We do not have this case. + } + + ++it; + } + } + else + { + // Remove all items, if the list view is empty: + QValueList list = optionsHandler()->customOptionsList(); + + for ( QValueList::Iterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it)->remount() ) + { + optionsHandler()->removeItem( (*it)->itemName(), false ); + + continue; + } + else + { + continue; + } + } + } + + optionsHandler()->sync(); +} + + +void Smb4KConfigDialog::loadAuthenticationData() +{ + // Load the default login info and put it into the configuration + // page: + Smb4KAuthInfo auth( QString::null, QString::null, QString::null ); + + (void) passwordHandler()->readDefaultAuth( &auth ); + + KLineEdit *default_user = static_cast( child( "DefaultUserName", "KLineEdit", true ) ); + + if ( default_user ) + { + default_user->setText( auth.user() ); + } + + KLineEdit *default_pass = static_cast( child( "DefaultPassword", "KLineEdit", true ) ); + + if ( default_pass ) + { + default_pass->setText( auth.password() ); + } +} + + +void Smb4KConfigDialog::saveAuthenticationData() +{ + // Read the default login info from the configuration page + // and pass it to the password handler, but only if the wallet + // is open at this time. Otherwise we could end up with empty + // entries: + if ( passwordHandler()->walletIsOpen() ) + { + Smb4KAuthInfo auth( QString::null, QString::null, QString::null ); + + KLineEdit *default_user = static_cast( child( "DefaultUserName", "KLineEdit", true ) ); + + if ( default_user ) + { + auth.setUser( default_user->text() ); + } + + KLineEdit *default_pass = static_cast( child( "DefaultPassword", "KLineEdit", true ) ); + + if ( default_pass ) + { + auth.setPassword( default_pass->text() ); + } + + passwordHandler()->writeDefaultAuth( &auth ); + } + else + { + // Do nothing + } +} + + +bool Smb4KConfigDialog::writeSuperUserEntries() +{ + QRadioButton *sudo = static_cast( child( "SudoButton", "QRadioButton", true ) ); + QRadioButton *super = static_cast( child( "SuperButton", "QRadioButton", true ) ); +#ifdef __linux__ + QCheckBox *force = static_cast( child( "kcfg_UseForceUnmount", "QCheckBox", true ) ); +#endif + QCheckBox *full_use = static_cast( child( "kcfg_AlwaysUseSuperUser", "QCheckBox", true ) ); + + // Check if we need to write anything at all: + Smb4KFileIO::Operation op = Smb4KFileIO::NoOperation; + bool success = true; + +#ifdef __linux__ + if ( sudo && super && force && full_use ) +#else + if ( sudo && super && full_use ) +#endif + { + if ( sudo->isChecked() ) + { +#ifdef __linux__ + if ( (!use_sudo && (force->isChecked() || full_use->isChecked())) || + (use_sudo && + ((force->isChecked() && force_unmount != force->isChecked()) || + (full_use->isChecked() && always_use_su != full_use->isChecked()))) ) +#else + if ( (!use_sudo && full_use->isChecked()) || + (use_sudo && + (full_use->isChecked() && always_use_su != full_use->isChecked())) ) +#endif + { + success = Smb4KCore::fileIO()->writeSudoers( (op = Smb4KFileIO::Insert) ); + } + } + else if ( super->isChecked() ) + { +#ifdef __linux__ + if ( (!use_super && (force->isChecked() || full_use->isChecked())) || + (use_super && + ((force->isChecked() && force_unmount != force->isChecked()) || + (full_use->isChecked() && always_use_su != full_use->isChecked()))) ) +#else + if ( (!use_super && full_use->isChecked()) || + (use_super && + (full_use->isChecked() && always_use_su != full_use->isChecked())) ) +#endif + { + success = Smb4KCore::fileIO()->writeSuperTab( (op = Smb4KFileIO::Insert) ); + } + } + else + { + // Do nothing + } + + use_sudo = sudo->isChecked(); + use_super = super->isChecked(); +#ifdef __linux__ + force_unmount = force->isChecked(); +#endif + always_use_su = full_use->isChecked(); + } + else + { + // Do nothing + } + + return (!success || op == Smb4KFileIO::NoOperation) ? false : true; +} + + +void Smb4KConfigDialog::removeSuperUserEntries() +{ + QRadioButton *sudo = static_cast( child( "SudoButton", "QRadioButton", true ) ); + QRadioButton *super = static_cast( child( "SuperButton", "QRadioButton", true ) ); +#ifdef __linux__ + QCheckBox *force = static_cast( child( "kcfg_UseForceUnmount", "QCheckBox", true ) ); +#endif + QCheckBox *full_use = static_cast( child( "kcfg_AlwaysUseSuperUser", "QCheckBox", true ) ); + +#ifdef __linux__ + if ( sudo && super && force && full_use ) +#else + if ( sudo && super && full_use ) +#endif + + { + if ( sudo->isChecked() ) + { + Smb4KCore::fileIO()->writeSudoers( Smb4KFileIO::Remove ); + } + else if ( super->isChecked() ) + { + Smb4KCore::fileIO()->writeSuperTab( Smb4KFileIO::Remove ); + } + else + { + // Do nothing + } + +#ifdef __linux__ + force->setChecked( false ); +#endif + full_use->setChecked( false ); + + use_sudo = sudo->isChecked(); + use_super = super->isChecked(); +#ifdef __linux__ + force_unmount = force->isChecked(); +#endif + always_use_su = full_use->isChecked(); + } + else + { + // Do nothing + } +} + + +bool Smb4KConfigDialog::checkSettings() +{ + bool ok = true; + QString issues = QString::null; + int index = 0; + + // If the user chose "Query custom master browser" in the + // "Network" tab, there must be a master browser present: + QRadioButton *query_custom_master = static_cast( child( "CustomMasterBrowserLabel", "QRadioButton", true ) ); + KLineEdit *custom_master_input = static_cast( child( "kcfg_CustomMasterBrowser", "KLineEdit", true ) ); + + if ( query_custom_master && custom_master_input && + query_custom_master->isChecked() && + custom_master_input->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Network] The custom master browser has not been entered.\n" ) ); + } + + // If the user chose "Scan broadcast areas" in the + // "Network" tab, there must broadcast areas present: + QRadioButton *scan_bcast_areas = static_cast( child( "BroadcastAreasLabel", "QRadioButton", true ) ); + KLineEdit *bcast_areas_input = static_cast( child( "kcfg_BroadcastAreas", "KLineEdit", true ) ); + + if ( scan_bcast_areas && bcast_areas_input && + scan_bcast_areas->isChecked() && + bcast_areas_input->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Network] The broadcast areas have not been entered.\n" ) ); + } + + // The mount prefix must not be empty: + KURLRequester *mount_prefix = static_cast( child( "kcfg_MountPrefix", "KURLRequester", true ) ); + + if ( mount_prefix && mount_prefix->url().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Shares] The mount prefix is empty.\n" ) ); + } + + // If the user wants to use a default login, the user + // name must not be empty. + QCheckBox *use_default_login = static_cast( child( "kcfg_UseDefaultLogin", "QCheckBox", true ) ); + KLineEdit *default_user_name = static_cast( child( "kcfg_DefaultUserName", "KLineEdit", true ) ); + + if ( use_default_login && default_user_name && + use_default_login->isChecked() && + default_user_name->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Authentication] The default user name has not been entered.\n" ) ); + } + + // The file mask must not be empty. + KLineEdit *file_mask = static_cast( child( "kcfg_FileMask", "KLineEdit", true ) ); + + if ( file_mask && file_mask->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Samba] The file mask is empty.\n" ) ); + } + + // The directory mask must not be empty. + KLineEdit *directory_mask = static_cast( child( "kcfg_DirectoryMask", "KLineEdit", true ) ); + + if ( directory_mask && directory_mask->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Samba] The directory mask is empty.\n" ) ); + } + + // The UID must not be empty. + KLineEdit *user_id = static_cast( child( "kcfg_UserID", "KLineEdit", true ) ); + + if ( user_id && user_id->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Samba] The UID is empty.\n" ) ); + } + + // The GID must not be empty. + KLineEdit *group_id = static_cast( child( "kcfg_GroupID", "KLineEdit", true ) ); + + if ( group_id && group_id->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Samba] The GID is empty.\n" ) ); + } + + // The rsync prefix must not be empty. + KURLRequester *rsync_prefix = static_cast( child( "kcfg_RsyncPrefix", "KURLRequester", true ) ); + + if ( rsync_prefix && rsync_prefix->url().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The rsync prefix is empty.\n" ) ); + } + + // The path where to store partial files must not be empty. + QCheckBox *use_partical_directory = static_cast( child( "kcfg_UsePartialDirectory", "QCheckBox", true ) ); + KURLRequester *partial_directory = static_cast( child( "kcfg_PartialDirectory", "KURLRequester", true ) ); + + if ( use_partical_directory && use_partical_directory->isChecked() && + partial_directory && partial_directory->url().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The directory where partially transferred files should be stored is empty.\n" ) ); + } + + // The the exclude patterns must not be empty. + QCheckBox *use_exclude_pattern = static_cast( child( "kcfg_UseExcludePattern", "QCheckBox", true ) ); + KLineEdit *exclude_pattern = static_cast( child( "kcfg_ExcludePattern", "KLineEdit", true ) ); + + if ( use_exclude_pattern && use_exclude_pattern->isChecked() && + exclude_pattern && exclude_pattern->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The exclude patterns have not been entered.\n" ) ); + } + + // The the path of the exclude file must not be empty. + QCheckBox *use_exclude_file = static_cast( child( "kcfg_UseExcludeFrom", "QCheckBox", true ) ); + KURLRequester *exclude_file = static_cast( child( "kcfg_ExcludeFrom", "KURLRequester", true ) ); + + if ( use_exclude_file && use_exclude_file->isChecked() && + exclude_file && exclude_file->url().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The path of the exclude file is empty.\n" ) ); + } + + // The the include patterns must not be empty. + QCheckBox *use_include_pattern = static_cast( child( "kcfg_UseIncludePattern", "QCheckBox", true ) ); + KLineEdit *include_pattern = static_cast( child( "kcfg_IncludePattern", "KLineEdit", true ) ); + + if ( use_include_pattern && use_include_pattern->isChecked() && + include_pattern && include_pattern->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The include patterns have not been entered.\n" ) ); + } + + // The the path of the exclude file must not be empty. + QCheckBox *use_include_file = static_cast( child( "kcfg_UseIncludeFrom", "QCheckBox", true ) ); + KURLRequester *include_file = static_cast( child( "kcfg_IncludeFrom", "KURLRequester", true ) ); + + if ( use_include_file && use_include_file->isChecked() && + include_file && include_file->url().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The path of the include file is empty.\n" ) ); + } + + // If you make backups, check that the suffix and that the + // backup directory is not empty. + QCheckBox *make_backups = static_cast( child( "kcfg_MakeBackups", "QCheckBox", true ) ); + + if ( make_backups && make_backups->isChecked() ) + { + // The backup suffix must not be empty. + QCheckBox *use_backup_suffix = static_cast( child( "kcfg_UseBackupSuffix", "QCheckBox", true ) ); + KLineEdit *backup_suffix = static_cast( child( "kcfg_BackupSuffix", "KLineEdit", true ) ); + + if ( use_backup_suffix && use_backup_suffix->isChecked() && + backup_suffix && backup_suffix->text().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The backup suffix has not been defined.\n" ) ); + } + + // The the path for backups must not be empty. + QCheckBox *use_backup_dir = static_cast( child( "kcfg_UseBackupDirectory", "QCheckBox", true ) ); + KURLRequester *backup_dir = static_cast( child( "kcfg_BackupDirectory", "KURLRequester", true ) ); + + if ( use_backup_dir && use_backup_dir->isChecked() && + backup_dir && backup_dir->url().stripWhiteSpace().isEmpty() ) + { + ok = false; + index++; + + issues.append( "* "+i18n( "[Synchronization] The backup directory is empty.\n" ) ); + } + } + + if ( !ok ) + { + if ( index == 1 ) + { + KMessageBox::error( this, i18n( "The configuration could not be written, because one setting is incomplete:\n%1Please correct this issue." ).arg( issues ) ); + } + else + { + KMessageBox::error( this, i18n( "The configuration could not be written, because %1 settings are incomplete:\n%1Please correct these issues." ).arg( index ).arg( issues ) ); + } + } + + return ok; +} + + +void Smb4KConfigDialog::showEvent( QShowEvent *e ) +{ + // Spontaneous show events come from outside the application. + // We do not want to react on them. + if ( !e->spontaneous() ) + { + loadCustomSambaOptions(); + loadAuthenticationData(); + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KConfigDialog::slotApply() +{ + // If some settings are not complete, stop here and give + // the user the opportunity to fill in the needed string(s). + if ( !checkSettings() ) + { + return; + } + + saveCustomSambaOptions(); + saveAuthenticationData(); + + if ( writeSuperUserEntries() ) + { + // Disable this widget until Smb4KFileIO::finished() + // is received. + setEnabled( false ); + } + + // The 'Apply' button will be disabled by KConfigDialog, so we do not + // need to do it here. + + KConfigDialog::slotApply(); +} + + +void Smb4KConfigDialog::slotOk() +{ + // If some settings are not complete, stop here and give + // the user the opportunity to fill in the needed string(s). + if ( !checkSettings() ) + { + return; + } + + saveCustomSambaOptions(); + saveAuthenticationData(); + + saveDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" ); + + // If the something needs to be written to either /etc/super.tab + // or /etc/sudoers, do not close the dialog but wait until the + // Smb4KFileIO::finished() signal is received. + if ( !writeSuperUserEntries() ) + { + KConfigDialog::slotOk(); + } + else + { + // Disable this widget until Smb4KFileIO::finished() + // is received. + setEnabled( false ); + + // Tell Smb4KConfigDialog::slotReceivedFileIOFinished() + // to close the dialog. + close_dialog = true; + } +} + + +void Smb4KConfigDialog::slotCancel() +{ + // Reset the custom Samba options tab: + Smb4KSambaOptions *samba_options = static_cast( child( "SambaOptions", "Smb4KSambaOptions", true ) ); + + if ( samba_options ) + { + samba_options->resetCustomTab(); + } + + KConfigDialog::slotCancel(); +} + + +void Smb4KConfigDialog::slotCustomSambaSettingsChanged() +{ + // Get the list view and all other input widgets: + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( !view ) + { + return; + } + + // Get the list of custom options: + QValueList list = optionsHandler()->customOptionsList(); + + bool changed = false; + + // Loop through the list view items to see what changed and if + // we need to enable the 'Apply' button: + for ( QValueList::ConstIterator it = list.begin(); + it != list.end(); ++it ) + { + // Find the item in the list view: + QListViewItem *item = view->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName ); + + if ( item ) + { + if ( (*it)->type() == Smb4KSambaOptionsInfo::Host ) + { + // Check if the protocol changed. + if ( ((*it)->protocol().isEmpty() && + QString::compare( item->text( Smb4KSambaOptions::Protocol ).lower(), i18n( "auto" ) ) != 0) || + QString::compare( (*it)->protocol(), item->text( Smb4KSambaOptions::Protocol ).lower() ) != 0 ) + { + changed = true; + + break; + } + } + else if ( (*it)->type() == Smb4KSambaOptionsInfo::Share ) + { +#ifndef __FreeBSD__ + // Check if the file system changed. + if ( QString::compare( (*it)->filesystem(), item->text( Smb4KSambaOptions::FileSystem ).lower() ) != 0 ) + { + changed = true; + + break; + } + + // Check if the write access changed. + QString write_access = (*it)->writeAccess() ? + i18n( "read-write" ) : + i18n( "read-only" ); + + if ( QString::compare( write_access, item->text( Smb4KSambaOptions::WriteAccess ) ) != 0 ) + { + changed = true; + + break; + } +#endif + // Check if the UID changed. + if ( ((*it)->uid().isEmpty() && + QString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::UID ) ) != 0) || + QString::compare( (*it)->uid(), item->text( Smb4KSambaOptions::UID ) ) != 0 ) + { + changed = true; + + break; + } + + // Check if the GID changed. + if ( ((*it)->gid().isEmpty() && + QString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::GID ) ) != 0) || + QString::compare( (*it)->gid(), item->text( Smb4KSambaOptions::GID ) ) != 0 ) + { + changed = true; + + break; + } + } + else + { + // Something went wrong. Stop right here. + break; + } + + // Check if the Kerberos entry changed. + QString kerberos = (*it)->kerberos() ? + i18n( "yes" ) : + i18n( "no" ); + + if ( QString::compare( kerberos, item->text( Smb4KSambaOptions::Kerberos ) ) != 0 ) + { + changed = true; + + break; + } + + // Check if the port value changed. + if ( (*it)->port() != item->text( Smb4KSambaOptions::Port ).toInt() ) + { + changed = true; + + break; + } + } + else + { + break; + } + } + + enableButtonApply( changed ); +} + + +void Smb4KConfigDialog::slotRemoveSuperUserEntries() +{ + // Disable this widget until Smb4KFileIO::finished() + // is received. + setEnabled( false ); + + removeSuperUserEntries(); +} + + +void Smb4KConfigDialog::slotReceivedFileIOFailed() +{ +#ifdef __linux__ + QCheckBox *force = static_cast( child( "kcfg_UseForceUnmount", "QCheckBox", true ) ); +#endif + QCheckBox *full_use = static_cast( child( "kcfg_AlwaysUseSuperUser", "QCheckBox", true ) ); + +#ifdef __linux__ + if ( force && full_use ) + { + force->setChecked( false ); +#else + if ( full_use ) + { +#endif + full_use->setChecked( false ); + } +} + + +void Smb4KConfigDialog::slotReceivedFileIOFinished() +{ + // Enable the widget again. + setEnabled( true ); + + if ( close_dialog ) + { + KConfigDialog::slotOk(); + } +} + + +///////////////////////////////////////////////////////////////////////////// +// FACTORY STUFF +///////////////////////////////////////////////////////////////////////////// + +Smb4KConfigDialogFactory::Smb4KConfigDialogFactory() +: KLibFactory() +{ +} + + +Smb4KConfigDialogFactory::~Smb4KConfigDialogFactory() +{ + delete m_instance; + delete m_about; + + m_instance = 0L; +} + + +KInstance *Smb4KConfigDialogFactory::instance() +{ + if( !m_instance ) + { + m_about = new KAboutData( "smb4kconfigdialog", I18N_NOOP( "Smb4KConfigDialog" ), "1.0" ); + m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de"); + m_about->setLicense( KAboutData::License_GPL ); + m_instance = new KInstance( m_about ); + } + + return m_instance; +} + + +QObject *Smb4KConfigDialogFactory::createObject( QObject *parent, const char *name, const char *, +const QStringList & ) +{ + return static_cast( new Smb4KConfigDialog( Smb4KSettings::self(), static_cast( parent ), name ) ); +} + + +///////////////////////////////////////////////////////////////////////////// +// INIT +///////////////////////////////////////////////////////////////////////////// + + +extern "C" +{ + void *init_libsmb4kconfigdialog() + { + KGlobal::locale()->insertCatalogue( "smb4k" ); + return new Smb4KConfigDialogFactory; + } +} + +#include "smb4kconfigdialog.moc" diff --git a/smb4k/configdlg/smb4kconfigdialog.h b/smb4k/configdlg/smb4kconfigdialog.h new file mode 100644 index 0000000..8e6f9f8 --- /dev/null +++ b/smb4k/configdlg/smb4kconfigdialog.h @@ -0,0 +1,208 @@ +/*************************************************************************** + smb4kconfigdialog - The configuration dialog of Smb4K + ------------------- + begin : Sa Apr 14 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KCONFIGDIALOG_H +#define SMB4KCONFIGDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include +#include +#include + +// forward declarations +class Smb4KSettings; + +/** + * This is the (new) configuration dialog of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KConfigDialog : public KConfigDialog +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param settings The Smb4KSettings object that needs to be passed + * so that the settings can be managed. + * + * @param parent The parent widget + * + * @param name The name of this dialog + */ + Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KConfigDialog(); + + protected: + /** + * Reimplemented from QWidget to do last things before the + * configuration dialog is shown. + * + * @param e The show event object + */ + void showEvent( QShowEvent *e ); + + protected slots: + /** + * Reimplemented from KConfigDialog. This slot does application + * specific stuff first and then executes KConfigDialog::slotApply(). + */ + void slotApply(); + + /** + * Reimplemented from KConfigDialog. This slot does application + * specific stuff first and then executes KConfigDialog::slotOk(). + */ + void slotOk(); + + /** + *Reimplemented from KConfigDialog. This slot does application + * specific stuff first and then executes KConfigDialog::slotCancel(). + */ + void slotCancel(); + + /** + * The custom Samba settings changed. Decide if we have to + * enable the 'Apply' button or not. + */ + void slotCustomSambaSettingsChanged(); + + /** + * The 'Remove Entries' button in the 'Super User' page has been + * clicked. Initialize the removal of Smb4K's configuration entries + * from the configuration file of the currently chosen program. + */ + void slotRemoveSuperUserEntries(); + + /** + * This slot is activated if the Smb4KFileIO::failed() signal is + * received. It deselects all check boxes in the "Super User" page. + */ + void slotReceivedFileIOFailed(); + + /** + * This slot is activated if the Smb4KFileIO::finished() signal is + * received. It closes the dialog by invoking KConfigDialog::slotOk(). + */ + void slotReceivedFileIOFinished(); + + private: + /** + * Load the custom Samba options + */ + void loadCustomSambaOptions(); + + /** + * Save the custom Samba options + */ + void saveCustomSambaOptions(); + + /** + * Load the authentication data + */ + void loadAuthenticationData(); + + /** + * Save the authentication data + */ + void saveAuthenticationData(); + + /** + * Write super user configuration entries to configuration file. + * + * @returns TRUE if something needs to be written. + */ + bool writeSuperUserEntries(); + + /** + * Remove super user configuration entries from the configuration file. + */ + void removeSuperUserEntries(); + + /** + * Checks that mandatorily needed input is provided for settings that + * need it. This function will report all missing input to the user + * via a message box. + * + * @returns TRUE if the check passed and FALSE if it failed. + */ + bool checkSettings(); +}; + + +class KInstance; +class KAboutData; + + +class Smb4KConfigDialogFactory : KLibFactory +{ + Q_OBJECT + + public: + /** + * The constructor. + */ + Smb4KConfigDialogFactory(); + + /** + * The destructor. + */ + virtual ~Smb4KConfigDialogFactory(); + + /** + * The instance + */ + static KInstance *instance(); + + protected: + QObject *createObject( QObject *parent = 0, const char *name = 0, + const char *classname = "QObject", + const QStringList &args = QStringList() ); + + private: + /** + * The factory's instance + */ + static KInstance *m_instance; + + /** + * The factory's KAboutData object + */ + static KAboutData *m_about; +}; + +#endif diff --git a/smb4k/configdlg/smb4knetworkoptions.cpp b/smb4k/configdlg/smb4knetworkoptions.cpp new file mode 100644 index 0000000..4c2244b --- /dev/null +++ b/smb4k/configdlg/smb4knetworkoptions.cpp @@ -0,0 +1,107 @@ +/*************************************************************************** + smb4knetworkoptions - The configuration page for the network + settings of Smb4K + ------------------- + begin : Sa Nov 15 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include +#include +#include + +// application specific includes +#include "smb4knetworkoptions.h" +#include "../core/smb4ksettings.h" + +Smb4KNetworkOptions::Smb4KNetworkOptions( QWidget *parent, const char *name ) : QWidget( parent, name ) +{ + QGridLayout *grid = new QGridLayout( this ); + grid->setSpacing( 10 ); + + // + // The browse list group box. + // + QButtonGroup *browse_box = new QButtonGroup( 1, Qt::Horizontal, i18n( "Browse List" ), + this, "kcfg_BrowseList" ); + + browse_box->insert( new QRadioButton( i18n( "Scan the network neighborhood for available workgroups and domains" ), + browse_box ), Smb4KSettings::EnumBrowseList::LookupDomains ); + browse_box->insert( new QRadioButton( i18n( "Query the current workgroup master browser" ), + browse_box), Smb4KSettings::EnumBrowseList::QueryCurrentMaster ); + + QWidget *buttonWidget = new QWidget( browse_box ); + QGridLayout *buttonLayout = new QGridLayout( buttonWidget ); + buttonLayout->setSpacing( 5 ); + + QRadioButton *use_host = new QRadioButton( i18n( "Query this master browser:" ), + buttonWidget, "CustomMasterBrowserLabel" ); + KLineEdit *host_name = new KLineEdit( buttonWidget, "kcfg_CustomMasterBrowser" ); + QRadioButton *use_scan = new QRadioButton( i18n( "Scan broadcast areas:" ), + buttonWidget, "BroadcastAreasLabel" ); + KLineEdit *broadcast_addresses = new KLineEdit( buttonWidget, "kcfg_BroadcastAreas" ); + + buttonLayout->addWidget( use_host, 0, 0, 0 ); + buttonLayout->addWidget( host_name, 0, 1, 0 ); + buttonLayout->addWidget( use_scan, 1, 0, 0 ); + buttonLayout->addWidget( broadcast_addresses, 1, 1, 0 ); + + browse_box->insert( use_host, Smb4KSettings::EnumBrowseList::QueryCustomMaster ); + browse_box->insert( use_scan, Smb4KSettings::EnumBrowseList::ScanBroadcastAreas ); + + // + // The search group box + // + QButtonGroup *search_box = new QButtonGroup( 1, Qt::Horizontal, i18n( "Network Search" ), + this, "kcfg_SearchMethod" ); + search_box->setInsideSpacing( 5 ); + + QLabel *description = new QLabel( search_box ); + description->setText( i18n( "Smb4K uses \"nmblookup\" by default to search for remote hosts. This method is very reliable but fails sometimes if your network neighborhood is configured uncommonly. In this case you should try to use \"smbclient\"." ) ); + description->setTextFormat( Qt::RichText ); + + search_box->insert( new QRadioButton( i18n( "Use nmblookup (recommended)" ), + search_box ), Smb4KSettings::EnumSearchMethod::Nmblookup ); + + search_box->insert( new QRadioButton( i18n( "Use smbclient" ), + search_box ), Smb4KSettings::EnumSearchMethod::Smbclient ); + + QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + grid->addWidget( browse_box, 0, 0, 0 ); + grid->addWidget( search_box, 1, 0, 0 ); + grid->addItem( spacer4, 2, 0 ); +} + + +Smb4KNetworkOptions::~Smb4KNetworkOptions() +{ +} + + +#include "smb4knetworkoptions.moc" diff --git a/smb4k/configdlg/smb4knetworkoptions.h b/smb4k/configdlg/smb4knetworkoptions.h new file mode 100644 index 0000000..b3b47f3 --- /dev/null +++ b/smb4k/configdlg/smb4knetworkoptions.h @@ -0,0 +1,63 @@ +/*************************************************************************** + smb4knetworkoptions - The configuration page for the network + settings of Smb4K + ------------------- + begin : Sa Nov 15 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KNETWORKOPTIONS_H +#define SMB4KNETWORKOPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +/** + * This is the configuration tab for the network settings + * of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KNetworkOptions : public QWidget +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent widget + * + * @param name The widget's name + */ + Smb4KNetworkOptions( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KNetworkOptions(); +}; +#endif diff --git a/smb4k/configdlg/smb4krsyncoptions.cpp b/smb4k/configdlg/smb4krsyncoptions.cpp new file mode 100644 index 0000000..301ee30 --- /dev/null +++ b/smb4k/configdlg/smb4krsyncoptions.cpp @@ -0,0 +1,351 @@ +/*************************************************************************** + smb4ksynchronizeoptions - The configuration page for the rsync options + ------------------- + begin : So Nov 20 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4krsyncoptions.h" + +Smb4KRsyncOptions::Smb4KRsyncOptions( QWidget *parent, const char *name ) : QTabWidget( parent, name ) +{ + setMargin( 10 ); + + // + // The Copying tab + // + QWidget *copying_tab = new QWidget( this, "RsyncCopying" ); + QGridLayout *copying_layout = new QGridLayout( copying_tab ); + copying_layout->setSpacing( 10 ); + + QGroupBox *directory_box = new QGroupBox( 2, QGroupBox::Horizontal, i18n( "Default Destination" ), + copying_tab, "RsyncDestinationBox" ); + directory_box->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "Rsync prefix:" ), directory_box, "RsyncPrefixLabel" ); + KURLRequester *prefix = new KURLRequester( directory_box, "kcfg_RsyncPrefix" ); + prefix->setMode( KFile::Directory | KFile::LocalOnly ); + + QButtonGroup *general_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "General" ), + copying_tab, "RsyncModeBox" ); + general_box->setInsideSpacing( 5 ); + + QCheckBox *archive_mode = new QCheckBox( i18n( "Archive mode" ), general_box, "kcfg_ArchiveMode" ); + QCheckBox *recursive = new QCheckBox( i18n( "Recurse into directories" ), general_box, "kcfg_RecurseIntoDirectories" ); + (void) new QCheckBox( i18n( "Skip files that are newer in target directory" ), general_box, "kcfg_UpdateTarget" ); + (void) new QCheckBox( i18n( "Update destination files in place" ), general_box, "kcfg_UpdateInPlace" ); + (void) new QCheckBox( i18n( "Use relative path names" ), general_box, "kcfg_RelativePathNames" ); + (void) new QCheckBox( i18n( "Don't send implied directories" ), general_box, "kcfg_NoImpliedDirectories" ); + (void) new QCheckBox( i18n( "Transfer directories without recursing" ), general_box, "kcfg_TransferDirectories" ); + (void) new QCheckBox( i18n( "Compress data during transfer" ), general_box, "kcfg_CompressData" ); + + QButtonGroup *links_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Links" ), copying_tab, "RsyncModeBox" ); + links_box->setInsideSpacing( 5 ); + + QCheckBox *links = new QCheckBox( i18n( "Preserve symlinks" ), links_box, "kcfg_PreserveSymlinks" ); + (void) new QCheckBox( i18n( "Transform symlinks" ), links_box, "kcfg_TransformSymlinks" ); + (void) new QCheckBox( i18n( "Only transform unsafe symlinks" ), links_box, "kcfg_TransformUnsafeSymlinks" ); + (void) new QCheckBox( i18n( "Ignore unsafe symlinks" ), links_box, "kcfg_IgnoreUnsafeSymlinks" ); + (void) new QCheckBox( i18n( "Preserve hard links" ), links_box, "kcfg_PreserveHardLinks" ); + (void) new QCheckBox( i18n( "Keep directory symlinks" ), links_box, "kcfg_KeepDirectorySymlinks" ); + + QButtonGroup *perm_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "File Permissions, etc." ), + copying_tab, "RsyncPreservationBox" ); + perm_box->setInsideSpacing( 5 ); + + QCheckBox *perms = new QCheckBox( i18n( "Preserve permissions" ), perm_box, "kcfg_PreservePermissions" ); + QCheckBox *group = new QCheckBox( i18n( "Preserve group" ), perm_box, "kcfg_PreserveGroup" ); + QCheckBox *owner = new QCheckBox( i18n( "Preserve owner" ), perm_box, "kcfg_PreserveOwner" ); + QCheckBox *devices = new QCheckBox( i18n( "Preserve device and special files" ), perm_box, "kcfg_PreserveDevicesAndSpecials" ); + QCheckBox *times = new QCheckBox( i18n( "Preserve times" ), perm_box, "kcfg_PreserveTimes" ); + (void) new QCheckBox( i18n( "Omit directories when preserving times" ), perm_box, "kcfg_OmitDirectoryTimes" ); + + QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + copying_layout->addWidget( directory_box, 0, 0, 0 ); + copying_layout->addWidget( general_box, 1, 0, 0 ); + copying_layout->addWidget( links_box, 2, 0, 0 ); + copying_layout->addWidget( perm_box, 3, 0, 0 ); + copying_layout->addItem( spacer1, 4, 0 ); + + addTab( copying_tab, i18n( "Copying" ) ); + + + // + // The File Deletion & Transfer tab + // + QWidget *deltrans_tab = new QWidget( this, "RsyncFileDeletion" ); + QGridLayout *deltrans_layout = new QGridLayout( deltrans_tab ); + deltrans_layout->setSpacing( 10 ); + + QButtonGroup *delete_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "File Deletion" ), deltrans_tab, "RsyncDeleteBox" ); + delete_box->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Remove synchronized source files" ), delete_box, "kcfg_RemoveSourceFiles" ); + (void) new QCheckBox( i18n( "Delete extraneous files" ), delete_box, "kcfg_DeleteExtraneous" ); + (void) new QCheckBox( i18n( "Delete files before transfer" ), delete_box, "kcfg_DeleteBefore" ); + (void) new QCheckBox( i18n( "Delete files after transfer" ), delete_box, "kcfg_DeleteAfter" ); + (void) new QCheckBox( i18n( "Delete files during transfer" ), delete_box, "kcfg_DeleteDuring" ); + (void) new QCheckBox( i18n( "Also delete excluded files" ), delete_box, "kcfg_DeleteExcluded" ); + (void) new QCheckBox( i18n( "Delete even if I/O errors occur" ), delete_box, "kcfg_IgnoreErrors" ); + (void) new QCheckBox( i18n( "Force deletion of non-void directories" ), delete_box, "kcfg_ForceDirectoryDeletion" ); + + QButtonGroup *delete_restrictions_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Restrictions" ), deltrans_tab, "RsyncDeleteRestrictionsBox" ); + delete_restrictions_box->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Don't delete more than this many files:" ), delete_restrictions_box, "kcfg_UseMaximumDelete" ); + (void) new KIntNumInput( delete_restrictions_box, "kcfg_MaximumDeleteValue" ); + + QButtonGroup *transfer_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "File Transfer" ), + deltrans_tab, "RsyncFileTransferBox" ); + transfer_box->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Don't transfer any file smaller than:" ), transfer_box, "kcfg_UseMinimalTransferSize" ); + KIntNumInput *min_size = new KIntNumInput( transfer_box, "kcfg_MinimalTransferSize" ); + min_size->setSuffix( " kB" ); + (void) new QCheckBox( i18n( "Don't transfer any file larger than:" ), transfer_box, "kcfg_UseMaximalTransferSize" ); + KIntNumInput *max_size = new KIntNumInput( transfer_box, "kcfg_MaximalTransferSize" ); + max_size->setSuffix( " kB" ); + (void) new QCheckBox( i18n( "Keep partially transferred files" ), transfer_box, "kcfg_KeepPartial" ); + transfer_box->addSpace( 0 ); + (void) new QCheckBox( i18n( "Put a partially transferred file into:" ), transfer_box, "kcfg_UsePartialDirectory" ); + KURLRequester *partial_dir = new KURLRequester( transfer_box, "kcfg_PartialDirectory" ); + partial_dir->setMode( KFile::Directory | KFile::LocalOnly ); + + QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + deltrans_layout->addWidget( delete_box, 0, 0, 0 ); + deltrans_layout->addWidget( delete_restrictions_box, 1, 0, 0 ); + deltrans_layout->addWidget( transfer_box, 2, 0, 0 ); + deltrans_layout->addItem( spacer2, 3, 0 ); + + addTab( deltrans_tab, i18n( "File Deletion && Transfer" ) ); + + + // + // The Filter tab + // + QWidget *filter_tab = new QWidget( this, "RsyncFiltering" ); + QGridLayout *filter_layout = new QGridLayout( filter_tab ); + filter_layout->setSpacing( 10 ); + + QButtonGroup *general_filter_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "General" ), + filter_tab, "RsyncGeneralFilterBox" ); + general_filter_box->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Auto-ignore files in the same way CVS does" ), general_filter_box, "kcfg_UseCVSExclude" ); + general_filter_box->addSpace( 0 ); + (void) new QCheckBox( i18n( "Exclude files matching this pattern:" ), general_filter_box, "kcfg_UseExcludePattern" ); + (void) new KLineEdit( general_filter_box, "kcfg_ExcludePattern" ); + (void) new QCheckBox( i18n( "Read exclude patterns from:" ), general_filter_box, "kcfg_UseExcludeFrom" ); + KURLRequester *exclude_from = new KURLRequester( general_filter_box, "kcfg_ExcludeFrom" ); + exclude_from->setMode( KFile::File | KFile::LocalOnly ); + (void) new QCheckBox( i18n( "Don't exclude files matching this pattern:" ), general_filter_box, "kcfg_UseIncludePattern" ); + (void) new KLineEdit( general_filter_box, "kcfg_IncludePattern" ); + (void) new QCheckBox( i18n( "Read include patterns from:" ), general_filter_box, "kcfg_UseIncludeFrom" ); + KURLRequester *include_from = new KURLRequester( general_filter_box, "kcfg_IncludeFrom" ); + include_from->setMode( KFile::File | KFile::LocalOnly ); + + QButtonGroup *filter_rules_box = new QButtonGroup( 1, QGroupBox::Horizontal, i18n( "Filter Rules" ), + filter_tab, "RsyncFilterRulesBox" ); + filter_rules_box->setInsideSpacing( 5 ); + QLabel *filter_rules_label = new QLabel( i18n( "The rules defined below will be added to the \"rsync\" command as they are. Thus, you have to start with the --filter=... argument." ), filter_rules_box ); + filter_rules_label->setTextFormat( Qt::RichText ); + (void) new KLineEdit( filter_rules_box, "kcfg_CustomFilteringRules" ); + (void) new QLabel( i18n( "Special filter rules:" ), filter_rules_box ); + QCheckBox *f_filter = new QCheckBox( i18n( "Use --filter='dir-merge /.rsync-filter' filter rule" ), filter_rules_box, "kcfg_UseFFilterRule" ); + QCheckBox *ff_filter = new QCheckBox( i18n( "Use --filter='exclude .rsync-filter' filter rule" ), filter_rules_box, "kcfg_UseFFFilterRule" ); + + QSpacerItem *spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + filter_layout->addWidget( general_filter_box, 0, 0, 0 ); + filter_layout->addWidget( filter_rules_box, 1, 0, 0 ); + filter_layout->addItem( spacer3, 2, 0 ); + + addTab( filter_tab, i18n( "Filtering" ) ); + + + // + // The Advanced tab + // + QWidget *advanced_tab = new QWidget( this, "RsyncAdvanced" ); + QGridLayout *advanced_layout = new QGridLayout( advanced_tab ); + advanced_layout->setSpacing( 10 ); + + QButtonGroup *misc_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "General" ), + advanced_tab, "RsyncAdvancedMiscBox" ); + misc_box->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Handle sparse files efficiently" ), misc_box, "kcfg_EfficientSparseFileHandling" ); + (void) new QCheckBox( i18n( "Copy files whole (no rsync algorithm)" ), misc_box, "kcfg_CopyFilesWhole" ); + (void) new QCheckBox( i18n( "Don't cross file system boundaries" ), misc_box, "kcfg_OneFileSystem" ); + (void) new QCheckBox( i18n( "Only update files that already exist" ), misc_box, "kcfg_UpdateExisting" ); + (void) new QCheckBox( i18n( "Ignore files that already exist" ), misc_box, "kcfg_IgnoreExisting" ); + (void) new QCheckBox( i18n( "Delay updates until the end of transfer" ), misc_box, "kcfg_DelayUpdates" ); + + QButtonGroup *backup_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Backup" ), advanced_tab, "RsyncBackupBox" ); + backup_box->setInsideSpacing( 5 ); + + QCheckBox *backup = new QCheckBox( i18n( "Make backups" ), backup_box, "kcfg_MakeBackups" ); + backup_box->addSpace( 0 ); + (void) new QCheckBox( i18n( "Backup suffix:" ), backup_box, "kcfg_UseBackupSuffix" ); + (void) new KLineEdit( backup_box, "kcfg_BackupSuffix" ); + (void) new QCheckBox( i18n( "Backup directory:" ), backup_box, "kcfg_UseBackupDirectory" ); + KURLRequester *backup_dir = new KURLRequester( backup_box, "kcfg_BackupDirectory" ); + backup_dir->setMode( KFile::Directory | KFile::LocalOnly ); + + QButtonGroup *checksum_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Checksums" ), advanced_tab, "RsyncChecksumsBox" ); + checksum_box->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Force fixed checksum block size:" ), checksum_box, "kcfg_UseBlockSize" ); + (void) new KIntNumInput( checksum_box, "kcfg_BlockSize" ); + (void) new QCheckBox( i18n( "Set block/file checksum seed:" ), checksum_box, "kcfg_UseChecksumSeed" ); + (void) new KIntNumInput( checksum_box, "kcfg_ChecksumSeed" ); + (void) new QCheckBox( i18n( "Skip files based on checksum" ), checksum_box, "kcfg_UseChecksum" ); + checksum_box->addSpace( 0 ); + + QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + advanced_layout->addWidget( misc_box, 0, 0, 0 ); + advanced_layout->addWidget( backup_box, 1, 0, 0 ); + advanced_layout->addWidget( checksum_box, 2, 0, 0 ); + advanced_layout->addItem( spacer4, 3, 0 ); + + addTab( advanced_tab, i18n( "Advanced" ) ); + + connect( archive_mode, SIGNAL( toggled( bool ) ), + this, SLOT( slotArchiveToggled( bool ) ) ); + + connect( recursive, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( links, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( perms, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( times, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( group, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( owner, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( devices, SIGNAL( toggled( bool ) ), + this, SLOT( slotUncheckArchive( bool ) ) ); + + connect( backup, SIGNAL( toggled( bool ) ), + this, SLOT( slotBackupToggled( bool ) ) ); + + connect( f_filter, SIGNAL( toggled( bool ) ), + this, SLOT( slotFShortcutToggled( bool ) ) ); + + connect( ff_filter, SIGNAL( toggled( bool ) ), + this, SLOT( slotFFShortcutToggled( bool ) ) ); + + slotArchiveToggled( true ); + slotBackupToggled( false ); +} + + +Smb4KRsyncOptions::~Smb4KRsyncOptions() +{ +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KRsyncOptions::slotArchiveToggled( bool on ) +{ + if ( on ) + { + static_cast( child( "kcfg_RecurseIntoDirectories", "QCheckBox", true ) )->setChecked( on ); + static_cast( child( "kcfg_PreserveSymlinks", "QCheckBox", true ) )->setChecked( on ); + static_cast( child( "kcfg_PreservePermissions", "QCheckBox", true ) )->setChecked( on ); + static_cast( child( "kcfg_PreserveTimes", "QCheckBox", true ) )->setChecked( on ); + static_cast( child( "kcfg_PreserveGroup", "QCheckBox", true ) )->setChecked( on ); + static_cast( child( "kcfg_PreserveOwner", "QCheckBox", true ) )->setChecked( on ); + static_cast( child( "kcfg_PreserveDevicesAndSpecials", "QCheckBox", true ) )->setChecked( on ); + } +} + + +void Smb4KRsyncOptions::slotUncheckArchive( bool on ) +{ + if ( !on ) + { + static_cast( child( "kcfg_ArchiveMode", "QCheckBox", true ) )->setChecked( on ); + } +} + + +void Smb4KRsyncOptions::slotBackupToggled( bool on ) +{ + static_cast( child( "kcfg_UseBackupDirectory", "QCheckBox", true ) )->setEnabled( on ); + static_cast( child( "kcfg_BackupDirectory", "KURLRequester", true ) )->setEnabled( on ); + static_cast( child( "kcfg_UseBackupSuffix", "QCheckBox", true ) )->setEnabled( on ); + static_cast( child( "kcfg_BackupSuffix", "KLineEdit", true ) )->setEnabled( on ); +} + + +void Smb4KRsyncOptions::slotFShortcutToggled( bool on ) +{ + QCheckBox *ff_filter = static_cast( child( "kcfg_UseFFFilterRule", "QCheckBox", true ) ); + + if ( on && ff_filter->isChecked() ) + { + ff_filter->setChecked( false ); + } +} + + +void Smb4KRsyncOptions::slotFFShortcutToggled( bool on ) +{ + QCheckBox *f_filter = static_cast( child( "kcfg_UseFFilterRule", "QCheckBox", true ) ); + + if ( on && f_filter->isChecked() ) + { + f_filter->setChecked( false ); + } +} + +#include "smb4krsyncoptions.moc" diff --git a/smb4k/configdlg/smb4krsyncoptions.h b/smb4k/configdlg/smb4krsyncoptions.h new file mode 100644 index 0000000..3559182 --- /dev/null +++ b/smb4k/configdlg/smb4krsyncoptions.h @@ -0,0 +1,108 @@ +/*************************************************************************** + smb4krsyncoptions - The configuration page for the rsync options + ------------------- + begin : So Nov 20 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KRSYNCOPTIONS_H +#define SMB4KRSYNCOPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + + +/** + * This class belongs to the configuration dialog and takes + * care of the options that can be defined for rsync. + * + * @author Alexander Reinholdt + */ + +class Smb4KRsyncOptions : public QTabWidget +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent widget + * + * @param name The name of this widget + */ + Smb4KRsyncOptions( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KRsyncOptions(); + + protected slots: + /** + * This slot is invoked if the "Archive mode" checkbox has been + * toggled. + * + * @param on Is TRUE if the checkbox is checked and FALSE otherwise. + */ + void slotArchiveToggled( bool on ); + + /** + * This slot is invoked if the --archive option has to be switched + * off. + * + * @param on Is FALSE if one of the connected checkboxes is unchecked + * and TRUE otherwise. + */ + void slotUncheckArchive( bool on ); + + /** + * This slot is called, when the backup checkbox has been toggled. + * It enables/disables all other backup options according to the + * state the backup button is in. + * + * @param on Is TRUE if the m_backup check box has been + * checked and FALSE otherwise. + */ + void slotBackupToggled( bool on ); + + /** + * This slot is called if the '-F' shortcut has been toggled. + * It unchecks the '-F -F' shortcut. + * + * @param on Is TRUE is m_f_filter is checked and FALSE otherwise. + */ + void slotFShortcutToggled( bool on ); + + /** + * This slot is called if the '-F -F' shortcut has been toggled. + * It unchecks the '-F' shortcut. + * + * @param on Is TRUE is m_ff_filter is checked and FALSE otherwise. + */ + void slotFFShortcutToggled( bool on ); +}; + +#endif diff --git a/smb4k/configdlg/smb4ksambaoptions.cpp b/smb4k/configdlg/smb4ksambaoptions.cpp new file mode 100644 index 0000000..ab57b25 --- /dev/null +++ b/smb4k/configdlg/smb4ksambaoptions.cpp @@ -0,0 +1,1230 @@ +/*************************************************************************** + smb4ksambaoptions.cpp - This is the configuration page for the + Samba settings of Smb4K + ------------------- + begin : Mo Jan 26 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include + +// System includes +#include +#include + +// application specific includes +#include "smb4ksambaoptions.h" +#include "../core/smb4kglobal.h" +#include "../core/smb4ksettings.h" + +using namespace Smb4KGlobal; + + +Smb4KSambaOptions::Smb4KSambaOptions( QWidget *parent, const char *name ) +: QTabWidget( parent, name ) +{ + setMargin( 10 ); + + // + // General options + // + QWidget *general_tab = new QWidget( this, "GeneralSambaOptions" ); + QGridLayout *general_layout = new QGridLayout( general_tab ); + general_layout->setSpacing( 10 ); + + QGroupBox *general_options = new QGroupBox( 2, Qt::Horizontal, + i18n( "General Options" ), general_tab ); + general_options->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "NetBIOS name:"), general_options ); + (void) new KLineEdit( general_options, "kcfg_NetBIOSName" ); + + (void) new QLabel( i18n( "Domain:" ), general_options ); + (void) new KLineEdit( general_options, "kcfg_DomainName" ); + + (void) new QLabel( i18n( "Socket options:" ), general_options ); + (void) new KLineEdit( general_options, "kcfg_SocketOptions" ); + + (void) new QLabel( i18n( "NetBIOS scope:" ), general_options ); + (void) new KLineEdit( general_options, "kcfg_NetBIOSScope" ); + + (void) new QLabel( i18n( "Remote SMB port:" ), general_options ); + (void) new KIntNumInput( general_options, "kcfg_RemotePort" ); + + QGroupBox *authentication = new QGroupBox( 1, Qt::Horizontal, + i18n( "Authentication" ), general_tab ); + + (void) new QCheckBox( i18n( "Try to authenticate with Kerberos" ), authentication, "kcfg_UseKerberos" ); + (void) new QCheckBox( i18n( "Authenticate as machine account" ), authentication, "kcfg_MachineAccount" ); + + QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + general_layout->addWidget( general_options, 0, 0, 0 ); + general_layout->addWidget( authentication, 1, 0, 0 ); + general_layout->addItem( spacer1, 2, 0 ); + + addTab( general_tab, i18n( "General Settings" ) ); + + // + // Options for the mount commands + // + QWidget *mount_tab = new QWidget( this, "MountOptions" ); + QGridLayout *mount_layout = new QGridLayout( mount_tab ); + mount_layout->setSpacing( 10 ); + + QGroupBox *filesystem_box = new QGroupBox( 1, Qt::Horizontal, + i18n( "File System" ), mount_tab ); + +#ifndef __FreeBSD__ + KComboBox *filesystem = new KComboBox( filesystem_box, "kcfg_Filesystem" ); + filesystem->insertItem( "CIFS", Smb4KSettings::EnumFilesystem::CIFS ); + filesystem->insertItem( "SMBFS", Smb4KSettings::EnumFilesystem::SMBFS ); +#else + (void) new QLabel( "SMBFS", filesystem_box ); +#endif + + QLabel *note = new QLabel( i18n( "NOTE: You might need to enable support for either \"super\" or \"sudo\" in the Super User page." ), filesystem_box ); + note->setTextFormat( Qt::RichText ); + + QGroupBox *user_group_box = new QGroupBox( 2, Qt::Horizontal, + i18n( "User and Group" ), mount_tab ); + user_group_box->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "User ID:" ), user_group_box ); + KLineEdit *user_id = new KLineEdit( user_group_box, "kcfg_UserID" ); + user_id->setAlignment( Qt::AlignRight ); + + (void) new QLabel( i18n( "Group ID:" ), user_group_box ); + KLineEdit *group_id = new KLineEdit( user_group_box, "kcfg_GroupID" ); + group_id->setAlignment( Qt::AlignRight ); + + QGroupBox *charset_box = new QGroupBox( 2, Qt::Horizontal, + i18n( "Charset and Codepage" ), mount_tab ); + charset_box->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "Client charset:" ), charset_box ); + KComboBox *charset = new KComboBox( charset_box, "kcfg_ClientCharset" ); + charset->insertItem( i18n( "default" ), Smb4KSettings::EnumClientCharset::default_charset ); + charset->insertItem( "iso8859-1", Smb4KSettings::EnumClientCharset::iso8859_1 ); + charset->insertItem( "iso8859-2", Smb4KSettings::EnumClientCharset::iso8859_2 ); + charset->insertItem( "iso8859-3", Smb4KSettings::EnumClientCharset::iso8859_3 ); + charset->insertItem( "iso8859-4", Smb4KSettings::EnumClientCharset::iso8859_4 ); + charset->insertItem( "iso8859-5", Smb4KSettings::EnumClientCharset::iso8859_5 ); + charset->insertItem( "iso8859-6", Smb4KSettings::EnumClientCharset::iso8859_6 ); + charset->insertItem( "iso8859-7", Smb4KSettings::EnumClientCharset::iso8859_7 ); + charset->insertItem( "iso8859-8", Smb4KSettings::EnumClientCharset::iso8859_8 ); + charset->insertItem( "iso8859-9", Smb4KSettings::EnumClientCharset::iso8859_9 ); + charset->insertItem( "iso8859-13", Smb4KSettings::EnumClientCharset::iso8859_13 ); + charset->insertItem( "iso8859-14", Smb4KSettings::EnumClientCharset::iso8859_14 ); + charset->insertItem( "iso8859-15", Smb4KSettings::EnumClientCharset::iso8859_15 ); + charset->insertItem( "utf8", Smb4KSettings::EnumClientCharset::utf8 ); + charset->insertItem( "koi8-r", Smb4KSettings::EnumClientCharset::koi8_r ); + charset->insertItem( "koi8-u", Smb4KSettings::EnumClientCharset::koi8_u ); + charset->insertItem( "koi8-ru", Smb4KSettings::EnumClientCharset::koi8_ru ); + charset->insertItem( "cp1251", Smb4KSettings::EnumClientCharset::cp1251 ); + charset->insertItem( "gb2312", Smb4KSettings::EnumClientCharset::gb2312 ); + charset->insertItem( "big5", Smb4KSettings::EnumClientCharset::big5 ); + charset->insertItem( "euc-jp", Smb4KSettings::EnumClientCharset::euc_jp ); + charset->insertItem( "euc-kr", Smb4KSettings::EnumClientCharset::euc_kr ); + charset->insertItem( "tis-620", Smb4KSettings::EnumClientCharset::tis_620 ); + + (void) new QLabel( i18n( "Server codepage:" ), charset_box, "CodepageLabel" ); + KComboBox *codepage = new KComboBox( charset_box, "kcfg_ServerCodepage" ); + codepage->insertItem( i18n( "default" ), Smb4KSettings::EnumServerCodepage::default_codepage ); + codepage->insertItem( "cp437", Smb4KSettings::EnumServerCodepage::cp437 ); + codepage->insertItem( "cp720", Smb4KSettings::EnumServerCodepage::cp720 ); + codepage->insertItem( "cp737", Smb4KSettings::EnumServerCodepage::cp737 ); + codepage->insertItem( "cp775", Smb4KSettings::EnumServerCodepage::cp775 ); + codepage->insertItem( "cp850", Smb4KSettings::EnumServerCodepage::cp850 ); + codepage->insertItem( "cp852", Smb4KSettings::EnumServerCodepage::cp852 ); + codepage->insertItem( "cp855", Smb4KSettings::EnumServerCodepage::cp855 ); + codepage->insertItem( "cp857", Smb4KSettings::EnumServerCodepage::cp857 ); + codepage->insertItem( "cp858", Smb4KSettings::EnumServerCodepage::cp858 ); + codepage->insertItem( "cp860", Smb4KSettings::EnumServerCodepage::cp860 ); + codepage->insertItem( "cp861", Smb4KSettings::EnumServerCodepage::cp861 ); + codepage->insertItem( "cp862", Smb4KSettings::EnumServerCodepage::cp862 ); + codepage->insertItem( "cp863", Smb4KSettings::EnumServerCodepage::cp863 ); + codepage->insertItem( "cp864", Smb4KSettings::EnumServerCodepage::cp864 ); + codepage->insertItem( "cp865", Smb4KSettings::EnumServerCodepage::cp865 ); + codepage->insertItem( "cp866", Smb4KSettings::EnumServerCodepage::cp866 ); + codepage->insertItem( "cp869", Smb4KSettings::EnumServerCodepage::cp869 ); + codepage->insertItem( "cp874", Smb4KSettings::EnumServerCodepage::cp874 ); + codepage->insertItem( "cp932", Smb4KSettings::EnumServerCodepage::cp932 ); + codepage->insertItem( "cp936", Smb4KSettings::EnumServerCodepage::cp936 ); + codepage->insertItem( "cp949", Smb4KSettings::EnumServerCodepage::cp949 ); + codepage->insertItem( "cp950", Smb4KSettings::EnumServerCodepage::cp950 ); + codepage->insertItem( "cp1250", Smb4KSettings::EnumServerCodepage::cp1250 ); + codepage->insertItem( "cp1251", Smb4KSettings::EnumServerCodepage::cp1251 ); + codepage->insertItem( "cp1252", Smb4KSettings::EnumServerCodepage::cp1252 ); + codepage->insertItem( "cp1253", Smb4KSettings::EnumServerCodepage::cp1253 ); + codepage->insertItem( "cp1254", Smb4KSettings::EnumServerCodepage::cp1254 ); + codepage->insertItem( "cp1255", Smb4KSettings::EnumServerCodepage::cp1255 ); + codepage->insertItem( "cp1256", Smb4KSettings::EnumServerCodepage::cp1256 ); + codepage->insertItem( "cp1257", Smb4KSettings::EnumServerCodepage::cp1257 ); + codepage->insertItem( "cp1258", Smb4KSettings::EnumServerCodepage::cp1258 ); + codepage->insertItem( "unicode", Smb4KSettings::EnumServerCodepage::unicode ); + + QGroupBox *perms_box = new QGroupBox( 2, Qt::Horizontal, + i18n( "Permissions" ), mount_tab ); + perms_box->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "File mask:" ), perms_box ); + KLineEdit *fmask = new KLineEdit( perms_box, "kcfg_FileMask" ); + fmask->setAlignment( Qt::AlignRight ); + + (void) new QLabel( i18n( "Directory mask:" ), perms_box ); + KLineEdit *dmask = new KLineEdit( perms_box, "kcfg_DirectoryMask" ); + dmask->setAlignment( Qt::AlignRight ); + + (void) new QLabel( i18n( "Write access:" ), perms_box ); + KComboBox *read_mode = new KComboBox( perms_box, "kcfg_WriteAccess" ); + read_mode->insertItem( i18n( "read-write" ), Smb4KSettings::EnumWriteAccess::ReadWrite ); + read_mode->insertItem( i18n( "read-only" ), Smb4KSettings::EnumWriteAccess::ReadOnly ); + +#ifndef __FreeBSD__ + QGroupBox *advanced_cifs = new QGroupBox( 1, Qt::Horizontal, + i18n( "Advanced CIFS Options" ), mount_tab, "AdvancedCIFSOptions" ); + advanced_cifs->setInsideSpacing( 5 ); + + QWidget *c_advanced_widget = new QWidget( advanced_cifs ); + QGridLayout *c_advanced_layout = new QGridLayout( c_advanced_widget ); + c_advanced_layout->setSpacing( 5 ); + c_advanced_layout->setMargin( 0 ); + c_advanced_layout->addWidget( new QCheckBox( i18n( "Do permission checks" ), + c_advanced_widget, "kcfg_PermissionChecks" ), 0, 0, 0 ); + c_advanced_layout->addWidget( new QCheckBox( i18n( "Attempt to set UID and GID" ), + c_advanced_widget, "kcfg_ClientControlsIDs" ), 0, 1, 0 ); + c_advanced_layout->addWidget( new QCheckBox( i18n( "Use server inode numbers" ), + c_advanced_widget, "kcfg_ServerInodeNumbers" ), 1, 0, 0 ); + c_advanced_layout->addWidget( new QCheckBox( i18n( "Do not cache inode data" ), + c_advanced_widget, "kcfg_InodeDataCaching" ), 1, 1, 0 ); + c_advanced_layout->addWidget( new QCheckBox( i18n( "Translate reserved characters" ), + c_advanced_widget, "kcfg_TranslateReservedChars" ), 2, 0, 0 ); + c_advanced_layout->addWidget( new QCheckBox( i18n( "Do not use locking" ), + c_advanced_widget, "kcfg_NoLocking" ), 2, 1, 0 ); + + QWidget *c_extra_widget = new QWidget( advanced_cifs ); + QGridLayout *c_extra_layout = new QGridLayout( c_extra_widget ); + c_extra_layout->setSpacing( 5 ); + c_extra_layout->setMargin( 0 ); + c_extra_layout->addWidget( new QLabel( i18n( "Additional options:" ), c_extra_widget ), 0, 0, 0 ); + c_extra_layout->addWidget( new KLineEdit( c_extra_widget, "kcfg_CustomCIFSOptions" ), 0, 1, 0 ); + + QGroupBox *advanced_smbfs = new QGroupBox( 1, Qt::Horizontal, + i18n( "Advanced SMBFS Options" ), mount_tab, "AdvancedSMBFSOptions" ); + advanced_smbfs->setInsideSpacing( 5 ); + + (void) new QCheckBox( i18n( "Use Unicode when communicating with the server" ), advanced_smbfs, "kcfg_UnicodeSupport" ); + (void) new QCheckBox( i18n( "Use large file support" ), advanced_smbfs, "kcfg_LargeFileSystemSupport" ); + + QWidget *s_advanced_widget = new QWidget( advanced_smbfs ); + QGridLayout *s_advanced_layout = new QGridLayout( s_advanced_widget ); + s_advanced_layout->setSpacing( 5 ); + s_advanced_layout->setMargin( 0 ); + s_advanced_layout->addWidget( new QLabel( i18n( "Caching time of directory listings:" ), s_advanced_widget ), 0, 0, 0 ); + KIntNumInput *ttl = new KIntNumInput( s_advanced_widget, "kcfg_CachingTime" ); + ttl->setSuffix( " ms" ); + s_advanced_layout->addWidget( ttl, 0, 1, 0 ); + +#endif + + QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + mount_layout->addMultiCellWidget( filesystem_box, 0, 0, 0, 1, 0 ); + mount_layout->addMultiCellWidget( perms_box, 0, 0, 2, 3, 0 ); + mount_layout->addMultiCellWidget( charset_box, 1, 1, 0, 1, 0 ); + mount_layout->addMultiCellWidget( user_group_box, 1, 1, 2, 3, 0 ); +#ifndef __FreeBSD__ + mount_layout->addMultiCellWidget( advanced_cifs, 2, 2, 0, 3, 0 ); + mount_layout->addMultiCellWidget( advanced_smbfs, 3, 3, 0, 3, 0 ); + mount_layout->addMultiCell( spacer2, 4, 4, 0, 3, 0 ); +#else + mount_layout->addMultiCell( spacer2, 2, 2, 0, 3, 0 ); +#endif + + addTab( mount_tab, "mount" ); + + // + // Options for the 'net' command + // + QWidget *net_tab = new QWidget( this, "NetOptions" ); + QGridLayout *net_layout = new QGridLayout( net_tab ); + net_layout->setSpacing( 10 ); + + QButtonGroup *protocol_hint = new QButtonGroup( 1, Qt::Horizontal, + i18n( "Protocol Hint" ), net_tab, "kcfg_ProtocolHint" ); + + protocol_hint->insert( new QRadioButton( i18n( "Automatic detection" ), protocol_hint ), + Smb4KSettings::EnumProtocolHint::Automatic ); + protocol_hint->insert( new QRadioButton( i18n( "RPC: Modern operating systems" ), protocol_hint ), + Smb4KSettings::EnumProtocolHint::RPC ); + protocol_hint->insert( new QRadioButton( i18n( "RAP: Older operating systems" ), protocol_hint ), + Smb4KSettings::EnumProtocolHint::RAP ); + protocol_hint->insert( new QRadioButton( i18n( "ADS: Active Directory environment (LDAP/Kerberos)" ), protocol_hint ), + Smb4KSettings::EnumProtocolHint::ADS ); + + QSpacerItem *spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + net_layout->addWidget( protocol_hint, 0, 0, 0 ); + net_layout->addItem( spacer3, 1, 0 ); + + addTab( net_tab, "net" ); + + // + // Options for the 'smbclient' command + // + QWidget *smbclient_tab = new QWidget( this, "SmbclientOptions" ); + QGridLayout *smbclient_layout = new QGridLayout( smbclient_tab ); + smbclient_layout->setSpacing( 10 ); + + QGroupBox *smbclient_misc = new QGroupBox( 2, Qt::Horizontal, i18n( "Miscellaneous" ), + smbclient_tab, "SmbclientMiscellaneous" ); + smbclient_misc->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "Name resolve order:" ), smbclient_misc ); + (void) new KLineEdit( smbclient_misc, "kcfg_NameResolveOrder" ); + + (void) new QLabel( i18n( "Buffer size:" ), smbclient_misc ); + KIntNumInput *buffer_size = new KIntNumInput( smbclient_misc, "kcfg_BufferSize" ); + buffer_size->setSuffix( i18n( " Bytes" ) ); + + (void) new QLabel( i18n( "Signing state:" ), smbclient_misc ); + KComboBox *signing_state = new KComboBox( smbclient_misc, "kcfg_SigningState" ); + signing_state->insertItem( i18n( "none" ), Smb4KSettings::EnumSigningState::None ); + signing_state->insertItem( i18n( "on" ), Smb4KSettings::EnumSigningState::On ); + signing_state->insertItem( i18n( "off" ), Smb4KSettings::EnumSigningState::Off ); + signing_state->insertItem( i18n( "required" ), Smb4KSettings::EnumSigningState::Required ); + + QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + smbclient_layout->addWidget( smbclient_misc, 0, 0, 0 ); + smbclient_layout->addItem( spacer4, 1, 0 ); + + addTab( smbclient_tab, "smbclient" ); + + // + // Options for the 'nmblookup' command + // + QWidget *nmblookup_tab = new QWidget( this, "NmblookupOptions" ); + QGridLayout *nmblookup_layout = new QGridLayout( nmblookup_tab ); + nmblookup_layout->setSpacing( 10 ); + + QGroupBox *nmblookup_misc = new QGroupBox( 1, Qt::Horizontal, + i18n( "Miscellaneous" ), nmblookup_tab ); + nmblookup_misc->setInsideSpacing( 5 ); + + QWidget *broadcast_widget = new QWidget( nmblookup_misc ); + QGridLayout *broadcast_layout = new QGridLayout( broadcast_widget ); + broadcast_layout->setSpacing( 5 ); + broadcast_layout->setMargin( 0 ); + broadcast_layout->addWidget( new QLabel( i18n( "Broadcast address:" ), broadcast_widget ), 0, 0, 0 ); + broadcast_layout->addWidget( new KLineEdit( broadcast_widget, "kcfg_BroadcastAddress" ), 0, 1, 0 ); + + (void) new QCheckBox( i18n( "Try and bind to UDP port 137 to send and receive UDP datagrams" ), nmblookup_misc, "kcfg_UsePort137" ); + + QSpacerItem *spacer5 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + nmblookup_layout->addWidget( nmblookup_misc, 0, 0, 0 ); + nmblookup_layout->addItem( spacer5, 1, 0 ); + + addTab( nmblookup_tab, "nmblookup" ); + + + // + // Custom options + // + QWidget *custom_tab = new QWidget( this, "CustomOptions" ); + QGridLayout *custom_layout = new QGridLayout( custom_tab ); + custom_layout->setSpacing( 10 ); + + + // FIXME: Set "What's this' texts!!! + + KListView *custom_options = new KListView( custom_tab, "CustomOptionsList" ); +// custom_options->setAllColumnsShowFocus( true ); + custom_options->setSelectionMode( QListView::Single ); + custom_options->setVScrollBarMode( KListView::Auto ); + custom_options->addColumn( i18n( "Item" ), -1 ); + custom_options->addColumn( i18n( "Protocol" ), -1 ); +#ifndef __FreeBSD__ + custom_options->addColumn( i18n( "File System" ), -1 ); + custom_options->addColumn( i18n( "Write Access" ), -1 ); +#endif + custom_options->addColumn( i18n( "Kerberos" ), -1 ); + custom_options->addColumn( i18n( "UID" ), -1 ); + custom_options->addColumn( i18n( "GID" ), -1 ); + custom_options->addColumn( i18n( "Port" ), -1 ); + + QWidget *custom_input = new QWidget( custom_tab, "CustomInputWidget" ); + QGridLayout *custom_input_layout = new QGridLayout( custom_input ); + custom_input_layout->setSpacing( 5 ); + + QLabel *custom_proto_label = new QLabel( i18n( "Protocol:" ), custom_input, "CustomProtocolLabel" ); + + KComboBox *custom_protocol = new KComboBox( custom_input, "CustomProtocol" ); + custom_protocol->insertItem( "-", -1 ); + custom_protocol->insertItem( i18n( "auto" ), -1 ); + custom_protocol->insertItem( "RPC", -1 ); + custom_protocol->insertItem( "RAP", -1 ); + custom_protocol->insertItem( "ADS", -1 ); + +#ifndef __FreeBSD__ + + QLabel *custom_fs_label = new QLabel( i18n( "File system:" ), custom_input, "CustomFileSystemLabel" ); + + KComboBox *custom_fs = new KComboBox( custom_input, "CustomFileSystem" ); + custom_fs->insertItem( "-", -1 ); + custom_fs->insertItem( "CIFS", -1 ); + custom_fs->insertItem( "SMBFS", -1 ); + + QLabel *custom_rw_label = new QLabel( i18n( "Write access:" ), custom_input, "CustomWriteAccessLabel" ); + + KComboBox *custom_rw = new KComboBox( custom_input, "CustomWriteAccess" ); + custom_rw->insertItem( "-", -1 ); + custom_rw->insertItem( i18n( "read-write" ), -1 ); + custom_rw->insertItem( i18n( "read-only" ), -1 ); + +#endif + + QLabel *custom_krb_label = new QLabel( i18n( "Kerberos:" ), custom_input, "CustomKerberosLabel" ); + + KComboBox *custom_krb = new KComboBox( custom_input, "CustomKerberos" ); + custom_krb->insertItem( "-", -1 ); + custom_krb->insertItem( i18n( "no" ), -1 ); + custom_krb->insertItem( i18n( "yes" ), -1 ); + + QLabel *custom_uid_label = new QLabel( i18n( "User ID:" ), custom_input, "CustomUIDLabel" ); + + KLineEdit *custom_uid = new KLineEdit( custom_input, "CustomUID" ); + custom_uid->setText( "-" ); + + QLabel *custom_gid_label = new QLabel( i18n( "Group ID:" ), custom_input, "CustomGIDLabel" ); + + KLineEdit *custom_gid = new KLineEdit( custom_input, "CustomGID" ); + custom_gid->setText( "-" ); + + QLabel *custom_port_label = new QLabel( i18n( "Port:" ), custom_input, "CustomPortLabel" ); + + KIntNumInput *custom_port = new KIntNumInput( Smb4KSettings::remotePort(), custom_input, 10, "CustomPort" ); + custom_port->setMinValue( 0 ); + custom_port->setMaxValue( 65535 ); + + QWidget *custom_rm = new QWidget( custom_input ); + QGridLayout *custom_rm_layout = new QGridLayout( custom_rm ); + custom_rm_layout->setSpacing( 5 ); + + KPushButton *remove_custom = new KPushButton( KGuiItem( i18n( "Remove" ), "remove" ), custom_rm, "CustomRemoveItem" ); + KPushButton *rm_all_custom = new KPushButton( KGuiItem( i18n( "Remove All" ), "editdelete" ), custom_rm, "CustomRemoveAllItems" ); + + QSpacerItem *spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred ); + + custom_rm_layout->addItem( spacer6, 0, 0 ); + custom_rm_layout->addWidget( remove_custom, 0, 1, 0 ); + custom_rm_layout->addWidget( rm_all_custom, 0, 2, 0 ); + + custom_input_layout->addWidget( custom_proto_label, 0, 0, 0 ); + custom_input_layout->addWidget( custom_protocol, 0, 1, 0 ); +#ifndef __FreeBSD__ + custom_input_layout->addWidget( custom_fs_label, 0, 2, 0 ); + custom_input_layout->addWidget( custom_fs, 0, 3, 0 ); + custom_input_layout->addWidget( custom_rw_label, 1, 0, 0 ); + custom_input_layout->addWidget( custom_rw, 1, 1, 0 ); + custom_input_layout->addWidget( custom_krb_label, 1, 2, 0 ); + custom_input_layout->addWidget( custom_krb, 1, 3, 0 ); + custom_input_layout->addWidget( custom_uid_label, 2, 0, 0 ); + custom_input_layout->addWidget( custom_uid, 2, 1, 0 ); + custom_input_layout->addWidget( custom_gid_label, 2, 2, 0 ); + custom_input_layout->addWidget( custom_gid, 2, 3, 0 ); + custom_input_layout->addWidget( custom_port_label, 3, 0, 0 ); + custom_input_layout->addWidget( custom_port, 3, 1, 0 ); + custom_input_layout->addMultiCellWidget( custom_rm, 3, 3, 2, 3, 0 ); +#else + custom_input_layout->addWidget( custom_krb_label, 0, 2, 0 ); + custom_input_layout->addWidget( custom_krb, 0, 3, 0 ); + custom_input_layout->addWidget( custom_uid_label, 1, 0, 0 ); + custom_input_layout->addWidget( custom_uid, 1, 1, 0 ); + custom_input_layout->addWidget( custom_gid_label, 1, 2, 0 ); + custom_input_layout->addWidget( custom_gid, 1, 3, 0 ); + custom_input_layout->addWidget( custom_port_label, 2, 0, 0 ); + custom_input_layout->addWidget( custom_port, 2, 1, 0 ); + custom_input_layout->addMultiCellWidget( custom_rm, 2, 2, 2, 3, 0 ); +#endif + + QSpacerItem *spacer7 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Minimum ); + + custom_layout->addWidget( custom_options, 0, 0, 0 ); + custom_layout->addWidget( custom_input, 1, 0, 0 ); + custom_layout->addItem( spacer7, 2, 0 ); + + addTab( custom_tab, i18n( "Custom" ) ); + + // + // Connections + // +#ifndef __FreeBSD__ + connect( filesystem, SIGNAL( activated( int ) ), + this, SLOT( slotSambaFileSystem( int ) ) ); +#endif + + connect( remove_custom, SIGNAL( clicked() ), + this, SLOT( slotRemoveCustomOption() ) ); + + connect( rm_all_custom, SIGNAL( clicked() ), + this, SLOT( slotRemoveAllCustomOptions() ) ); + + connect( custom_options, SIGNAL( clicked( QListViewItem * ) ), + this, SLOT( slotCustomItemClicked( QListViewItem * ) ) ); + + connect( custom_protocol, SIGNAL( activated( int ) ), + this, SLOT( slotCustomProtocolChanged( int ) ) ); + +#ifndef __FreeBSD__ + connect( custom_fs, SIGNAL( activated( int ) ), + this, SLOT( slotCustomFileSystemChanged( int ) ) ); + + connect( custom_rw, SIGNAL( activated( int ) ), + this, SLOT( slotCustomWriteAccessChanged( int ) ) ); +#endif + + connect( custom_krb, SIGNAL( activated( int ) ), + this, SLOT( slotCustomKerberosChanged( int ) ) ); + + connect( custom_uid, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotCustomUIDChanged( const QString & ) ) ); + + connect( custom_gid, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotCustomGIDChanged( const QString & ) ) ); + + connect( custom_port, SIGNAL( valueChanged( int ) ), + this, SLOT( slotCustomPortChanged( int ) ) ); + + // + // Do last things before we are ready to go + // +#ifndef __FreeBSD__ + slotSambaFileSystem( filesystem->currentItem() ); +#endif + slotCustomItemClicked( NULL ); +} + + +Smb4KSambaOptions::~Smb4KSambaOptions() +{ +} + + +void Smb4KSambaOptions::resetCustomTab() +{ + slotCustomItemClicked( NULL ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +#ifndef __FreeBSD__ +void Smb4KSambaOptions::slotSambaFileSystem( int item_index ) +{ + switch ( item_index ) + { + case Smb4KSettings::EnumFilesystem::CIFS: + { + QGroupBox *adv_cifs = static_cast( child( "AdvancedCIFSOptions", "QGroupBox", true ) ); + + if ( adv_cifs ) + { + adv_cifs->setEnabled( true ); + } + + QGroupBox *adv_smbfs = static_cast( child( "AdvancedSMBFSOptions", "QGroupBox", true ) ); + + if ( adv_smbfs ) + { + adv_smbfs->setEnabled( false ); + } + + QLabel *codepage = static_cast( child( "CodepageLabel", "QLabel", true ) ); + + if ( codepage ) + { + codepage->setEnabled( false ); + } + + KComboBox *srv_codepage = static_cast( child( "kcfg_ServerCodepage", "KComboBox", true ) ); + + if ( srv_codepage ) + { + srv_codepage->setEnabled( false ); + } + + break; + } + case Smb4KSettings::EnumFilesystem::SMBFS: + { + QGroupBox *adv_cifs = static_cast( child( "AdvancedCIFSOptions", "QGroupBox", true ) ); + + if ( adv_cifs ) + { + adv_cifs->setEnabled( false ); + } + + QGroupBox *adv_smbfs = static_cast( child( "AdvancedSMBFSOptions", "QGroupBox", true ) ); + + if ( adv_smbfs ) + { + adv_smbfs->setEnabled( true ); + } + + QLabel *codepage = static_cast( child( "CodepageLabel", "QLabel", true ) ); + + if ( codepage ) + { + codepage->setEnabled( true ); + } + + KComboBox *srv_codepage = static_cast( child( "kcfg_ServerCodepage", "KComboBox", true ) ); + + if ( srv_codepage ) + { + srv_codepage->setEnabled( true ); + } + + break; + } + default: + { + break; + } + }; +#else +void Smb4KSambaOptions::slotSambaFileSystem( int ) +{ +#endif +} + + +void Smb4KSambaOptions::slotCustomItemClicked( QListViewItem *item ) +{ + if ( item ) + { + // Enable the input widget: + QWidget *input = static_cast( child( "CustomInputWidget", "QGroupBox", true ) ); + + if ( input ) + { + input->setEnabled( true ); + } + + // Enable/disable the labels, combo boxes, buttons, etc: + QLabel *protocol_label = static_cast( child( "CustomProtocolLabel", "QLabel", true ) ); + + if ( protocol_label ) + { + if ( QString::compare( item->text( Protocol ).stripWhiteSpace(), "-" ) == 0 ) + { + protocol_label->setEnabled( false ); + } + else + { + protocol_label->setEnabled( true ); + } + } + + KComboBox *protocol = static_cast( child( "CustomProtocol", "KComboBox", true ) ); + + if ( protocol ) + { + if ( QString::compare( item->text( Protocol ).stripWhiteSpace(), "-" ) == 0 ) + { + protocol->setEnabled( false ); + } + else + { + protocol->setEnabled( true ); + } + + protocol->setCurrentText( item->text( Protocol ) ); + } + +#ifndef __FreeBSD__ + + QLabel *fs_label = static_cast( child( "CustomFileSystemLabel", "QLabel", true ) ); + + if ( fs_label ) + { + if ( QString::compare( item->text( FileSystem ).stripWhiteSpace(), "-" ) == 0 ) + { + fs_label->setEnabled( false ); + } + else + { + fs_label->setEnabled( true ); + } + } + + KComboBox *filesystem = static_cast( child( "CustomFileSystem", "KComboBox", true ) ); + + if ( filesystem ) + { + if ( QString::compare( item->text( FileSystem ).stripWhiteSpace(), "-" ) == 0 ) + { + filesystem->setEnabled( false ); + } + else + { + filesystem->setEnabled( true ); + } + + filesystem->setCurrentText( item->text( FileSystem ) ); + } + + QLabel *write_access_label = static_cast( child( "CustomWriteAccessLabel", "QLabel", true ) ); + + if ( write_access_label ) + { + if ( QString::compare( item->text( WriteAccess ).stripWhiteSpace(), "-" ) == 0 ) + { + write_access_label->setEnabled( false ); + } + else + { + write_access_label->setEnabled( true ); + } + } + + KComboBox *write_access = static_cast( child( "CustomWriteAccess", "KComboBox", true ) ); + + if ( write_access ) + { + if ( QString::compare( item->text( WriteAccess ).stripWhiteSpace(), "-" ) == 0 ) + { + write_access->setEnabled( false ); + } + else + { + write_access->setEnabled( true ); + } + + write_access->setCurrentText( item->text( WriteAccess ) ); + } + +#endif + + QLabel *krb_label = static_cast( child( "CustomKerberosLabel", "QLabel", true ) ); + + if ( krb_label ) + { + if ( QString::compare( item->text( Kerberos ).stripWhiteSpace(), "-" ) == 0 ) + { + krb_label->setEnabled( false ); + } + else + { + krb_label->setEnabled( true ); + } + } + + KComboBox *kerberos = static_cast( child( "CustomKerberos", "KComboBox", true ) ); + + if ( kerberos ) + { + if ( QString::compare( item->text( Kerberos ).stripWhiteSpace(), "-" ) == 0 ) + { + kerberos->setEnabled( false ); + } + else + { + kerberos->setEnabled( true ); + } + + kerberos->setCurrentText( item->text( Kerberos ) ); + } + + QLabel *uid_label = static_cast( child( "CustomUIDLabel", "QLabel", true ) ); + + if ( uid_label ) + { + if ( QString::compare( item->text( UID ).stripWhiteSpace(), "-" ) == 0 ) + { + uid_label->setEnabled( false ); + } + else + { + uid_label->setEnabled( true ); + } + } + + KLineEdit *uid = static_cast( child( "CustomUID", "KLineEdit", true ) ); + + if ( uid ) + { + if ( QString::compare( item->text( UID ).stripWhiteSpace(), "-" ) == 0 ) + { + uid->setEnabled( false ); + } + else + { + uid->setEnabled( true ); + } + + uid->setText( item->text( UID ) ); + } + + QLabel *gid_label = static_cast( child( "CustomGIDLabel", "QLabel", true ) ); + + if ( gid_label ) + { + if ( QString::compare( item->text( GID ).stripWhiteSpace(), "-" ) == 0 ) + { + gid_label->setEnabled( false ); + } + else + { + gid_label->setEnabled( true ); + } + } + + KLineEdit *gid = static_cast( child( "CustomGID", "KLineEdit", true ) ); + + if ( gid ) + { + if ( QString::compare( item->text( GID ).stripWhiteSpace(), "-" ) == 0 ) + { + gid->setEnabled( false ); + } + else + { + gid->setEnabled( true ); + } + + gid->setText( item->text( GID ) ); + } + + QLabel *port_label = static_cast( child( "CustomPortLabel", "QLabel", true ) ); + + if ( port_label ) + { + if ( QString::compare( item->text( Port ).stripWhiteSpace(), "-" ) == 0 ) + { + port_label->setEnabled( false ); + } + else + { + port_label->setEnabled( true ); + } + } + + KIntNumInput *port = static_cast( child( "CustomPort", "KIntNumInput", true ) ); + + if ( port ) + { + if ( QString::compare( item->text( Port ).stripWhiteSpace(), "-" ) == 0 ) + { + port->setEnabled( false ); + } + else + { + port->setEnabled( true ); + } + + port->setValue( item->text( Port ).toInt() ); + } + + KPushButton *remove = static_cast( child( "CustomRemoveItem", "KPushButton", true ) ); + + if ( remove ) + { + remove->setEnabled( true ); + } + + KPushButton *remove_all = static_cast( child( "CustomRemoveAllItems", "KPushButton", true ) ); + + if ( remove_all ) + { + remove_all->setEnabled( true ); + } + } + else + { + // Get the list view: + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( view ) + { + QLabel *protocol_label = static_cast( child( "CustomProtocolLabel", "QLabel", true ) ); + + if ( protocol_label ) + { + protocol_label->setEnabled( false ); + } + + KComboBox *protocol = static_cast( child( "CustomProtocol", "KComboBox", true ) ); + + if ( protocol ) + { + protocol->setCurrentText( "-" ); + protocol->setEnabled( false ); + } + +#ifndef __FreeBSD__ + + QLabel *fs_label = static_cast( child( "CustomFileSystemLabel", "QLabel", true ) ); + + if ( fs_label ) + { + fs_label->setEnabled( false ); + } + + KComboBox *filesystem = static_cast( child( "CustomFileSystem", "KComboBox", true ) ); + + if ( filesystem ) + { + filesystem->setCurrentText( "-" ); + filesystem->setEnabled( false ); + } + + QLabel *write_access_label = static_cast( child( "CustomWriteAccessLabel", "QLabel", true ) ); + + if ( write_access_label ) + { + write_access_label->setEnabled( false ); + } + + KComboBox *write_access = static_cast( child( "CustomWriteAccess", "KComboBox", true ) ); + + if ( write_access ) + { + write_access->setCurrentText( "-" ); + write_access->setEnabled( false ); + } + +#endif + + QLabel *krb_label = static_cast( child( "CustomKerberosLabel", "QLabel", true ) ); + + if ( krb_label ) + { + krb_label->setEnabled( false ); + } + + KComboBox *kerberos = static_cast( child( "CustomKerberos", "KComboBox", true ) ); + + if ( kerberos ) + { + kerberos->setCurrentText( "-" ); + kerberos->setEnabled( false ); + } + + QLabel *uid_label = static_cast( child( "CustomUIDLabel", "QLabel", true ) ); + + if ( uid_label ) + { + uid_label->setEnabled( false ); + } + + KLineEdit *uid = static_cast( child( "CustomUID", "KLineEdit", true ) ); + + if ( uid ) + { + uid->setText( "-" ); + uid->setEnabled( false ); + } + + QLabel *gid_label = static_cast( child( "CustomGIDLabel", "QLabel", true ) ); + + if ( gid_label ) + { + gid_label->setEnabled( false ); + } + + KLineEdit *gid = static_cast( child( "CustomGID", "KLineEdit", true ) ); + + if ( gid ) + { + gid->setText( "-" ); + gid->setEnabled( false ); + } + + QLabel *port_label = static_cast( child( "CustomPortLabel", "QLabel", true ) ); + + if ( port_label ) + { + port_label->setEnabled( false ); + } + + KIntNumInput *port = static_cast( child( "CustomPort", "KIntNumInput", true ) ); + + if ( port ) + { + port->setValue( Smb4KSettings::remotePort() ); + port->setEnabled( false ); + } + + KPushButton *remove = static_cast( child( "CustomRemoveItem", "KPushButton", true ) ); + + if ( remove ) + { + remove->setEnabled( false ); + } + + KPushButton *remove_all = static_cast( child( "CustomRemoveAllItems", "KPushButton", true ) ); + + if ( remove_all ) + { + remove_all->setEnabled( (view->childCount() != 0) ); + } + } + } +} + + +void Smb4KSambaOptions::slotCustomProtocolChanged( int index ) +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + KComboBox *custom_protocol = static_cast( child( "CustomProtocol", "KComboBox", true ) ); + + if ( view && view->selectedItem() && custom_protocol ) + { + if ( QString::compare( "-", custom_protocol->text( index ) ) != 0 ) + { + // Set the new value: + view->selectedItem()->setText( Protocol, custom_protocol->text( index ) ); + + emit customSettingsChanged(); + } + else + { + // Reset the combo box: + custom_protocol->setCurrentText( view->selectedItem()->text( Protocol ) ); + } + } + else + { + // Nothing to do. + } +} + + +#ifndef __FreeBSD__ +void Smb4KSambaOptions::slotCustomFileSystemChanged( int index ) +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + KComboBox *custom_filesystem = static_cast( child( "CustomFileSystem", "KComboBox", true ) ); + + if ( view && view->selectedItem() && custom_filesystem ) + { + if ( QString::compare( "-", custom_filesystem->text( index ) ) != 0 ) + { + // Set the new value: + view->selectedItem()->setText( FileSystem, custom_filesystem->text( index ) ); + + emit customSettingsChanged(); + } + else + { + // Reset the combo box: + custom_filesystem->setCurrentText( view->selectedItem()->text( FileSystem ) ); + } + } + else + { + // Nothing to do. + } +#else +void Smb4KSambaOptions::slotCustomFileSystemChanged( int ) +{ +#endif +} + + +#ifndef __FreeBSD__ +void Smb4KSambaOptions::slotCustomWriteAccessChanged( int index ) +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + KComboBox *custom_rw = static_cast( child( "CustomWriteAccess", "KComboBox", true ) ); + + if ( view && view->selectedItem() && custom_rw ) + { + if ( QString::compare( "-", custom_rw->text( index ) ) != 0 ) + { + // Set the new value: + view->selectedItem()->setText( WriteAccess, custom_rw->text( index ) ); + + emit customSettingsChanged(); + } + else + { + // Reset the combo box: + custom_rw->setCurrentText( view->selectedItem()->text( WriteAccess ) ); + } + } + else + { + // Nothing to do. + } +#else +void Smb4KSambaOptions::slotCustomWriteAccessChanged( int ) +{ +#endif +} + + +void Smb4KSambaOptions::slotCustomKerberosChanged( int index ) +{ + // FIXME: Do we need to adjust something here with respect to + // FreeBSD? It does not know Kerberos for mounting! + + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + KComboBox *custom_kerberos = static_cast( child( "CustomWriteAccess", "KComboBox", true ) ); + + if ( view && view->selectedItem() && custom_kerberos ) + { + if ( QString::compare( "-", custom_kerberos->text( index ) ) != 0 ) + { + // Set the new value: + view->selectedItem()->setText( Kerberos, custom_kerberos->text( index ) ); + + emit customSettingsChanged(); + } + else + { + // Reset the combo box: + custom_kerberos->setCurrentText( view->selectedItem()->text( Kerberos ) ); + } + } + else + { + // Nothing to do. + } +} + + +void Smb4KSambaOptions::slotCustomUIDChanged( const QString &uid ) +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( view && view->selectedItem() ) + { + // Set the new value: + view->selectedItem()->setText( UID, uid ); + + emit customSettingsChanged(); + } + else + { + // Nothing to do. + } +} + + +void Smb4KSambaOptions::slotCustomGIDChanged( const QString &gid ) +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( view && view->selectedItem() ) + { + // Set the new value: + view->selectedItem()->setText( GID, gid ); + + emit customSettingsChanged(); + } + else + { + // Nothing to do. + } +} + + +void Smb4KSambaOptions::slotCustomPortChanged( int port ) +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( view && view->selectedItem() ) + { + view->selectedItem()->setText( Port, QString( "%1" ).arg( port ) ); + + emit customSettingsChanged(); + } + else + { + // Nothing to do. + } +} + + +void Smb4KSambaOptions::slotRemoveCustomOption() +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( view && view->selectedItem() ) + { + delete view->currentItem(); + + slotCustomItemClicked( NULL ); + + emit customSettingsChanged(); + } + else + { + // Nothing to do. + } +} + + +void Smb4KSambaOptions::slotRemoveAllCustomOptions() +{ + KListView *view = static_cast( child( "CustomOptionsList", "KListView", true ) ); + + if ( view ) + { + while ( view->firstChild() ) + { + delete view->firstChild(); + } + + slotCustomItemClicked( NULL ); + + emit customSettingsChanged(); + } + else + { + // Nothing to do. + } +} + +#include "smb4ksambaoptions.moc" diff --git a/smb4k/configdlg/smb4ksambaoptions.h b/smb4k/configdlg/smb4ksambaoptions.h new file mode 100644 index 0000000..9a994b0 --- /dev/null +++ b/smb4k/configdlg/smb4ksambaoptions.h @@ -0,0 +1,168 @@ +/*************************************************************************** + smb4ksambaoptions.cpp - This is the configuration page for the + Samba settings of Smb4K + ------------------- + begin : Mo Jan 26 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSAMBAOPTIONS_H +#define SMB4KSAMBAOPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + + +/** + * This class manages the configuration dialog of the options + * that can be passed to smbmount and other programs of the + * Samba software suite. + * + * @author Alexander Reinholdt + */ + + +class Smb4KSambaOptions : public QTabWidget +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent widget + * + * @param name This widget's name + */ + Smb4KSambaOptions( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KSambaOptions(); + + /** + * This enumeration is used for the list view in the "Custom" tab. + */ +#ifndef __FreeBSD__ + enum Columns{ ItemName = 0, Protocol = 1, FileSystem = 2, WriteAccess = 3, Kerberos = 4, UID = 5, GID = 6, Port = 7 }; +#else + enum Columns{ ItemName = 0, Protocol = 1, Kerberos = 2, UID = 3, GID = 4, Port = 5 }; +#endif + + /** + * Reset the 'Custom' options tab. + */ + void resetCustomTab(); + + signals: + /** + * This signal is emitted everytime the custom settings were changed by the + * user. That may mean, that only one setting has has been altered but also + * that all custom entries have been deleted. You have to figure out what + * happened in the slot that's connected to this signal. + */ + void customSettingsChanged(); + + protected slots: + /** + * Enables/disables widgets according to the choice of the filesystem (SMBFS/CIFS). + * + * This slot is connected to the combo box that stores the file systems. + * + * @param item_index The index of the item in the combo box. + */ + void slotSambaFileSystem( int item_index ); + + /** + * This slot is invoked if an item in the list of custom options has been + * clicked. It will put the values that are carried by the list view item + * into the editor combo boxes, num inputs, etc. + * + * @param item The item that has been clicked/highlighted. + */ + void slotCustomItemClicked( QListViewItem *item ); + + /** + * Commit the new custom protocol to the list view item. + * + * @param index The index number of the new protocol + */ + void slotCustomProtocolChanged( int index ); + + /** + * Commit the new custom file system to the list view item. + * + * @param index The index number of the new file system + */ + void slotCustomFileSystemChanged( int index ); + + /** + * Commit the new custom write access setting to the list view item. + * + * @param index The index number of the new setting + */ + void slotCustomWriteAccessChanged( int index ); + + /** + * Commit the new custom Kerberos setting to the list view item. + * + * @param index The index number of the new setting + */ + void slotCustomKerberosChanged( int index ); + + /** + * Commit the new custom UID to the list view item. + * + * @param uid The new UID in text form + */ + void slotCustomUIDChanged( const QString &uid ); + + /** + * This slot is invoked if the value for the custom GID setting changed. + * + * @param gid The new GID in text form + */ + void slotCustomGIDChanged( const QString &gid ); + + /** + * Commit the new custom port number to the list view item. + * + * @param port The port number + */ + void slotCustomPortChanged( int port ); + + /** + * Remove the highlighted item from the custom options list. + */ + void slotRemoveCustomOption(); + + /** + * Remove all items from the custom options list. + */ + void slotRemoveAllCustomOptions(); +}; + +#endif diff --git a/smb4k/configdlg/smb4kshareoptions.cpp b/smb4k/configdlg/smb4kshareoptions.cpp new file mode 100644 index 0000000..aebd505 --- /dev/null +++ b/smb4k/configdlg/smb4kshareoptions.cpp @@ -0,0 +1,98 @@ +/*************************************************************************** + smb4kshareoptions - The configuration page for the settings of + Smb4K regarding share management + ------------------- + begin : Sa Nov 15 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include + +// system includes +#include +#include + +// applications specific includes +#include "smb4kshareoptions.h" + + +Smb4KShareOptions::Smb4KShareOptions( QWidget *parent, const char *name ) : QWidget( parent, name ) +{ + QGridLayout *grid = new QGridLayout( this ); + grid->setSpacing( 10 ); + + QGroupBox *dir_box = new QGroupBox( 1, Qt::Horizontal, i18n( "Directories" ), this ); + + QWidget *prefix_container = new QWidget( dir_box ); + QGridLayout *prefix_layout = new QGridLayout( prefix_container ); + prefix_layout->setSpacing( 10 ); + + QLabel *prefix = new QLabel( i18n( "Mount prefix:" ), prefix_container ); + KURLRequester *mount_prefix = new KURLRequester( QString::null, prefix_container, + "kcfg_MountPrefix" ); + mount_prefix->setMode( KFile::Directory ); + prefix_layout->addWidget( prefix, 0, 0, 0 ); + prefix_layout->addWidget( mount_prefix, 0, 1, 0 ); + + (void) new QCheckBox( i18n( "Force generated subdirectories to be lower case" ), + dir_box, "kcfg_ForceLowerCaseSubdirs" ); + + QButtonGroup *mount_box = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Mounting and Unmounting" ), this ); + (void) new QCheckBox( i18n( "Unmount all shares of user %1 on exit" ).arg( getpwuid( getuid() )->pw_name ), + mount_box, "kcfg_UnmountSharesOnExit" ); + (void) new QCheckBox( i18n( "Remount recently used shares on program start" ), + mount_box, "kcfg_RemountShares" ); + (void) new QCheckBox( i18n( "Allow the unmounting of shares that are owned by other users" ), + mount_box, "kcfg_UnmountForeignShares" ); + + QGroupBox *checks_box = new QGroupBox( 2, QGroupBox::Horizontal, i18n( "Checks" ), this ); + + (void) new QLabel( i18n( "Interval between checks:" ), checks_box ); + KIntNumInput *check_interval = new KIntNumInput( 2500, checks_box, 10, + "kcfg_CheckInterval" ); + check_interval->setSuffix( " ms" ); + check_interval->setRange( 500, 300000, 1, false ); + + QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + grid->addWidget( dir_box, 0, 0, 0 ); + grid->addWidget( mount_box, 1, 0, 0 ); + grid->addWidget( checks_box, 2, 0, 0 ); + grid->addItem( spacer2, 3, 0 ); +} + +Smb4KShareOptions::~Smb4KShareOptions() +{ +} + + +#include "smb4kshareoptions.moc" diff --git a/smb4k/configdlg/smb4kshareoptions.h b/smb4k/configdlg/smb4kshareoptions.h new file mode 100644 index 0000000..cf45aa7 --- /dev/null +++ b/smb4k/configdlg/smb4kshareoptions.h @@ -0,0 +1,62 @@ +/*************************************************************************** + smb4kshareoptions - The configuration page for the settings of + Smb4K regarding share management + ------------------- + begin : Sa Nov 15 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHAREOPTIONS_H +#define SMB4KSHAREOPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +/** + * This is the configuration tab for the settings that are + * used to manage the mounted shares. + * + * @author Alexander Reinholdt + */ + +class Smb4KShareOptions : public QWidget +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent of this widget + * + * @param name The name of this widget + */ + Smb4KShareOptions( QWidget *parent = 0, const char *name = 0 ); + /** + * The destructor. + */ + ~Smb4KShareOptions(); +}; +#endif diff --git a/smb4k/configdlg/smb4ksuperuseroptions.cpp b/smb4k/configdlg/smb4ksuperuseroptions.cpp new file mode 100644 index 0000000..d23b624 --- /dev/null +++ b/smb4k/configdlg/smb4ksuperuseroptions.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + smb4ksuperuseroptions - The configuration page for the super user + settings of Smb4K + ------------------- + begin : Sa Okt 30 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include + +// application specific includes +#include "smb4ksuperuseroptions.h" +#include "../core/smb4ksettings.h" + + +Smb4KSuperUserOptions::Smb4KSuperUserOptions( QWidget *parent, const char *name ) +: QWidget( parent, name ) +{ + QGridLayout *grid = new QGridLayout( this ); + grid->setSpacing( 10 ); + + QButtonGroup *suid_progs = new QButtonGroup( 1, QButtonGroup::Horizontal, + i18n( "Programs" ), this, "kcfg_SuperUserProgram" ); + suid_progs->setInsideSpacing( 5 ); + + new QLabel( i18n( "Use the following program to gain super user privileges:" ), suid_progs ); + suid_progs->insert( new QRadioButton( "sudo", suid_progs, "SudoButton" ), Smb4KSettings::EnumSuperUserProgram::Sudo ); + suid_progs->insert( new QRadioButton( "super", suid_progs, "SuperButton" ), Smb4KSettings::EnumSuperUserProgram::Super ); + + QButtonGroup *suid_actions = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Actions" ), this, "SUIDActions" ); + suid_actions->setInsideSpacing( 5 ); +#ifdef __linux__ + (void) new QCheckBox( i18n( "Use super user privileges to force the unmounting of (inaccessible) shares" ), suid_actions, "kcfg_UseForceUnmount" ); +#endif + (void) new QCheckBox( i18n( "Use super user privileges to mount and unmount shares" ), suid_actions, "kcfg_AlwaysUseSuperUser" ); + + QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred ); + KGuiItem remove_item = KGuiItem( i18n( "Remove Entries" ), "editdelete", + i18n( "Remove entries from the configuration file" ), + i18n( "Depending on your choice under \"Programs\", all entries that were written by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. Additionally, all your choices under \"Actions\" will be cleared." ) ); + KPushButton *remove = new KPushButton( remove_item, this, "RemoveButton" ); + + QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + grid->addMultiCellWidget( suid_progs, 0, 0, 0, 3, 0 ); + grid->addMultiCellWidget( suid_actions, 1, 1, 0, 3, 0 ); + grid->addMultiCell( spacer1, 2, 2, 0, 2, 0 ); + grid->addWidget( remove, 2, 3, 0 ); + grid->addMultiCell( spacer2, 3, 3, 0, 3, 0 ); + + connect( remove, SIGNAL( clicked() ), + this, SLOT( slotRemoveClicked() ) ); +} + + +Smb4KSuperUserOptions::~Smb4KSuperUserOptions() +{ +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSuperUserOptions::slotRemoveClicked() +{ + // Emit the signal that the removal of the super user + // entries has been requested. + emit removeEntries(); +} + +#include "smb4ksuperuseroptions.moc" diff --git a/smb4k/configdlg/smb4ksuperuseroptions.h b/smb4k/configdlg/smb4ksuperuseroptions.h new file mode 100644 index 0000000..86c705e --- /dev/null +++ b/smb4k/configdlg/smb4ksuperuseroptions.h @@ -0,0 +1,79 @@ +/*************************************************************************** + smb4ksuperuseroptions - The configuration page for the super user + settings of Smb4K + ------------------- + begin : Sa Okt 30 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSUPERUSEROPTIONS_H +#define SMB4KSUPERUSEROPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +/** + * This is the configuration tab where the user can determine + * whether he/she wants to use the program super or sudo to + * gain super user privileges. + * + * @author Alexander Reinholdt + */ + +class Smb4KSuperUserOptions : public QWidget +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent widget + * + * @param name The name of this widget + */ + Smb4KSuperUserOptions( QWidget *parent = 0, const char *name = 0 ); + /** + * The destructor + */ + ~Smb4KSuperUserOptions(); + + signals: + /** + * This signal is emitted when the "Remove Entries" button has been + * clicked. It is provided for convenience. You could also connect + * to the clicked() signal. + */ + void removeEntries(); + + protected slots: + /** + * This slot is activated when the "Remove Entries" button has been + * clicked. + */ + void slotRemoveClicked(); +}; + +#endif diff --git a/smb4k/configdlg/smb4kuserinterfaceoptions.cpp b/smb4k/configdlg/smb4kuserinterfaceoptions.cpp new file mode 100644 index 0000000..c4310fe --- /dev/null +++ b/smb4k/configdlg/smb4kuserinterfaceoptions.cpp @@ -0,0 +1,207 @@ +/*************************************************************************** + smb4kuserinterfaceoptions - This configuration page takes care + of all settings concerning the user interface of Smb4K + ------------------- + begin : Mi Aug 30 2006 + copyright : (C) 2006-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include + +// application specific includes +#include "smb4kuserinterfaceoptions.h" +#include "../core/smb4ksettings.h" + +Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( QWidget *parent, const char *name ) +: QTabWidget( parent, name ) +{ + setMargin( 10 ); + + // + // Configuration for the main window: + // + QWidget *main_wd_widget = new QWidget( this ); + QGridLayout *main_wd_layout = new QGridLayout( main_wd_widget ); + main_wd_layout->setSpacing( 10 ); + + QButtonGroup *shares_view = new QButtonGroup( 1, Qt::Horizontal, i18n( "Shares View" ), + main_wd_widget, "kcfg_SharesView" ); + + shares_view->insert( new QRadioButton( i18n( "Show mounted shares in an icon view" ), shares_view ), Smb4KSettings::EnumSharesView::IconView ); + + shares_view->insert( new QRadioButton( i18n( "Show mounted shares in a list view" ), shares_view ), Smb4KSettings::EnumSharesView::ListView ); + + QButtonGroup *bookmarks_grp = new QButtonGroup( 1, Qt::Horizontal, i18n( "Bookmarks" ), + main_wd_widget, "BookmarksBox" ); + + (void) new QCheckBox( i18n( "Show custom bookmark label if available" ), bookmarks_grp, "kcfg_ShowCustomBookmarkLabel" ); + + QButtonGroup *tray_group = new QButtonGroup( 1, Qt::Horizontal, i18n( "System Tray" ), + main_wd_widget, "SystemTrayBox" ); + + (void) new QCheckBox( i18n( "Embed application into the system tray" ), tray_group, "kcfg_EmbedIntoSystemTray" ); + + QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + main_wd_layout->addWidget( shares_view, 0, 0, 0 ); + main_wd_layout->addWidget( bookmarks_grp, 1, 0, 0 ); + main_wd_layout->addWidget( tray_group, 2, 0, 0 ); + main_wd_layout->addItem( spacer1, 3, 0 ); + + // + // Configuration for the network browser: + // + QWidget *browser_widget = new QWidget( this ); + QGridLayout *browser_layout = new QGridLayout( browser_widget ); + browser_layout->setSpacing( 10 ); + + QButtonGroup *remoteGroup = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Remote Shares" ), + browser_widget, "BrowserRemoteSharesBox" ); + (void) new QCheckBox( i18n( "Show printer shares" ), remoteGroup, "kcfg_ShowPrinterShares" ); + QCheckBox *hidden = new QCheckBox( i18n( "Show hidden shares" ), remoteGroup, "kcfg_ShowHiddenShares" ); + (void) new QCheckBox( i18n( "Show IPC$ shares" ), remoteGroup, "kcfg_ShowHiddenIPCShares" ); + (void) new QCheckBox( i18n( "Show ADMIN$ shares" ), remoteGroup, "kcfg_ShowHiddenADMINShares" ); + + QButtonGroup *columnsGroup = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Columns" ), + browser_widget, "BrowserColumnsBox" ); + (void) new QCheckBox( i18n( "Show type" ), columnsGroup, "kcfg_ShowType" ); + (void) new QCheckBox( i18n( "Show IP address" ), columnsGroup, "kcfg_ShowIPAddress" ); + (void) new QCheckBox( i18n( "Show comment" ), columnsGroup, "kcfg_ShowComment" ); + + QButtonGroup *netTooltipsGroup = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Tooltips" ), + browser_widget, "BrowserTooltipsBox" ); + (void) new QCheckBox( i18n( "Show tooltip with information about a network item" ), netTooltipsGroup, "kcfg_ShowNetworkItemToolTip" ); + + QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + browser_layout->addWidget( remoteGroup, 0, 0, 0 ); + browser_layout->addWidget( columnsGroup, 1, 0, 0 ); + browser_layout->addWidget( netTooltipsGroup, 2, 0, 0 ); + browser_layout->addItem( spacer2, 3, 0 ); + + // + // Configuration for the shares view + // + QWidget *shares_widget = new QWidget( this ); + QGridLayout *shares_layout = new QGridLayout( shares_widget ); + shares_layout->setSpacing( 10 ); + + QButtonGroup *shares_group = new QButtonGroup( 1, Qt::Horizontal, i18n( "Mounted Shares" ), + shares_widget, "SharesIconGroupBox" ); + (void) new QCheckBox( i18n( "Show mount point instead of share name" ), shares_group, "kcfg_ShowMountPoint" ); + (void) new QCheckBox( i18n( "Show all shares that are mounted on the system" ), shares_group, "kcfg_ShowAllShares" ); + + QButtonGroup *dnd_group = new QButtonGroup( 1, Qt::Horizontal, i18n( "Drag and Drop" ), + shares_widget, "DragnDropBox" ); + (void) new QCheckBox( i18n( "Allow dropping of files and directories onto shares" ), dnd_group, "kcfg_EnableDropSupport" ); + (void) new QCheckBox( i18n( "Allow dragging of shares" ), dnd_group, "kcfg_EnableDragSupport" ); + + QButtonGroup *sharesTooltipGroup = new QButtonGroup( 1, Qt::Horizontal, i18n( "Tooltips" ), + shares_widget, "SharesTooltipsBox" ); + (void) new QCheckBox( i18n( "Show tooltip with information about a share" ), sharesTooltipGroup, "kcfg_ShowShareToolTip" ); + + QButtonGroup *list_view_group = new QButtonGroup( 2, Qt::Horizontal, i18n( "List View" ), + shares_widget, "SharesListViewBox" ); + +#ifndef __FreeBSD__ + (void) new QCheckBox( i18n( "Show owner and group (SMBFS only)" ), list_view_group, "kcfg_ShowOwner" ); + (void) new QCheckBox( i18n( "Show login (CIFS only)" ), list_view_group, "kcfg_ShowLogin" ); +#else + (void) new QCheckBox( i18n( "Show owner and group" ), list_view_group, "kcfg_ShowOwner" ); +#endif + (void) new QCheckBox( i18n( "Show file system" ), list_view_group, "kcfg_ShowFileSystem" ); + (void) new QCheckBox( i18n( "Show free disk space" ), list_view_group, "kcfg_ShowFreeDiskSpace" ); + (void) new QCheckBox( i18n( "Show used disk space" ), list_view_group, "kcfg_ShowUsedDiskSpace" ); + (void) new QCheckBox( i18n( "Show total disk space" ), list_view_group, "kcfg_ShowTotalDiskSpace" ); + (void) new QCheckBox( i18n( "Show disk usage" ), list_view_group, "kcfg_ShowDiskUsage" ); + + QSpacerItem *spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + shares_layout->addWidget( shares_group, 0, 0, 0 ); + shares_layout->addWidget( dnd_group, 1, 0, 0 ); + shares_layout->addWidget( sharesTooltipGroup, 2, 0, 0 ); + shares_layout->addWidget( list_view_group, 3, 0, 0 ); + shares_layout->addItem( spacer3, 4, 0 ); + + // + // Configuration for the preview dialog + // + QWidget *preview_widget = new QWidget( this ); + QGridLayout *preview_layout = new QGridLayout( preview_widget ); + preview_layout->setSpacing( 10 ); + + QButtonGroup *previewFilesGroup = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Hidden Files and Directories" ), preview_widget, "HiddenFilesBox" ); + (void) new QCheckBox( i18n( "Preview hidden files and directories" ), previewFilesGroup, "kcfg_PreviewHiddenItems" ); + + QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding ); + + preview_layout->addWidget( previewFilesGroup, 0, 0, 0 ); + preview_layout->addItem( spacer4, 1, 0 ); + + // + // Add tabs: + // + addTab( main_wd_widget, i18n( "Main Window && System Tray" ) ); + addTab( browser_widget, i18n( "Network Browser" ) ); + addTab( shares_widget, i18n( "Shares View" ) ); + addTab( preview_widget, i18n( "Preview Dialog" ) ); + + // Add connections: + connect( hidden, SIGNAL( stateChanged( int ) ), + this, SLOT( slotShowHiddenShares( int ) ) ); + + // Do last adjustments: + slotShowHiddenShares( hidden->state() ); +} + + +Smb4KUserInterfaceOptions::~Smb4KUserInterfaceOptions() +{ +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + + +void Smb4KUserInterfaceOptions::slotShowHiddenShares( int state ) +{ + if ( state == QCheckBox::On ) + { + static_cast( child( "kcfg_ShowHiddenIPCShares", "QCheckBox" ) )->setEnabled( true ); + static_cast( child( "kcfg_ShowHiddenADMINShares", "QCheckBox" ) )->setEnabled( true ); + } + else if ( state == QCheckBox::Off ) + { + static_cast( child( "kcfg_ShowHiddenIPCShares", "QCheckBox" ) )->setEnabled( false ); + static_cast( child( "kcfg_ShowHiddenADMINShares", "QCheckBox" ) )->setEnabled( false ); + } +} + +#include "smb4kuserinterfaceoptions.moc" diff --git a/smb4k/configdlg/smb4kuserinterfaceoptions.h b/smb4k/configdlg/smb4kuserinterfaceoptions.h new file mode 100644 index 0000000..6fb7e64 --- /dev/null +++ b/smb4k/configdlg/smb4kuserinterfaceoptions.h @@ -0,0 +1,68 @@ +/*************************************************************************** + smb4kuserinterfaceoptions - This configuration page takes care + of all settings concerning the user interface of Smb4K + ------------------- + begin : Mi Aug 30 2006 + copyright : (C) 2006-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KUSERINTERFACEOPTIONS_H +#define SMB4KUSERINTERFACEOPTIONS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + + +/** + * The configuration page for the user interface of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KUserInterfaceOptions : public QTabWidget +{ + Q_OBJECT + + public: + /** + * The constructor + */ + Smb4KUserInterfaceOptions( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KUserInterfaceOptions(); + + protected slots: + /** + * Enables/disables buttons according to the toggle state of the "Show hidden shares" button. + * + * @param state Describes the toggle state of the "Show hidden shares" checkbox. + */ + void slotShowHiddenShares( int state ); +}; + +#endif diff --git a/smb4k/core/Makefile.am b/smb4k/core/Makefile.am new file mode 100644 index 0000000..955df6d --- /dev/null +++ b/smb4k/core/Makefile.am @@ -0,0 +1,35 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +lib_LTLIBRARIES = libsmb4kcore.la +libsmb4kcore_la_LDFLAGS = -no-undefined $(all_libraries) -lkwalletclient \ + -version-info 2:0:0 +include_HEADERS = smb4kauthinfo.h smb4kbookmark.h smb4kbookmarkhandler.h \ + smb4kcore.h smb4kdefs.h smb4kerror.h smb4kfileio.h smb4kglobal.h \ + smb4khomesshareshandler.h smb4kmounter.h smb4knetworkitems.h \ + smb4kpasswordhandler.h smb4kpreviewer.h smb4kpreviewitem.h \ + smb4kprint.h smb4kprintinfo.h smb4ksambaoptionshandler.h \ + smb4ksambaoptionsinfo.h smb4kscanner.h smb4kshare.h \ + smb4ksynchronizationinfo.h smb4ksynchronizer.h +libsmb4kcore_la_SOURCES = smb4kauthinfo.cpp smb4kbookmark.cpp \ + smb4kbookmarkhandler.cpp smb4kcore.cpp smb4kerror.cpp smb4kfileio.cpp smb4kglobal.cpp \ + smb4kglobal_p.cpp smb4khomesshareshandler.cpp smb4kmounter.cpp smb4kmounter_p.cpp \ + smb4knetworkitems.cpp smb4kpasswordhandler.cpp smb4kpreviewer.cpp smb4kpreviewitem.cpp \ + smb4kprint.cpp smb4kprintinfo.cpp smb4ksambaoptionshandler.cpp \ + smb4ksambaoptionsinfo.cpp smb4kscanner.cpp smb4kscanner_p.cpp smb4ksettings.kcfgc smb4kshare.cpp \ + smb4ksynchronizationinfo.cpp smb4ksynchronizer.cpp +libsmb4kcore_la_LIBADD = $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(LIB_QT) + +kde_kcfg_DATA = smb4k.kcfg + +# Build rules +smb4kcore.lo: smb4ksettings.h +smb4kfileio.lo: smb4ksettings.h +smb4kmounter.lo: smb4ksettings.h +smb4kpasswordhandler.lo: smb4ksettings.h +smb4kprint.lo: smb4ksettings.h +smb4ksambaoptionshandler.lo: smb4ksettings.h +smb4kscanner.lo: smb4ksettings.h +smb4ksynchronizer.lo: smb4ksettings.h + +noinst_HEADERS = smb4kglobal_p.h smb4kmounter_p.h smb4kscanner_p.h diff --git a/smb4k/core/smb4k.kcfg b/smb4k/core/smb4k.kcfg new file mode 100644 index 0000000..45a2ead --- /dev/null +++ b/smb4k/core/smb4k.kcfg @@ -0,0 +1,998 @@ + + + + unistd.h + sys/types.h + qstring.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Do not show the name of the share that is represented by the bookmark but the custom label that was defined in the bookmark editor. + true + + + + Embed the application into the system tray. The system tray widget provides a popup menu with several commonly used tasks so that you do not need to bring up the main window everytime. If this setting is chosen you have to use "Quit" from the "File" menu or the system tray widget to exit the application. + true + + + + Start the application docked to the system tray, i.e. only the system tray widget is shown and the main window is hidden. You can bring the main window up by clicking on the system tray widget or by choosing "Restore" from its popup menu. + false + + + + Choose the kind of view you prefer for displaying the mounted shares. There is an icon view or a list view available. + + + + + IconView + + + + Printer shares will be displayed in the network browser. + true + + + + Hidden shares will be displayed in the network browser. Hidden shares are ending with a $ sign, e.g. Musik$ or IPC$. + true + + + + Hidden IPC$ shares will be displayed in the network browser. + true + + + + Hidden ADMIN$ shares will be displayed in the network browser. + true + + + + The type of a share will be displayed in a separate column in the network browser. It can either be Disk, Print or IPC. + true + + + + The IP address of the server will be displayed in a separate column in the network browser. + true + + + + The comment describing the server or share will be displayed in a separate column in the network browser. + true + + + + The tooltip shows various information about the current network item. + true + + + + A share is normally displayed with its name in the shares view. Choosing this feature will cause the exchange of the share name by the mount point. + false + + + + You will not only see the shares that were mounted and are owned by you, but also all other mounts using the SMBFS and CIFS file system that are present on the system. + false + + + + This setting allows you to drop files or whole directories onto the share icons, which will cause them to be copied. + false + + + + This setting allows you to drag a share item out of Smb4K and onto the desktop or into a file manager. Only enable it if you think you absolutely need it and read the handbook before you mark this checkbox. + false + + + + The tooltip shows various information about the current share. + true + + + + Display hidden files and directories in the preview dialog. The names of hidden files and directories are beginning with a period and are usually needed for very specific purposes (configuration file of an application, etc.). Since they are not of any importance for your regular work, you normally do not need to enable this feature. + false + + + + Show the UID and GID that own all files on the mounted file system. At the moment the column will only contain an entry if the share was mounted with the SMBFS file system. + false + + + + Show the login that was used to authenticate to the server. The column will only contain an entry if the share was mounted with the CIFS file system. + false + + + + Show the file system that was used for mounting the share. + true + + + + Show the free disk space that is left on the share. + false + + + + Show the disk space that is already used on the share. + false + + + + Show the total disk space of the share. + false + + + + Show the space that is used on the share in percent. + true + + + + + + + + + Choose the method how to compile the initial browse list. There are four options available: The first one is the default one and employs "nmblookup -M -- -" to discover all workgroups, domains, and their master browsers on your network neighborhood. The second one instructs Smb4K to query the current master browser of your workgroup or domain to retrieve the browse list. The third is similar to the second one except that you can define the master browser that should be queried. If you choose the last option, the provided list of broadcast areas will be scanned using "nmblookup -B x.x.x.x -- '*'". + + + + + + + LookupDomains + + + + Enter the name or IP address of a master browser here that should be queried to compile the initial browse list. + + + + Enter a comma-separated list of broadcast addresses here (e.g. 192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the respective broadcast areas. + + + + Smb4K is able to search for remote hosts either using nmblookup or smbclient. The nmblookup method is very reliable and works well. However, if your network is configured uncommonly and you experience problems when searching, you should try the smbclient method. But please note that you lose the ability to search for IP addresses in that case. + + + + + Nmblookup + + + + + + + + + This is the prefix where Smb4K will create the mount points and mount the remote shares. + ${HOME}/smb4k/ + + + + All names of the subdirectories created by Smb4K below the mount prefix will be lowercase. + false + + + + Unmount all shares that belong to you when the program exits. + false + + + + Remount all your shares that were still mounted when you exited the program. Shares that were mounted by other users are ignored. + false + + + + Allow the unmounting of shares that were mounted by other users. In most cases you need super user privileges for this. Please think before you enable this option! + false + + + + This is the time that elapses until Smb4K checks again for new mounts and unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note that the smaller the interval gets the higher is your system load. + 500 + 300000 + 2500 + + + + + + + + + Use a wallet to store the authentication data. The login name and the password name are stored encrypted on your hard drive. If this setting is disabled, the authentication data is not stored permanently but only temporarily. + true + + + + If you decided to store the login names and passwords only temporarily, Smb4K will remember them until the program exits. If you disable this setting, you will have to provide the authentication data everytime it is needed. + true + + + + Enable the usage of a default login name and password. The authentication data provided below is then used by default to authenticate to a remote server. This is very useful e.g. if you are working in an Active Directory environment or an NT domain. + false + + + + + + + + + + This is the NetBIOS name of this computer that is used by Smb4K. By default, it is either the NetBIOS name that is defined in the smb.conf file or the host name. + + + + + This is the workgroup or domain this computer is or should be in. By default, it is the workgroup that is defined in the smb.conf file. + + + + + These are the TCP socket options that are used by nmblookup, smbmount and smbclient. Socket options are controls on the networking layer of the operating systems which allow the connection to be tuned. See the manual page of smb.conf for more information. + + + + + This sets the NetBIOS scope that nmblookup, smbmount and smbclient will operate under. It should not be set unless every machine on your network neighborhood sets this value. + + + + + This is the port that is to be used for connecting to remote servers. Please note that this is independent of the settings in the smb.conf file. + 1 + 65535 + 139 + + + + Try to authenticate with Kerberos. This is only useful in an Active Directory environment. The setting affects the smbmount and smbclient command. + false + + + + Make queries to the remote server using the machine account of the local server. The setting affects the net and the smbclient command. + false + + + + This is the file system that will be used to mount the remote shares. The Common Internet File System (CIFS) is supported by Windows 2000 and above as well as by Samba. It offers many improvements and advancements compared to the Server Message Block File System (SMBFS) which is used by Windows 9x and below. + + + + + CIFS + + + + This is the charset that is used by the client side (i.e. your side) either to convert local path names to and from Unicode in case of the CIFS file system or for codepage to charset translations (NLS) in case of the SMBFS file system. If you keep the default setting, Smb4K will try to automatically determine the charset by looking up the "unix charset" option in the smb.conf. + + + + + + + + + + + + + + + + + + + + + + + + + + default_charset + + + + This is the codepage that is used by the server. The setting is only available with the SMBFS file system. If you keep the default setting, Smb4K will try to automatically determine the codepage by looking up the "dos charset" option in the smb.conf. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default_codepage + + + + Here you can enter the user ID (a number) that the files and directories of the mounted share will have. If you are using the CIFS file system and the remote server supports the CIFS Unix Extentions, this setting will be ignored. + QString( "%1" ).arg( (int)getuid() ) + + + + Here you can enter the group ID (a number) that the files and directories of the mounted share will have. If you are using the CIFS file system and the remote server supports the CIFS Unix Extentions, this setting will be ignored. + QString( "%1" ).arg( (int)getgid() ) + + + + This is the mask that will be used for creating files. It must be defined in octal. In case the CIFS file system is used, this setting only takes effect if the server does not support the CIFS Unix Extensions. + 0755 + + + + This is the mask that will be used for creating directories. It must be defined in octal. In case the CIFS file system is used, this setting only takes effect if the server does not support the CIFS Unix Extensions. + 0755 + + + + Here you can choose if the shares should be mounted in read and write mode or only read-only. + + + + + ReadWrite + + + + The client side (i.e. your side) will check if you have the right UID/GID to manipulate a file or directory. You might want to switch this feature off if the server(s) support the CIFS Unix Extensions and you are not allowed to access the files and directories. This setting does not affect the normal ACL check. + true + + + + In case the server supports the CIFS Unix Extensions, the client side (i.e. your side) attempts to set the effective UID and GID of the current process on newly created files, directories and devices. If this feature is turned off, the default UID and GID defined for the share will be used. It is recommended that you read the manual page of mount.cifs before you change this setting. + false + + + + Use inode numbers (unique persistent file identifiers) returned by the server instead of automatically generating temporary inode numbers on the client side. + false + + + + Directly read from and write to files opened on the share. In some cases this can provide better performance than the default behavior which caches reads and writes. + false + + + + Translate six of the seven reserved characters (including the colon, question mark, pipe, asterisk, greater than and less than characters but not the backslash) to remap range (above 0xF000). This allows you to open files that were created with such characters. This has no effect if the server does not support Unicode. + false + + + + Do not use locking. Do not start lockd. + falseA + + + + Here you can enter advanced options for the CIFS file system in a comma-separated list (refer to the manual page of mount.cifs to learn more). The list will be added AS IS to the "-o" argument of mount.cifs. Please do not enter options that have already been defined in the configuration dialog. + + + + + This setting determines how long a directory listing is cached in milliseconds. A high value means it takes longer until changes on the server are noticed on the client side (i.e. your side), but it can also give you an increase in performance on large directories, especially on long distances. You need Linux kernel 2.4.2 or later to take advantage of this setting. + 1000 + + + + Use Unicode when communicating with the server. This will give you better support for non-ASCII character sets with the SMBFS file system. + false + + + + Large file support (LFS) enables you to read and write +files bigger than 2 GB on shares that were mounted with the SMBFS file system. + false + + + + Here you can choose the protocol that will be used by the net command for the communication with remote servers if appropriate. In most cases the automatic detection will work fine and you should not need to change the default setting. However, if you experience problems, use the RPC protocol for newer operating systems (Windows NT4 and above) and the RAP protocol for older ones (Windows 98/NT3 and below). Functions that need the ADS protocol (for Active Directory environments) have not been implemented yet, so you can ignore that one for now. + + + + + + + Automatic + + + + This option is used to determine what naming services and in what order are used to resolve host names and IP addresses. It takes a space-separated list of up to four different name resolution options. Those are: lmhost, host, wins, bcast. See the manual page of smbclient for further information. + + + + + This option changes the transmit/send buffer size when getting or putting a file from/to the server. The default is 65520 bytes. Setting this value smaller has been observed to speed up file transfers to and from Windows 9x servers. + 0 + 65520 + + + + Set the signing state for smbclient. + + + + + + + None + + + + Queries performed with nmblookup will be send to the given broadcast address. Without this option the default behavior is to send the queries to the broadcast address of the network interface that was either auto-detected or defined in the "interfaces" parameter of the smb.conf file. + + + + + Try and bind to UDP port 137 to send and receive UDP datagrams. The reason for this option is a bug in Windows 95 where it ignores the source port of the requesting packet and only replies to UDP port 137. Unfortunately, on most Unix systems super user privileges are needed to bind to this port. Please read the manual page of nmblookup for more information. + false + + + + + + + + + + + + This is the path where Smb4K will store the files and directories during synchronization. If you plan to synchronize only with one remote share, then you can put the data directly in this directory. If you want to synchronize with several remote shares, then you should create a subdirectory for each share and choose the appropriate one in the synchronization dialog. + $HOME/smb4k_sync/ + + + + Use archive mode (-a, --archive). This is a short form of -rlptgoD. + true + + + + Recurse into directories (-r, --recursive). + true + + + + Update files in the destination directory that are older than in the source directory (-u, --update). + true + + + + Update destination files in-place (--inplace). By default, rsync first creates a new copy of a file and moves it into place after its transfer finished. If you enable this feature, no copy will be created but the destination file will immediately be overwritten instead. An exception to this is if you combine this option with --backup. + false + + + + Use relative paths (-R, --relative). This means that the full path names specified on the command line are sent to the server rather than just the last parts of the file names. + false + + + + Don't send implied directories with --relative (--no-implied-dirs). This means that the corresponding path elements on the destination system are left unchanged if they exist, and any missing implied directories are created with default attributes. This even allows these implied path elements to have big differences, such as being a symlink to a directory on one side of the transfer, and a real directory on the other side. + false + + + + Transfer directories without recursing (-d, --dirs). This means that all top-level subdirectories are transferred but without their contents. + + false + + + + Compress data during transfer (-z, --compress). This significantly reduces the amount of data that is being transferred. You may want to use this option, if you have a slow connection. + false + + + + Copy symlinks as symlinks (-l, --links). + true + + + + Transform symlinks into the items they are pointing to (-L, --copy-links). + false + + + + Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-links). This means that only those symlinks are transformed that point to items that are outside the copied tree. Absolute symlinks are treated the same way. This option has no additional effect if --copy-links has also been specified. + false + + + + Ignore symlinks that point outside the copied tree (--safe-links). All absolute symlinks are also ignored. If you use this option in conjunction with --relative you might get unexpected results. + false + + + + Preserve hard links (-H, --hard-links). This options causes rsync to preserve the hard links that are found during the transfer. Without it, hard links are treated as though they were separate files. + false + + + + Treat symlinked directories on the receiving side as though they were real ones (-K, --keep-dirlinks). This only works if the symlink matches a real directory from the sending side. Without this option, the receiver's symlink will be deleted and replaced with a real directory. + false + + + + Preserve permissions (-p, --perms). The permissions of the destination file will be same as the source file. For what happens if this option is switched off, please read rsync's manual page. + true + + + + Preserve the group (-g, --group). The group of the destination file will be set to the same value as the source file. + true + + + + Preserve the owner (-o, --owner). The owner of the destination file will be set to the same value as the source file, but only if the receiving rsync is run as the super user. Without this option, the owner is set to the invoking user on the receiving side. + true + + + + Preserve device and special files (-D, --devices --specials). This option causes rsync to transfer character and block devices as well as special files such as named sockets and fifos. It works only partially if rsync is not run as super user and the --super option is not specified. + true + + + + Preserve times (-t, --times). The modification times are transferred along with the files. For what happens if this option is switched off, please read rsync's manual page. + true + + + + Omit directories when preserving times (-O, --omit-dir-times). This means that directories are omitted when modification times are being preserved. Thus, this feature only works in conjunction with --times. + false + + + + Remove all synchronized source files (--remove-source-files). This tells rsync to remove from the sending side the non-directory items that are a part of the transfer and have been successfully duplicated on the receiving side. + false + + + + Delete extraneous files from destination (--delete). This tells rsync to delete all files from the receiving side that are not present on the sending side, but only for the directories that are being synchronized. + false + + + + Delete files on the receiving side before the transfer starts (--delete-before). This is the default behavior if --delete or --delete-excluded is specified without one of the --delete-WHEN options. + false + + + + Delete files on the receiving side after the transfer has completed (--delete-after, --del). + false + + + + Delete files on the receiving side during the transfer (--delete-during). This method is faster than --delete-before or --delete-after, but it is only supported with rsync 2.6.4 or later. + false + + + + Also delete excluded files from destination directory (--delete-excluded). In addition to deleting the files on the receiving side that are not on the sending side, this tells rsync to also delete any files on the receiving side that are excluded. Refer to rsync's manual page for further information. + false + + + + Delete even if I/O errors occur (--ignore-errors). This option has to be specified in conjunction with --delete to take effect. + false + + + + Force deletion of directories even if they are not empty (--force). This option tells rsync to delete a non-empty directory when it is to be replaced by a non-directory. This is only relevant if deletions are not active. + false + + + + Only delete as many files as defined here (--max-delete=NUM). This tells rsync not to delete more than NUM files or directories (NUM must be non-zero). This is useful when mirroring very large trees to prevent disasters. + false + + + + + 0 + 0 + + + + This option causes rsync to not transfer any file that is smaller than the specified size (--min-size=SIZE). + false + + + + + 0 + 0 + + + + This option causes rsync to not transfer any file that is larger than the specified size (--max-size=SIZE). + false + + + + + 0 + 0 + + + + Keep partially transferred files (--partial). The default behavor is that any partially transferred file is deleted if the transfer is interrupted. + false + + + + Put a partially transferred file into this directory (--partial-dir=DIR). This is a better way than the --partial option to keep partial files, because the partially transferred file is kept in a different directory and the destination file is not overwritten. + false + + + + + $HOME + + + + Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a useful shorthand for excluding a broad range of files that you often do not want to transfer between systems. This option uses the same algorithm that CVS uses to determine if a file should be ignored. + false + + + + Exclude files that match a certain pattern (--exclude=PATTERN). This is a special filter rule. For further information on filter rules see rsync's manual page. + false + + + + + + + + + Read exclude patterns from a file (--exclude-from=FILE). This option is similar to the --exclude=PATTERN option except that the exclude patterns are read from a file. This is a special filter rule. For further information on filter rules see rsync's manual page. + false + + + + + $HOME/exclude.txt + + + + Do not exclude files matching a certain pattern (--include=PATTERN). This is a special filter rule. For further information on filter rules see rsync's manual page. + false + + + + + + + + + Read include patterns from a file (--include-from=FILE). This option is similar to the --include=PATTERN option except that the include patterns are read from a file. This is a special filter rule. For further information on filter rules see rsync's manual page. + false + + + + + $HOME/include.txt + + + + Add custom file-filtering rules (-f, --filter=RULE). This option allows you to add rules to selectively exclude certain files from the list of files to be transferred. + + + + + This filter rule tells rsync to look for per-directory .rsync-filter files that have been sprinkled through the hierarchy and use their rules to filter the files in the transfer. It has no effect, if you also choose to use the --filter='exclude .rsync-filter' rule. + false + + + + This rule filters out the .rsync-filter files from the transfer. These files normally contain filter rules that can be activated by choosing the --filter='dir-merge /.rsync-filter' rule and deselecting this one. + false + + + + Handle sparse files efficiently (-S, --sparse) so that they take up less space on the destination. This option conflicts with --inplace. For further information read rsync's manual page. + false + + + + Copy files whole (-W, --whole-file). With this option the incremental rsync algorithm is not used and the whole file is sent as-is instead. + false + + + + Do not cross file system boundaries (-x, --one-file-system). This tells rsync to avoid crossing a filesystem boundary when recursing. For further information on this option, read the manual page. + false + + + + Skip creating new files on the receiving side (--existing). This tells rsync to skip creating files (including directories) that do not exist yet on the destination. If this option is combined with the --ignore-existing option, no files will be updated (which can be useful if all you want to do is to delete extraneous files). + false + + + + Skip updating files that already exist on the receiving side (--ignore-existing). Existing directories are not ignored. + false + + + + Delay updates until the end of the transfer (--delay-updates). This option puts the temporary file from each updated file into a holding directory until the end of the transfer, at which time all the files are renamed and copied into place in rapid succession. + false + + + + Make backups (-b, --backup). With this option, preexisting destination files are renamed as each file is transferred or deleted. You can control where the backup file goes and what (if any) suffix gets appended using the --backup-dir=DIR and --suffix=SUFFIX options. + false + + + + Use this suffix for backups (--suffix=SUFFIX). + false + + + + + ~ + + + + Store backups in this directory (--backup-dir=DIR). + false + + + + + $HOME + + + + Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the block size used in the rsync algorithm to a fixed value. + false + + + + + 0 + 0 + + + + Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum seed to this integer. This 4 byte checksum seed is included in each block and file MD4 checksum calculation. By default the checksum seed is generated by the server and defaults to the current time. + false + + + + + 0 + 0 + + + + Skip files based on a checksum and not based on modification time and size (-c, --checksum). For further information on how this feature works read rsync's manual page. + false + + + + + + + + + + Choose the program that will grant you limited super user privileges for mounting and unmounting remote shares. You can either select sudo, the standard tool for this purpose on most distributions, or super. + + + + + Sudo + + + + Unmount a share under Linux by force. This even works if the file system is "busy", because it is immediately detached from the file system hierarchy and all references to it are cleaned up later when it is not busy anymore. Linux kernel 2.4.11 or later is needed to take advantage of this feature. Use with case! Note, that you will need the root password to write the necessary changes to the configuration file. + false + + + + Use super user privileges for mounting and unmounting remote shares. This feature is only needed, if you are not allowed to use smbmount, smbumount, mount.cifs and umount.cifs as normal user. Note, that you will need the root password to write the necessary changes to the configuration file. + false + + + diff --git a/smb4k/core/smb4kauthinfo.cpp b/smb4k/core/smb4kauthinfo.cpp new file mode 100644 index 0000000..d47eeb0 --- /dev/null +++ b/smb4k/core/smb4kauthinfo.cpp @@ -0,0 +1,63 @@ +/*************************************************************************** + smb4kauthinfo.cpp - This class provides a container for the + authentication data. + ------------------- + begin : Sa Feb 28 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// application specific includes +#include "smb4kauthinfo.h" + + +Smb4KAuthInfo::Smb4KAuthInfo( const QString &wg, const QString &h, const QString &s, const QString &u, const QString &p ) : m_workgroup(wg), m_host(h), m_share(s), m_user(u.local8Bit()), m_password(p.local8Bit()) +{ +} + + +Smb4KAuthInfo::Smb4KAuthInfo( Smb4KAuthInfo &i ) : m_workgroup( i.workgroup() ), m_host( i.host() ), m_share( i.share() ), m_user( i.user() ), m_password( i.password() ) +{ +} + + +Smb4KAuthInfo::~Smb4KAuthInfo() +{ +} + + +void Smb4KAuthInfo::setUser( const QString &user ) +{ + m_user = user.local8Bit(); +} + + +void Smb4KAuthInfo::setPassword( const QString &passwd ) +{ + m_password = passwd.local8Bit(); +} + + +void Smb4KAuthInfo::setShare( const QString &share ) +{ + m_share = share; +} + + diff --git a/smb4k/core/smb4kauthinfo.h b/smb4k/core/smb4kauthinfo.h new file mode 100644 index 0000000..9c4798e --- /dev/null +++ b/smb4k/core/smb4kauthinfo.h @@ -0,0 +1,148 @@ +/*************************************************************************** + smb4kauthinfo.h - This class provides a container for the + authentication data. + ------------------- + begin : Sa Feb 28 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KAUTHINFO_H +#define SMB4KAUTHINFO_H + +// Qt includes +#include +#include + +/** + * This class provides a container for the authentication data. + * + * @author Alexander Reinholdt + */ + + +class Smb4KAuthInfo +{ + public: + /** + * The constructor. + * + * @param workgroup The workgroup of the share the auth info is for. + * + * @param hosts The host's name + * + * @param share The share's name + * + * @param user The username that's used for authentication. Default is QString::null. + * + * @param password The password that's used for authentication. Default is QString::null. + */ + Smb4KAuthInfo( const QString &workgroup, + const QString &host, + const QString &share, + const QString &user = QString::null, + const QString &password = QString::null ); + /** + * The empty constructor. + */ + Smb4KAuthInfo() {} + /** + * The copy constructor. + * + * @param info The Smb4KAuthInfo object that will be copied. + */ + Smb4KAuthInfo( Smb4KAuthInfo &info ); + /** + * The destructor + */ + ~Smb4KAuthInfo(); + /** + * Returns the name of the workgroup. + * + * @returns The workgroup of the server/share for which this + * authentication data is for. + */ + const QString &workgroup() const { return m_workgroup; } + /** + * Returns the name of the server (host). + * + * @returns The server name + */ + const QString &host() const { return m_host; } + /** + * Returns the name of the share. + * + * @returns The share name + */ + const QString &share() const { return m_share; } + /** + * Returns the user's name. + * + * @returns The user name + */ + const QCString &user() const { return m_user; } + /** + * Returns the (unescaped) password. + */ + const QCString &password() const { return m_password; } + /** + * Sets the user name. + * + * @param user The user name for the server/share + */ + void setUser( const QString &user ); + /** + * Sets the password. + * + * @param passwd The password for the server/share + */ + void setPassword( const QString &passwd ); + /** + * Sets the share name. + * + * @param share The name of the share + */ + void setShare( const QString &share ); + + private: + /** + * The workgroup object. + */ + QString m_workgroup; + /** + * The host object. + */ + QString m_host; + /** + * The share object. + */ + QString m_share; + /** + * The user name for this share. + */ + QCString m_user; + /** + * The password object for this share. + */ + QCString m_password; + +}; + +#endif diff --git a/smb4k/core/smb4kbookmark.cpp b/smb4k/core/smb4kbookmark.cpp new file mode 100644 index 0000000..20b3a90 --- /dev/null +++ b/smb4k/core/smb4kbookmark.cpp @@ -0,0 +1,97 @@ +/*************************************************************************** + smb4kbookmark.cpp - A bookmark container. + ------------------- + begin : Feb 04 2004 + copyright : (C) 2004 by Franck Babin + (C) 2005-2007 by Alexander Reinholdt + email : babinfranck@yahoo.ca + dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include + +// application specific includes +#include "smb4kbookmark.h" +#include "smb4knetworkitems.h" + + +Smb4KBookmark::Smb4KBookmark( const QString &host, const QString &share, const QString &workgroup, const QString &ip, const QString &type, const QString &label ) +: m_host( host ), m_share( share ), m_workgroup( workgroup ), m_type( type ), m_label( label ) +{ + //FIXME should throw an exception if one of the param is empty + + m_ip = ipIsValid( ip ) ? ip : QString::null; + m_bookmark = QString( "//%1/%2" ).arg( m_host, m_share ); +} + + +Smb4KBookmark::Smb4KBookmark( Smb4KShareItem *item, const QString &ip, const QString &label ) +: m_host( item->host() ), m_share( item->name() ), m_workgroup( item->workgroup() ), + m_type( item->plainType() ), m_label( label ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; + m_bookmark = QString( "//%1/%2" ).arg( m_host, m_share ); +} + + +Smb4KBookmark::~Smb4KBookmark() +{ +} + + +void Smb4KBookmark::setShareName( const QString &name ) +{ + m_share = name; + + m_bookmark = QString( "//%1/%2" ).arg( m_host, m_share ); +} + + +void Smb4KBookmark::setIP( const QString &ip ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; +} + + +void Smb4KBookmark::setLabel( const QString &text ) +{ + m_label = text; +} + + +bool Smb4KBookmark::ipIsValid( const QString &ip ) +{ + if ( !ip.isEmpty() ) + { + KNetwork::KIpAddress ip_address = KNetwork::KIpAddress( ip ); + + if ( !ip_address.isIPv4Addr() && !ip_address.isIPv6Addr() ) + { + return false; + } + } + else + { + return false; + } + + return true; +} diff --git a/smb4k/core/smb4kbookmark.h b/smb4k/core/smb4kbookmark.h new file mode 100644 index 0000000..c4e8b25 --- /dev/null +++ b/smb4k/core/smb4kbookmark.h @@ -0,0 +1,212 @@ +/*************************************************************************** + smb4kbookmark.h - A bookmark container. + ------------------- + begin : Feb 04 2004 + copyright : (C) 2004 by Franck Babin + (C) 2005-2007 by Alexander Reinholdt + email : babinfranck@yahoo.ca + dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KBOOKMARK_H +#define SMB4KBOOKMARK_H + +// Qt includes +#include + +// forward declarations +class Smb4KShareItem; + +/** + * This class is a container for a set bookmark on a samba share + */ + +class Smb4KBookmark +{ + public: + /** + * The constructor. + * + * @param hostname The host name. + * + * @param sharename The share name. + * + * @param workgroup The workgroup/domain where the share is located. + * + * @param ip The IP address of the host + * + * @param type The type of the share, i.e. "disk" or "printer". + * + * @param label An alternative label to the share name. + */ + Smb4KBookmark( const QString &hostname, + const QString &sharename, + const QString &workgroup, + const QString &ip, + const QString &type, + const QString &label = QString::null ); + + /** + * An alternative constructor. + * + * @param item The Smb4KShareItem for which a bookmark should be + * created. + * + * @param ip The IP address of the host + * + * @param label An alternative label to the share name. + */ + Smb4KBookmark( Smb4KShareItem *item, + const QString &ip, + const QString &label = QString::null ); + + /** + * The empty constructor. + */ + Smb4KBookmark() {} + + /** + * The destructor. + */ + ~Smb4KBookmark(); + + /** + * This function returns the share name. + * + * @returns The share name + */ + const QString &share() const { return m_share; }; + + /** + * This function returns the workgroup/domain the share is located in. + * + * @returns The workgroup + */ + const QString &workgroup() const { return m_workgroup; } + + /** + * This function returns the IP address of the host that carries the + * share. + * + * @returns The IP address + */ + const QString &ip() const { return m_ip; } + + /** + * This function returns the type of the share, i.e. either "Disk" or + * "Printer"/"Print" and "IPC". + * + * @returns The type of the share + */ + const QString &type() const { return m_type; } + + /** + * This function sets the share name of the bookmark. It is normally not + * necessary to use it, because all data should be passed to the constructor. + * In case of homes shares, however, this function is useful. + * + * @param name The share name + */ + void setShareName( const QString &name ); + + /** + * This function returns the bookmark name. + * + * @returns The name of the bookmark + */ + const QString &bookmark() const { return m_bookmark; } + + /** + * This function returns the host name. + * + * @returns The name of the host + */ + const QString &host() const { return m_host; } + + /** + * This function sets the IP address. + * + * @param ip The IP address + */ + void setIP( const QString &ip ); + + /** + * Return the alternative bookmark label. + * + * @returns the label. + */ + const QString &label() const { return m_label; } + + /** + * Sets the alternative bookmark label. + * + * @param text The new text for the label + */ + void setLabel( const QString &text ); + + private: + /** + * The host name. + */ + QString m_host; + + /** + * The share name. + */ + QString m_share; + + /** + * The workgroup + */ + QString m_workgroup; + + /** + * The IP address + */ + QString m_ip; + + /** + * The type of the share; + */ + QString m_type; + + /** + * The bookmark string. + */ + QString m_bookmark; + + /** + * The alternative label + */ + QString m_label; + + /** + * This function checks if the IP address is valid, i.e. the + * IP address is either IP v4 or IP v6. It returns either TRUE + * or FALSE. + * + * @param ip The IP address that's going to be checked. + * + * @returns TRUE if the IP address is valid and FALSE otherwise. + */ + bool ipIsValid( const QString &ip ); +}; + +#endif diff --git a/smb4k/core/smb4kbookmarkhandler.cpp b/smb4k/core/smb4kbookmarkhandler.cpp new file mode 100644 index 0000000..113d601 --- /dev/null +++ b/smb4k/core/smb4kbookmarkhandler.cpp @@ -0,0 +1,342 @@ +/*************************************************************************** + smb4kbookmarkhandler - This class handles the bookmarks. + ------------------- + begin : Fr Jan 9 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include + +// system specific includes +#include +#include + +// application specific includes +#include "smb4kbookmarkhandler.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4knetworkitems.h" +#include "smb4kbookmark.h" + +using namespace Smb4KGlobal; + + +Smb4KBookmarkHandler::Smb4KBookmarkHandler( QValueList *hosts, +QObject *parent, const char *name ) +: QObject( parent, name ), m_hosts( hosts ) +{ + // First we need the directory. + KStandardDirs *stddir = new KStandardDirs(); + QString dir = locateLocal( "data", "smb4k", KGlobal::instance() ); + + if ( !stddir->exists( dir ) ) + { + stddir->makeDir( dir ); + } + + delete stddir; + + loadBookmarks(); +} + + +Smb4KBookmarkHandler::~Smb4KBookmarkHandler() +{ + for ( QValueList::Iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it ) + { + delete *it; + } + + m_bookmarks.clear(); + + // Do not delete m_hosts here, because it is either NULL + // or it is handled outside of this class. +} + + + +void Smb4KBookmarkHandler::addBookmark( Smb4KBookmark *bookmark ) +{ + if ( !bookmark ) + { + return; + } + + if ( QString::compare( bookmark->type(), "Printer" ) == 0 ) + { + Smb4KError::error( ERROR_BOOKMARK_PRINTER ); + return; + } + + if ( QString::compare( bookmark->share(), "homes" ) == 0 ) + { + QString share = specifyUser( bookmark->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" ); + + bookmark->setShareName( share ); + } + + // Search for the bookmark: + Smb4KBookmark *result = findBookmarkByName( bookmark->bookmark() ); + + if ( result ) + { + if ( QString::compare( result->workgroup().upper(), bookmark->workgroup().upper() ) == 0 ) + { + // It's the same bookmark. We'll update it in a very + // brutal but efficient way: + m_bookmarks.remove( result ); + + if ( result ) + { + delete result; + } + } + + m_bookmarks.append( bookmark ); + } + else + { + // The bookmark is new. Append it to the list: + m_bookmarks.append( bookmark ); + } + + writeBookmarkList( m_bookmarks ); +} + + +void Smb4KBookmarkHandler::writeBookmarkList( const QValueList &list ) +{ + if ( list != m_bookmarks ) + { + for ( QValueListIterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it ) + { + delete *it; + } + + m_bookmarks.clear(); + + m_bookmarks = list; + } + + QFile file( locateLocal( "data", "smb4k/bookmarks", KGlobal::instance() ) ); + + if ( file.open( IO_WriteOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + int serial_number = 0; + + for ( QValueListConstIterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it ) + { + if ( !(*it)->label().isEmpty() ) + { + Smb4KBookmark *result = findBookmarkByLabel( (*it)->label() ); + + if ( result && + (QString::compare( result->bookmark().upper(), (*it)->bookmark().upper() ) != 0 || + QString::compare( result->workgroup().upper(), (*it)->workgroup().upper() ) != 0) ) + { + Smb4KError::information( INFO_BOOKMARK_LABEL_IN_USE, (*it)->label(), (*it)->bookmark() ); + + (*it)->setLabel( QString( "%1 (%2)" ).arg( (*it)->label() ).arg( serial_number++ ) ); + } + } + + ts << (*it)->host() << "," + << (*it)->share() << "," + << (*it)->workgroup() << "," + << (*it)->ip() << "," + << (*it)->label() << endl; + } + + file.close(); + } + else + { + Smb4KError::error( ERROR_WRITING_FILE, QDir::currentDirPath()+"/"+file.name() ); + return; + } + + emit bookmarksUpdated(); +} + + +void Smb4KBookmarkHandler::loadBookmarks() +{ + QFile file( locateLocal( "data", "smb4k/bookmarks", KGlobal::instance() ) ); + + QStringList contents; + + if ( file.open( IO_ReadOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( '\n', ts.read(), false ); + + file.close(); + + for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it ) + { + if ( (*it).startsWith( "#" ) || (*it).startsWith( "[" ) || + QString::compare( (*it).stripWhiteSpace(), QString::null ) == 0 ) + { + continue; + } + else + { + // Load old bookmark entries (prior to version 0.7.0) + if ( ((*it).stripWhiteSpace())[0].isDigit() ) + { + QString bookmark = (*it).section( "=", 1, -1 ).stripWhiteSpace(); + m_bookmarks.append( new Smb4KBookmark( bookmark.section( "/", 2, 2 ).stripWhiteSpace(), bookmark.section( "/", 3, 3 ).stripWhiteSpace(), QString::null, QString::null, "Disk" ) ); + } + else + { + QString host = (*it).section( ",", 0, 0 ).stripWhiteSpace(); + QString share = (*it).section( ",", 1, 1 ).stripWhiteSpace(); + QString workgroup = (*it).section( ",", 2, 2 ).stripWhiteSpace(); + QString ip = (*it).section( ",", 3, 3 ).stripWhiteSpace(); + QString label = (*it).section( ",", 4, 4 ).stripWhiteSpace(); + + m_bookmarks.append( new Smb4KBookmark( host, share, workgroup, ip, "Disk", label ) ); + } + } + } + + emit bookmarksUpdated(); + } + else + { + if ( file.exists() ) + { + Smb4KError::error( ERROR_READING_FILE, file.name() ); + } + else + { + // Do nothing if the file does not exist. + } + } +} + + +Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByName( const QString &bookmark ) +{ + // Update the bookmarks: + update(); + + // Find the bookmark: + QValueListConstIterator it; + + for ( it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it ) + { + if ( QString::compare( (*it)->bookmark().upper(), bookmark.upper() ) == 0 ) + { + break; + } + } + + return it != m_bookmarks.end() ? *it : NULL; +} + + +Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByLabel( const QString &label ) +{ + // Update the bookmarks: + update(); + + // Find the bookmark: + QValueListConstIterator it; + + for ( it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it ) + { + if ( QString::compare( (*it)->label().upper(), label.upper() ) == 0 ) + { + break; + } + } + + return it != m_bookmarks.end() ? *it : NULL; +} + + +const QValueList &Smb4KBookmarkHandler::getBookmarks() +{ + // Update the bookmarks: + update(); + + // Return the list of bookmarks: + return m_bookmarks; +} + + +void Smb4KBookmarkHandler::update() +{ + // If the user didn't pass the global Smb4KHostItem list, we are not able + // to update the bookmarks: + if ( !m_hosts ) + { + return; + } + + // Search the list of hosts for new IP addresses: + for ( QValueList::Iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it ) + { + for ( QValueList::ConstIterator i = m_hosts->begin(); i != m_hosts->end(); ++i ) + { + if ( QString::compare( (*it)->workgroup().lower(), (*i)->workgroup().lower() ) != 0 ) + { + // Continue, if the workgroup is not the same: + continue; + } + else + { + if ( QString::compare( (*it)->host().lower(), (*i)->name().lower() ) != 0 ) + { + // Continue if the host name is not the same: + continue; + } + else + { + // Set the IP address if it changed: + if ( !(*i)->ip().stripWhiteSpace().isEmpty() && + QString::compare( (*it)->ip(), (*i)->ip() ) != 0 ) + { + (*it)->setIP( (*i)->ip() ); + } + + break; + } + } + } + } +} + +#include "smb4kbookmarkhandler.moc" diff --git a/smb4k/core/smb4kbookmarkhandler.h b/smb4k/core/smb4kbookmarkhandler.h new file mode 100644 index 0000000..56e7302 --- /dev/null +++ b/smb4k/core/smb4kbookmarkhandler.h @@ -0,0 +1,162 @@ +/*************************************************************************** + smb4kbookmarkhandler - This class handles the bookmarks. + ------------------- + begin : Fr Jan 9 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KBOOKMARKHANDLER_H +#define SMB4KBOOKMARKHANDLER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// forward declarations +class Smb4KHostItem; +class Smb4KBookmark; + + +/** + * This class belongs the to core classes of Smb4K and manages the + * bookmarks. + * + * @author Alexander Reinholdt + */ + +class Smb4KBookmarkHandler : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param hosts A list of Smb4KHostItem items. This should be used + * to give the bookmark handler the list of known hosts, + * so it is able to update the bookmarks if necessary. + * In case a NULL pointer is passed, the bookmarks won't + * be updated. + * + * @param parent The parent of this object + * + * @param name This object's name + */ + Smb4KBookmarkHandler( QValueList *hosts = 0, + QObject *parent = 0, + const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KBookmarkHandler(); + + /** + * This function writes a bookmark to the bookmark file. + * + * NOTE: This function is more or less a wrapper around the + * writeBookmarList() function. + * + * @param bookmark A bookmark that is to be written to + * the bookmark file + */ + void addBookmark( Smb4KBookmark *bookmark ); + + /** + * This function writes a new list of bookmarks. The old list will be + * deleted. It should be used, if you manipulated the list of bookmarks + * i. e. by a bookmark editor. When this function finishes, the + * bookmarksUpdated() signal will be emitted. + * + * @param list The (new) list of bookmarks that is to be written + * to the bookmark file + */ + void writeBookmarkList( const QValueList &list ); + + /** + * Get the list of bookmarks. + * + * @returns The current list of bookmarks stored in the + * bookmark file. + */ + const QValueList &getBookmarks(); + + /** + * This function searches for a bookmark using its name (//HOST/SHARE) and + * returns a pointer to it if it is present or NULL. + * + * @param bookmark The bookmark that is searched. The string you enter + * must consist of the host and the share: //HOST/SHARE. + * + * @returns The bookmark object that was searched for or NULL if it + * wasn't found. + */ + Smb4KBookmark *findBookmarkByName( const QString &bookmark ); + + /** + * This function searches for a bookmark using its label and returns a pointer + * to it if it is present or NULL. + * + * @param label The label that is searched. + * + * @returns The bookmark object that was searched for or NULL if it + * wasn't found. + */ + Smb4KBookmark *findBookmarkByLabel( const QString &label ); + + signals: + /** + * Signal emitted when the list of bookmarks has been updated. + */ + void bookmarksUpdated(); + + private: + /** + * The list of bookmarks. + */ + QValueList m_bookmarks; + + /** + * This function loads the list of bookmarks from the bookmarks file. + * When it finishes, the bookmarksUpdated() signal is emitted. So, if you + * want to access the list of bookmarks immediately after they were read, + * connect a slot to that signal. + */ + void loadBookmarks(); + + /** + * This lis is a pointer to a global list of all known hosts. It + * is used to update the bookmarks. + */ + QValueList *m_hosts; + + /** + * This function updates the data of the bookmarks, i.e. is searches for + * the host provided by m_hosts and sets the appropriate data, if + * necessary. + */ + void update(); +}; +#endif diff --git a/smb4k/core/smb4kcore.cpp b/smb4k/core/smb4kcore.cpp new file mode 100644 index 0000000..4bf835f --- /dev/null +++ b/smb4k/core/smb4kcore.cpp @@ -0,0 +1,955 @@ +/*************************************************************************** + smb4kcore - The main core class of Smb4K. + ------------------- + begin : Do Apr 8 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// system includes +#include + +// application specific includes +#include "smb4kcore.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4knetworkitems.h" +#include "smb4kshare.h" +#include "smb4ksambaoptionshandler.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + +Smb4KCore *Smb4KCore::m_self = 0; +static KStaticDeleter staticSmb4KCoreDeleter; + + +Smb4KCore::Smb4KCore() : QObject() +{ + // Set default values for settings that depend on the system + // Smb4K is running on: + setDefaultSettings(); + + // Search for the programs that are needed by Smb4K: + searchPrograms(); + + m_fileIO = new Smb4KFileIO( this, "CoreFileIO" ); + m_scanner = new Smb4KScanner( &m_workgroups, &m_hosts, this, "CoreScanner" ); + m_mounter = new Smb4KMounter( this, "CoreMounter" ); + m_bookmarkHandler = new Smb4KBookmarkHandler( &m_hosts, this, "CoreBookmarkHandler" ); + m_print = new Smb4KPrint( this, "CorePrinterHandler" ); + m_synchronizer = new Smb4KSynchronizer( this, "CoreSynchronizer" ); + m_previewer = new Smb4KPreviewer( this, "CorePreviewer" ); + + m_scanner_state = SCANNER_STOP; + m_mounter_state = MOUNTER_STOP; + m_print_state = PRINT_STOP; + m_syncer_state = SYNCHRONIZER_STOP; + m_previewer_state = PREVIEWER_STOP; + + // Connections: + connect( m_scanner, SIGNAL( state( int ) ), + this, SLOT( slotSetScannerState( int ) ) ); + + connect( m_mounter, SIGNAL( state( int ) ), + this, SLOT( slotSetMounterState( int ) ) ); + + connect( m_print, SIGNAL( state( int ) ), + this, SLOT( slotSetPrinterHandlerState( int ) ) ); + + connect( m_synchronizer, SIGNAL( state( int ) ), + this, SLOT( slotSetSynchronizerState( int ) ) ); + + connect( m_previewer, SIGNAL( state( int ) ), + this, SLOT( slotSetSynchronizerState( int ) ) ); + + connect( kapp, SIGNAL( shutDown() ), + this, SLOT( slotShutdown() ) ); +} + + +Smb4KCore::~Smb4KCore() +{ + // Do not call abort() here. This will most likely lead + // to crashes. + + // Clear the list of workgroups. + for ( QValueList::Iterator it = m_workgroups.begin(); it != m_workgroups.end(); ++it ) + { + delete *it; + } + + m_workgroups.clear(); + + // Clear the list of hosts. + for ( QValueList::Iterator it = m_hosts.begin(); it != m_hosts.end(); ++it ) + { + delete *it; + } + + m_hosts.clear(); + + if ( m_self == this ) + { + staticSmb4KCoreDeleter.setObject( m_self, 0, false ); + } +} + + +Smb4KCore *Smb4KCore::self() +{ + if ( !m_self ) + { + staticSmb4KCoreDeleter.setObject( m_self, new Smb4KCore() ); + } + + return m_self; +} + + +void Smb4KCore::init() +{ + // Start the core. + m_scanner->init(); + m_mounter->init(); +} + + +/**************************************************************************** + Returns a bool that tells the program whether a core process is running. +****************************************************************************/ + +bool Smb4KCore::isRunning() +{ + if ( self()->m_scanner->isRunning() || self()->m_mounter->isRunning() || + self()->m_print->isRunning() || self()->m_synchronizer->isRunning() || + self()->m_previewer->isRunning() ) + { + return true; + } + else + { + return false; + } +} + + +/**************************************************************************** + Sets the current state of the core. +****************************************************************************/ + +void Smb4KCore::setCurrentState( int state ) +{ + if ( state != SCANNER_STOP && state != MOUNTER_STOP && + state != PRINT_STOP && state != SYNCHRONIZER_STOP && + state != PREVIEWER_STOP ) + { + m_current_state = state; + } + else + { + if ( !m_scanner->isRunning() && !m_mounter->isRunning() && + !m_print->isRunning() && !m_synchronizer->isRunning() && + !m_previewer->isRunning() ) + { + m_current_state = CORE_STOP; + } + else + { + if ( m_scanner->isRunning() ) + { + m_current_state = m_scanner_state; + } + else if ( m_print->isRunning() ) + { + m_current_state = m_print_state; + } + else if ( m_mounter->isRunning() ) + { + m_current_state = m_mounter_state; + } + else if ( m_synchronizer->isRunning() ) + { + m_current_state = m_syncer_state; + } + else if ( m_previewer->isRunning() ) + { + m_current_state = m_previewer_state; + } + } + } +} + + +/**************************************************************************** + Aborts any process of the core. +****************************************************************************/ + +void Smb4KCore::abort() +{ + self()->m_scanner->abort(); + self()->m_mounter->abort(); + self()->m_print->abort(); + self()->m_synchronizer->abort(); + self()->m_previewer->abort(); +} + + +/**************************************************************************** + Opens the given URL. +****************************************************************************/ + +void Smb4KCore::open( Smb4KShare *share, int openWith ) +{ + if ( !share || share->isBroken() ) + { + return; + } + +#if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR <= 3 && KDE_VERSION_RELEASE <= 92 + + if ( QString::compare( share->filesystem(), "cifs" ) == 0 ) + { + if( KMessageBox::warningContinueCancel( (QWidget *)this, i18n( "Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will hang if you try to access it.\nDo you want to continue?" ) ) == KMessageBox::Cancel ) + { + return; + } + } + +#endif + + switch ( openWith ) + { + case Konqueror: + { + KURL url; + url.setPath( share->canonicalPath() ); + + (void) new KRun( url, 0, true, true ); + + break; + } + case Konsole: + { + if ( Smb4KSettings::konsole().isEmpty() ) + { + Smb4KError::error( ERROR_COMMAND_NOT_FOUND, "konsole" ); + } + else + { + KRun::runCommand( "konsole --workdir "+share->canonicalPath() ); + } + + break; + } + default: + { + break; + } + } +} + + +/**************************************************************************** + Searches for the programs needed by Smb4K +****************************************************************************/ + +void Smb4KCore::searchPrograms() +{ + // Remove the group "Programs" and reread the + // configuration: + Smb4KSettings::self()->config()->deleteGroup( "Programs" ); + Smb4KSettings::self()->readConfig(); + + // List of paths that should be searched. + QStringList path_list = QStringList::split( ":", QString( "%1" ).arg( getenv( "PATH" ) ), false ); + + if ( path_list.find( "/sbin" ) == path_list.end() ) + { + path_list << "/sbin"; + } + + if ( path_list.find( "/usr/sbin" ) == path_list.end() ) + { + path_list << "/usr/sbin"; + } + + if ( path_list.find( "/usr/local/sbin" ) == path_list.end() ) + { + path_list << "/usr/local/sbin"; + } + + // Put all programs that are needed by Smb4K + // into the map below: + + QMap program_list; + QMap program_paths; + + // Mandatory programs: + program_list.insert( "grep", false ); + program_list.insert( "awk", false ); + program_list.insert( "sed", false ); + program_list.insert( "xargs", false ); + program_list.insert( "rmdir", false ); + program_list.insert( "nmblookup", false ); + program_list.insert( "smbclient", false ); + program_list.insert( "smbspool", false ); + program_list.insert( "net", false ); +#ifndef __FreeBSD__ + program_list.insert( "mount.cifs", false ); + program_list.insert( "umount.cifs", false ); + program_list.insert( "smbmount", false ); + program_list.insert( "smbumount", false ); + program_list.insert( "mount", false ); +#else + program_list.insert( "mount_smbfs", false ); + program_list.insert( "smbutil", false ); +#endif + program_list.insert( "umount", false ); + program_list.insert( "smb4k_mount", false ); + program_list.insert( "smb4k_umount", false ); + program_list.insert( "smb4k_kill", false ); + program_list.insert( "smb4k_cat", false ); + program_list.insert( "smb4k_mv", false ); + + // Optional programs + program_list.insert( "super", false ); + program_list.insert( "sudo", false ); + program_list.insert( "dvips", false ); + program_list.insert( "enscript", false ); + program_list.insert( "rsync", false ); + program_list.insert( "konsole", false ); + + + for ( QStringList::ConstIterator it = path_list.begin(); it != path_list.end(); ++it ) + { + QDir::setCurrent( *it ); + + for ( QMap::Iterator p = program_list.begin(); p != program_list.end(); ++p ) + { + if ( p.data() == false ) // not located yet + { + if ( QFile::exists( p.key() ) ) + { + program_paths.insert( p.key(), QDir::currentDirPath()+QDir::separator()+p.key() ); + program_list[ p.key() ] = true; + } + else + { + continue; + } + } + else + { + continue; + } + } + } + + // Find out if Smb4K is to be starting up at all: + QStringList missing; + + if ( !program_list["grep"] ) + { + missing.append( "grep" ); + } + else + { + Smb4KSettings::self()->grepItem()->setDefaultValue( program_paths["grep"] ); + + if ( Smb4KSettings::grep().isEmpty() ) + { + Smb4KSettings::self()->grepItem()->setDefault(); + } + } + + if ( !program_list["awk"] ) + { + missing.append( "awk" ); + } + else + { + Smb4KSettings::self()->awkItem()->setDefaultValue( program_paths["awk"] ); + + if ( Smb4KSettings::awk().isEmpty() ) + { + Smb4KSettings::self()->awkItem()->setDefault(); + } + } + + if ( !program_list["sed"] ) + { + missing.append( "sed" ); + } + else + { + Smb4KSettings::self()->sedItem()->setDefaultValue( program_paths["sed"] ); + + if ( Smb4KSettings::sed().isEmpty() ) + { + Smb4KSettings::self()->sedItem()->setDefault(); + } + } + + if ( !program_list["xargs"] ) + { + missing.append( "xargs" ); + } + else + { + Smb4KSettings::self()->xargsItem()->setDefaultValue( program_paths["xargs"] ); + + if ( Smb4KSettings::xargs().isEmpty() ) + { + Smb4KSettings::self()->xargsItem()->setDefault(); + } + } + + if ( !program_list["rmdir"] ) + { + missing.append( "rmdir" ); + } + else + { + Smb4KSettings::self()->rmdirItem()->setDefaultValue( program_paths["rmdir"] ); + + if ( Smb4KSettings::rmdir().isEmpty() ) + { + Smb4KSettings::self()->rmdirItem()->setDefault(); + } + } + + if ( !program_list["nmblookup"] ) + { + missing.append( "nmblookup" ); + } + else + { + Smb4KSettings::self()->nmblookupItem()->setDefaultValue( program_paths["nmblookup"] ); + + if ( Smb4KSettings::nmblookup().isEmpty() ) + { + Smb4KSettings::self()->nmblookupItem()->setDefault(); + } + } + + if ( !program_list["smbclient"] ) + { + missing.append( "smbclient" ); + } + else + { + Smb4KSettings::self()->smbclientItem()->setDefaultValue( program_paths["smbclient"] ); + + if ( Smb4KSettings::smbclient().isEmpty() ) + { + Smb4KSettings::self()->smbclientItem()->setDefault(); + } + } + + if ( !program_list["smbspool"] ) + { + missing.append( "smbspool" ); + } + else + { + Smb4KSettings::self()->smbspoolItem()->setDefaultValue( program_paths["smbspool"] ); + + if ( Smb4KSettings::smbspool().isEmpty() ) + { + Smb4KSettings::self()->smbspoolItem()->setDefault(); + } + } + + if ( !program_list["net"] ) + { + missing.append( "net" ); + } + else + { + Smb4KSettings::self()->netItem()->setDefaultValue( program_paths["net"] ); + + if ( Smb4KSettings::net().isEmpty() ) + { + Smb4KSettings::self()->netItem()->setDefault(); + } + } + +#ifndef __FreeBSD__ + + if ( !program_list["mount.cifs"] && !program_list["smbmount"] ) + { + missing.append( "mount.cifs & smbmount" ); + } + else + { + // One of the two programs is at least present, so we can do + // it like this: + + QString filesystem; + + if ( program_list["mount.cifs"] ) + { + Smb4KSettings::self()->mount_cifsItem()->setDefaultValue( program_paths["mount.cifs"] ); + + if ( Smb4KSettings::mount_cifs().isEmpty() ) + { + Smb4KSettings::self()->mount_cifsItem()->setDefault(); + } + } + else + { + Smb4KSettings::setFilesystem( Smb4KSettings::EnumFilesystem::SMBFS ); + } + + if ( program_list["smbmount"] ) + { + Smb4KSettings::self()->smbmountItem()->setDefaultValue( program_paths["smbmount"] ); + + if ( Smb4KSettings::smbmount().isEmpty() ) + { + Smb4KSettings::self()->smbmountItem()->setDefault(); + } + } + else + { + Smb4KSettings::setFilesystem( Smb4KSettings::EnumFilesystem::CIFS ); + } + } + + if ( !program_list["umount.cifs"] && !program_list["smbumount"] ) + { + missing.append( "umount.cifs & smbumount" ); + } + else + { + // One of the two programs is at least present, so we can do + // it like this: + + QString filesystem; + + if ( program_list["umount.cifs"] ) + { + Smb4KSettings::self()->umount_cifsItem()->setDefaultValue( program_paths["umount.cifs"] ); + + if ( Smb4KSettings::umount_cifs().isEmpty() ) + { + Smb4KSettings::self()->umount_cifsItem()->setDefault(); + } + } + else + { + Smb4KSettings::setFilesystem( Smb4KSettings::EnumFilesystem::SMBFS ); + } + + if ( program_list["smbumount"] ) + { + Smb4KSettings::self()->smbumountItem()->setDefaultValue( program_paths["smbumount"] ); + + if ( Smb4KSettings::smbumount().isEmpty() ) + { + Smb4KSettings::self()->smbumountItem()->setDefault(); + } + } + else + { + Smb4KSettings::setFilesystem( Smb4KSettings::EnumFilesystem::CIFS ); + } + } + + if ( !program_list["mount"] ) + { + missing.append( "mount" ); + } + else + { + Smb4KSettings::self()->mountItem()->setDefaultValue( program_paths["mount"] ); + + if ( Smb4KSettings::mount().isEmpty() ) + { + Smb4KSettings::self()->mountItem()->setDefault(); + } + } + +#else + + if ( !program_list["mount_smbfs"] ) + { + missing.append( "mount_smbfs" ); + } + else + { + Smb4KSettings::self()->mount_smbfsItem()->setDefaultValue( program_paths["mount_smbfs"] ); + + if ( Smb4KSettings::mount_smbfs().isEmpty() ) + { + Smb4KSettings::self()->mount_smbfsItem()->setDefault(); + } + } + + if ( !program_list["smbutil"] ) + { + missing.append( "smbutil" ); + } + else + { + Smb4KSettings::self()->smbutilItem()->setDefaultValue( program_paths["smbutil"] ); + + if ( Smb4KSettings::smbutil().isEmpty() ) + { + Smb4KSettings::self()->smbutilItem()->setDefault(); + } + } + +#endif + + if ( !program_list["umount"] ) + { + missing.append( "umount" ); + } + else + { + Smb4KSettings::self()->umountItem()->setDefaultValue( program_paths["umount"] ); + + if ( Smb4KSettings::umount().isEmpty() ) + { + Smb4KSettings::self()->umountItem()->setDefault(); + } + } + + if ( !program_list["smb4k_mount"] ) + { + missing.append( "smb4k_mount" ); + } + else + { + Smb4KSettings::self()->smb4k_mountItem()->setDefaultValue( program_paths["smb4k_mount"] ); + + if ( Smb4KSettings::smb4k_mount().isEmpty() ) + { + Smb4KSettings::self()->smb4k_mountItem()->setDefault(); + } + } + + if ( !program_list["smb4k_umount"] ) + { + missing.append( "smb4k_umount" ); + } + else + { + Smb4KSettings::self()->smb4k_umountItem()->setDefaultValue( program_paths["smb4k_umount"] ); + + if ( Smb4KSettings::smb4k_umount().isEmpty() ) + { + Smb4KSettings::self()->smb4k_umountItem()->setDefault(); + } + } + + if ( !program_list["smb4k_kill"] ) + { + missing.append( "smb4k_kill" ); + } + else + { + Smb4KSettings::self()->smb4k_killItem()->setDefaultValue( program_paths["smb4k_kill"] ); + + if ( Smb4KSettings::smb4k_kill().isEmpty() ) + { + Smb4KSettings::self()->smb4k_killItem()->setDefault(); + } + } + + if ( !program_list["smb4k_cat"] ) + { + missing.append( "smb4k_cat" ); + } + else + { + Smb4KSettings::self()->smb4k_catItem()->setDefaultValue( program_paths["smb4k_cat"] ); + + if ( Smb4KSettings::smb4k_cat().isEmpty() ) + { + Smb4KSettings::self()->smb4k_catItem()->setDefault(); + } + } + + if ( !program_list["smb4k_mv"] ) + { + missing.append( "smb4k_mv" ); + } + else + { + Smb4KSettings::self()->smb4k_mvItem()->setDefaultValue( program_paths["smb4k_mv"] ); + + if ( Smb4KSettings::smb4k_mv().isEmpty() ) + { + Smb4KSettings::self()->smb4k_mvItem()->setDefault(); + } + } + + if ( !missing.isEmpty() ) + { + // Error out if one of the mandatory programs is + // missing: + + Smb4KError::error( ERROR_MISSING_PROGRAMS, missing.join( ", " ) ); + exit( EXIT_FAILURE ); + } + else + { + // Check for the optional programs: + + if ( !program_list["super"] ) + { + if ( (Smb4KSettings::useForceUnmount() || + Smb4KSettings::alwaysUseSuperUser()) && + Smb4KSettings::superUserProgram() == + Smb4KSettings::EnumSuperUserProgram::Super ) + { + Smb4KError::information( INFO_DISABLE_SUID_FEATURE, "super" ); + + // Reset the super user settings: + Smb4KSettings::self()->useForceUnmountItem()->setDefault(); + Smb4KSettings::self()->alwaysUseSuperUserItem()->setDefault(); + } + else + { + // Do nothing + } + } + else + { + Smb4KSettings::self()->superItem()->setDefaultValue( program_paths["super"] ); + + if ( Smb4KSettings::super().isEmpty() ) + { + Smb4KSettings::self()->superItem()->setDefault(); + } + } + + if ( !program_list["sudo"] ) + { + if ( (Smb4KSettings::useForceUnmount() || + Smb4KSettings::alwaysUseSuperUser()) && + Smb4KSettings::superUserProgram() == + Smb4KSettings::EnumSuperUserProgram::Super ) + { + Smb4KError::information( INFO_DISABLE_SUID_FEATURE, "sudo" ); + + // Reset the super user settings: + Smb4KSettings::self()->useForceUnmountItem()->setDefault(); + Smb4KSettings::self()->alwaysUseSuperUserItem()->setDefault(); + } + else + { + // Do nothing + } + } + else + { + Smb4KSettings::self()->sudoItem()->setDefaultValue( program_paths["sudo"] ); + + if ( Smb4KSettings::sudo().isEmpty() ) + { + Smb4KSettings::self()->sudoItem()->setDefault(); + } + } + + if ( program_list["dvips"] ) + { + Smb4KSettings::self()->dvipsItem()->setDefaultValue( program_paths["dvips"] ); + + if ( Smb4KSettings::dvips().isEmpty() ) + { + Smb4KSettings::self()->dvipsItem()->setDefault(); + } + } + + if ( program_list["enscript"] ) + { + Smb4KSettings::self()->enscriptItem()->setDefaultValue( program_paths["enscript"] ); + + if ( Smb4KSettings::enscript().isEmpty() ) + { + Smb4KSettings::self()->enscriptItem()->setDefault(); + } + } + + if ( program_list["rsync"] ) + { + Smb4KSettings::self()->rsyncItem()->setDefaultValue( program_paths["rsync"] ); + + if ( Smb4KSettings::rsync().isEmpty() ) + { + Smb4KSettings::self()->rsyncItem()->setDefault(); + } + } + + if ( program_list["konsole"] ) + { + Smb4KSettings::self()->konsoleItem()->setDefaultValue( program_paths["konsole"] ); + + if ( Smb4KSettings::konsole().isEmpty() ) + { + Smb4KSettings::self()->konsoleItem()->setDefault(); + } + } + + // Write the configuration to disk: + Smb4KSettings::writeConfig(); + } +} + + +void Smb4KCore::setDefaultSettings() +{ + // Samba options that have to be dynamically imported from smb.conf: + QMap opts = optionsHandler()->globalSambaOptions(); + + if ( !opts["netbios name"].isEmpty() ) + { + Smb4KSettings::self()->netBIOSNameItem()->setDefaultValue( opts["netbios name"] ); + + if ( Smb4KSettings::netBIOSName().isEmpty() ) + { + Smb4KSettings::self()->netBIOSNameItem()->setDefault(); + } + } + + if ( !opts["workgroup"].isEmpty() ) + { + Smb4KSettings::self()->domainNameItem()->setDefaultValue( opts["workgroup"] ); + + if ( Smb4KSettings::domainName().isEmpty() ) + { + Smb4KSettings::self()->domainNameItem()->setDefault(); + } + } + + if ( !opts["socket options"].isEmpty() ) + { + Smb4KSettings::self()->socketOptionsItem()->setDefaultValue( opts["socket options"] ); + + if ( Smb4KSettings::socketOptions().isEmpty() ) + { + Smb4KSettings::self()->socketOptionsItem()->setDefault(); + } + } + + if ( !opts["netbios scope"].isEmpty() ) + { + Smb4KSettings::self()->netBIOSScopeItem()->setDefaultValue( opts["netbios scope"] ); + + if ( Smb4KSettings::netBIOSScope().isEmpty() ) + { + Smb4KSettings::self()->netBIOSScopeItem()->setDefault(); + } + } + + if ( !opts["name resolve order"].isEmpty() ) + { + Smb4KSettings::self()->nameResolveOrderItem()->setDefaultValue( opts["name resolve order"] ); + + if ( Smb4KSettings::nameResolveOrder().isEmpty() ) + { + Smb4KSettings::self()->nameResolveOrderItem()->setDefault(); + } + } + + if ( !opts["interfaces"].isEmpty() ) + { + Smb4KSettings::self()->broadcastAddressItem()->setDefaultValue( opts["interfaces"] ); + + if ( Smb4KSettings::broadcastAddress().isEmpty() ) + { + Smb4KSettings::self()->broadcastAddressItem()->setDefault(); + } + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KCore::slotSetScannerState( int state ) +{ + m_scanner_state = state; + setCurrentState( state ); + emit runStateChanged(); +} + + +void Smb4KCore::slotSetMounterState( int state ) +{ + m_mounter_state = state; + setCurrentState( state ); + emit runStateChanged(); +} + + +void Smb4KCore::slotSetPrinterHandlerState( int state ) +{ + m_print_state = state; + setCurrentState( state ); + emit runStateChanged(); +} + + +void Smb4KCore::slotSetSynchronizerState( int state ) +{ + m_syncer_state = state; + setCurrentState( state ); + emit runStateChanged(); +} + + +void Smb4KCore::slotSetPreviewerState( int state ) +{ + m_previewer_state = state; + setCurrentState( state ); + emit runStateChanged(); +} + + +void Smb4KCore::slotShutdown() +{ + Smb4KSettings::writeConfig(); +} + +#include "smb4kcore.moc" diff --git a/smb4k/core/smb4kcore.h b/smb4k/core/smb4kcore.h new file mode 100644 index 0000000..fbaa539 --- /dev/null +++ b/smb4k/core/smb4kcore.h @@ -0,0 +1,354 @@ +/*************************************************************************** + smb4kcore - The main core class of Smb4K. + ------------------- + begin : Do Apr 8 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KCORE_H +#define SMB4KCORE_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include +#include + +// application specific includes +#include "smb4kscanner.h" +#include "smb4kmounter.h" +#include "smb4kfileio.h" +#include "smb4kbookmarkhandler.h" +#include "smb4kprint.h" +#include "smb4ksynchronizer.h" +#include "smb4kpreviewer.h" + +// forward declarations +class Smb4KWorkgroupItem; +class Smb4KHostItem; +class Smb4KShare; + + +/** + * This is the top-level core class. It inherits most of the core classes. + * + * @author Alexander Reinholdt + */ + +class Smb4KCore : public QObject +{ + Q_OBJECT + + public: + /** + * Returns a static pointer to this class. + */ + static Smb4KCore *self(); + + /** + * The destructor. + */ + ~Smb4KCore(); + + /** + * This function registers with the DCOP server and starts the core. + * It initializes the scanning of the network, the remounting of + * recently used shares, etc. Use this, if you want to take advantage + * of the automatic features of Smb4K's core. + */ + void init(); + + /** + * Returns the state the scanner is in. + */ + static int scannerState() { return self()->m_scanner_state; } + + /** + * Returns TRUE, if the scanner is running, otherwise FALSE. + */ + static bool scannerIsRunning() { return self()->m_scanner->isRunning(); } + + /** + * Returns the state the mounter is in. + */ + static int mounterState() { return self()->m_mounter_state; } + + /** + * Returns TRUE, if the mounter is running, otherwise FALSE. + */ + static bool mounterIsRunning() { return self()->m_mounter->isRunning(); } + + /** + * Returns the state the print object is in. + */ + static int printState() { return self()->m_print_state; } + + /** + * Returns TRUE, if the print object is running, otherwise FALSE. + */ + static bool printIsRunning() { return self()->m_print->isRunning(); } + + /** + * Returns the state the synchronizer is in. + */ + static int synchronizerState() { return self()->m_syncer_state; } + + /** + * Returns TRUE, if the synchronizer is running, otherwise FALSE. + */ + static bool synchronizerIsRunning() { return self()->m_synchronizer->isRunning(); } + + /** + * Returns TRUE if one of the core classes is doing something. + */ + static bool isRunning(); + + /** + * Returns the current state the core is in. + */ + static int currentState() { return self()->m_current_state; } + + /** + * Returns a pointer to the scanner object. + */ + static Smb4KScanner *scanner() { return self()->m_scanner; } + + /** + * Returns a pointer to the mounter object. + */ + static Smb4KMounter *mounter() { return self()->m_mounter; } + + /** + * Returns a pointer to the bookmark handler object. + */ + static Smb4KBookmarkHandler *bookmarkHandler() { return self()->m_bookmarkHandler; } + + /** + * Returns a pointer to the file IO object. + */ + static Smb4KFileIO *fileIO() { return self()->m_fileIO; } + + /** + * Returns a pointer to the printer handler object. + */ + static Smb4KPrint *print() { return self()->m_print; } + + /** + * Returns a pointer to the synchronizer object. + */ + static Smb4KSynchronizer *synchronizer() { return self()->m_synchronizer; } + + /** + * Returns a pointer to the previewer object. + */ + static Smb4KPreviewer *previewer() { return self()->m_previewer; } + + /** + * Aborts any action of the core. + */ + static void abort(); + + /** + * This enumeration determines with which application the mount point + * of the current mounted share is to be opened. + */ + enum OpenWith { Konqueror, Konsole }; + + /** + * Opens the mount point of a share. This function is used to run the file manager. + * + * @param share The share to be opened. + * + * @param openWith Integer of type Smb4KCore::OpenWith. Determines with which + * application the share should be opened. + */ + static void open( Smb4KShare *share, int openWith = Konqueror ); + + signals: + /** + * This signal is emitted, if one of the core objects + * starts or stops running. + */ + void runStateChanged(); + + protected: + /** + * The constructor + */ + Smb4KCore(); + + /** + * A static pointer to this class + */ + static Smb4KCore *m_self; + + protected slots: + /** + * This slot sets the run state of the scanner. + * + * @param state The run state the scanner is in. For definition of the + * run states see smb4kdefs.h header file. + */ + void slotSetScannerState( int state ); + + /** + * This slot sets the run state of the mounter. + * + * @param state The run state the mounter is in. For definition of the + * run states see smb4kdefs.h header file. + */ + void slotSetMounterState( int state ); + + /** + * This slot sets the run state of the synchronizer. + * + * @param state The run state the synchronizer is in. For definition of the + * run states see smb4kdefs.h header file. + */ + void slotSetSynchronizerState( int state ); + + /** + * This slot sets the run state of the print handler. + * + * @param state The run state the print handler is in. For definition of the + * run states see smb4kdefs.h header file. + */ + void slotSetPrinterHandlerState( int state ); + + /** + * This slot sets the run state for the previewer. + * + * @param state The state the previewer is in. For definition of the + * run states see smb4kdefs.h header file. + */ + void slotSetPreviewerState( int state ); + + /** + * This slot is connected to the KApplication::shutDown() signal. It is invoked + * when the application is shut down by the KDE logout or by pressing CTRL+Q, etc. + */ + void slotShutdown(); + + private: + /** + * The scanner object. + */ + Smb4KScanner *m_scanner; + + /** + * The mounter object. + */ + Smb4KMounter *m_mounter; + + /** + * The bookmark handler object. + */ + Smb4KBookmarkHandler *m_bookmarkHandler; + + /** + * The FileIO object. + */ + Smb4KFileIO *m_fileIO; + + /** + * The printer handler object. + */ + Smb4KPrint *m_print; + + /** + * The synchronizer object. + */ + Smb4KSynchronizer *m_synchronizer; + + /** + * The previewer object. + */ + Smb4KPreviewer *m_previewer; + + /** + * The state the sanner is in. + */ + int m_scanner_state; + + /** + * The state the mounter is in. + */ + int m_mounter_state; + + /** + * Holds the current state. + */ + int m_current_state; + + /** + * The state the printer handler is in. + */ + int m_print_state; + + /** + * The state the synchronizer is in. + */ + int m_syncer_state; + + /** + * The state of the previewer is in. + */ + int m_previewer_state; + + /** + * This function is used to set the current state of the core. + * + * @param state One of the states defined in smb4kdefs.h + */ + void setCurrentState( int state ); + + /** + * Searches for the needed programs and emits an error + * if mandatory ones are missing. + */ + void searchPrograms(); + + /** + * This is the list of workgroups known to Smb4K. It is filled by + * the scanner and may be used by all other classes that are invoked + * by Smb4KCore. + */ + QValueList m_workgroups; + + /** + * This is the list of remote hosts known to Smb4K. It is filled by + * the scanner and may be used by all other classes that are invoked + * by Smb4KCore. + */ + QValueList m_hosts; + + /** + * Set default values for settings that depend on the system Smb4K is + * running on and that have to be set dynamically. + */ + void setDefaultSettings(); +}; + +#endif diff --git a/smb4k/core/smb4kdefs.h b/smb4k/core/smb4kdefs.h new file mode 100644 index 0000000..b9ce07f --- /dev/null +++ b/smb4k/core/smb4kdefs.h @@ -0,0 +1,147 @@ +/*************************************************************************** + smb4kdefs.h - Definitions for Smb4K + ------------------- + begin : Mo Mär 15 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + + +#ifndef SMB4KDEFS_H +#define SMB4KDEFS_H + + +#ifdef HAVE_CONFIG_H +#include +#endif + +// +// Run states +// + +#define SCANNER_INIT 0 +#define SCANNER_OPENING_WORKGROUP 1 +#define SCANNER_OPENING_HOST 2 +#define SCANNER_RETRIEVING_INFO 3 +#define SCANNER_SEARCHING 4 +#define SCANNER_RETRYING_OPENING_HOST 5 +#define SCANNER_STOP 6 +#define MOUNTER_MOUNTING 7 +#define MOUNTER_UNMOUNTING 8 +#define MOUNTER_STOP 9 +#define PRINT_START 10 +#define PRINT_STOP 11 +#define SYNCHRONIZER_START 12 +#define SYNCHRONIZER_STOP 13 +#define PREVIEWER_START 14 +#define PREVIEWER_STOP 15 +#define CORE_STOP 16 + +// +// Error codes: +// + +// (1) Network related errors. +#define ERROR_GETTING_BROWSELIST 100 +#define ERROR_GETTING_MEMBERS 101 +#define ERROR_GETTING_SHARES 102 +#define ERROR_GETTING_PREVIEW 103 +#define ERROR_NET_COMMAND 104 +#define ERROR_IP_CANNOT_BE_USED 105 + +// (2) Errors involving mounting, unmounting +// and importing shares. +#define ERROR_MOUNTING_SHARE 106 +#define ERROR_UNMOUNTING_SHARE 107 +#define ERROR_UNMOUNTING_NOT_ALLOWED 108 +#define ERROR_MOUNTPOINT_EMPTY 109 +#define ERROR_IMPORTING_SHARES 110 + +// (3) Errors that are connected to printing +#define ERROR_PRINTING 111 + +// (4) Errors that are connected to +// synchronization +#define ERROR_SYNCHRONIZING 112 + +// (5) Errors that occur when handling +// bookmarks +#define ERROR_BOOKMARK_PRINTER 113 + +// (6) Errors that occur when handling +// authentication data +#define ERROR_OPENING_WALLET_FAILED 114 + +// (7) Errors that occur when handling files +// and directories. +#define ERROR_FILE_NOT_FOUND 115 +#define ERROR_OPENING_FILE 116 +#define ERROR_READING_FILE 117 +#define ERROR_WRITING_FILE 118 +#define ERROR_CLOSING_FILE 119 +#define ERROR_GETTING_PERMISSIONS 120 +#define ERROR_DIRECTORY_NOT_FOUND 121 +#define ERROR_CREATING_TEMP_DIR 122 +#define ERROR_CREATING_TEMP_FILE 123 +#define ERROR_FILE_IS_IRREGULAR 124 +#define ERROR_MKDIR_FAILED 125 + +// (8) Errors that occur when handling programs +#define ERROR_MISSING_PROGRAMS 126 +#define ERROR_COMMAND_NOT_FOUND 127 + +// (9) Other errors +#define ERROR_UNKNOWN 128 +#define ERROR_GETTING_HOSTNAME 129 +#define ERROR_LOCKED 130 +#define ERROR_FEATURE_NOT_ENABLED 131 +#define ERROR_GETTING_GIDS 132 + +// +// Warning codes: +// + +/* None defined yet. use 200 ff. for that */ + +// +// Information codes: +// + +#define INFO_MIMETYPE_NOT_SUPPORTED 300 +#define INFO_DISABLE_SUID_FEATURE 301 +#define INFO_BOOKMARK_LABEL_IN_USE 302 + +// +// Event types +// + +#define EVENT_LOAD_SETTINGS 100000 +#define EVENT_SET_FOCUS 100001 +#define EVENT_SCAN_NETWORK 100002 + +// +// Other definitions +// + +#define TIMER_INTERVAL 25 +#define THREAD_WAITING_TIME 100 +#define TEMPPATHLEN 18 + +#endif diff --git a/smb4k/core/smb4kerror.cpp b/smb4k/core/smb4kerror.cpp new file mode 100644 index 0000000..66a3089 --- /dev/null +++ b/smb4k/core/smb4kerror.cpp @@ -0,0 +1,408 @@ +/*************************************************************************** + smb4kerror - This is the class that manages the error messages. + ------------------- + begin : Fr Sep 22 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include +#include + +// application specific includes +#include "smb4kerror.h" +#include "smb4kdefs.h" + +void Smb4KError::error( int code, const QString &text, const QString &details ) +{ + switch ( code ) + { + case ERROR_GETTING_BROWSELIST: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The browse list could not be retrieved.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The browse list could not be retrieved.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_GETTING_MEMBERS: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The list of servers could not be retrieved.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The list of servers could not be retrieved.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_GETTING_SHARES: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The list of shares could not be retrieved.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The list of shares could not be retrieved.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_GETTING_PREVIEW: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The preview could not be compiled.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The preview could not be compiled.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_OPENING_WALLET_FAILED: + { + KMessageBox::error( 0, i18n( "The wallet \"%1\" could not be opened. KWallet support will be disabled for this session." ).arg( text ) ); + + break; + } + case ERROR_GETTING_PERMISSIONS: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "Some file permissions could not be determined.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "Some file permissions could not be determined.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_UNMOUNTING_NOT_ALLOWED: + { + KMessageBox::error( 0, i18n( "You are not allowed to unmount this share, because it is owned by another user." ) ); + + break; + } + case ERROR_MOUNTING_SHARE: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The share \"%1\" could not be mounted.\nDetailed information cannot be provided because there was no error message." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The share \"%1\" could not be mounted.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_UNMOUNTING_SHARE: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The share \"%1\" could not be unmounted.\nDetailed information cannot be provided because there was no error message." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The share \"%1\" could not be unmounted.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_FILE_NOT_FOUND: + { + KMessageBox::error( 0, i18n( "The file \"%1\" could not be found." ).arg( text ) ); + + break; + } + case ERROR_READING_FILE: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The file \"%1\" could not be read." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be read.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_GETTING_HOSTNAME: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The name of your computer could not be determined by using the gethostname() system call.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The name of your computer could not be determined by using the gethostname() system call.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_MISSING_PROGRAMS: + { + KMessageBox::error( 0, i18n( "Either your PATH environment variable is not set properly or there are the following programs missing on your system:\n%1\nPlease correct this and restart Smb4K." ).arg( text ) ); + + break; + } + case ERROR_LOCKED: + { + KMessageBox::error( 0, i18n( "The file \"%1\" is currently being edited by user %2. To avoid any problems, access to this file is denied at the moment. Please try again later." ).arg( text.section( ":", 1, 1 ), text.section( ":", 0, 0 ) ) ); + + break; + } + case ERROR_MKDIR_FAILED: + { + KMessageBox::error( 0, i18n( "The directory \"%1\" could not be created." ).arg( text ) ); + + break; + } + case ERROR_WRITING_FILE: + { + KMessageBox::error( 0, i18n( "The file \"%1\" could not be written." ).arg( text ) ); + + break; + } + case ERROR_MOUNTPOINT_EMPTY: + { + KMessageBox::error( 0, i18n( "The share could not be unmounted, because the mount point string was empty." ) ); + + break; + } + case ERROR_FEATURE_NOT_ENABLED: + { + KMessageBox::error( 0, i18n( "This feature has not been enabled." ) ); + + break; + } + case ERROR_BOOKMARK_PRINTER: + { + KMessageBox::error( 0, i18n( "Printers cannot be bookmarked." ) ); + + break; + } + case ERROR_IP_CANNOT_BE_USED: + { + KMessageBox::sorry( 0, i18n( "IP addresses are not supported with this search method. Please choose \"Use nmblookup\" in the configuration dialog and try again." ) ); + + break; + } + case ERROR_IMPORTING_SHARES: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The list of mounted SMBFS and CIFS shares could not be imported.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The list of mounted SMBFS and CIFS shares could not be imported.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_COMMAND_NOT_FOUND: + { + KMessageBox::error( 0, i18n( "The command \"%1\" could not be found." ).arg( text ) ); + + break; + } + case ERROR_PRINTING: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The file \"%1\" could not be printed.\nDetailed information cannot be provided because there was no error message." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be printed.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_CREATING_TEMP_DIR: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The temporary directory \"%1\" could not be created.\nDetailed information cannot be provided because there was no error message." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The temporary directory \"%1\" could not be created.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_CREATING_TEMP_FILE: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The temporary file \"%1\" could not be created.\nDetailed information cannot be provided because there was no error message." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The temporary file \"%1\" could not be created.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_DIRECTORY_NOT_FOUND: + { + KMessageBox::error( 0, i18n( "The directory \"%1\" could not be found." ).arg( text ) ); + + break; + } + case ERROR_FILE_IS_IRREGULAR: + { + KMessageBox::error( 0, i18n( "The file \"%1\" is irregular. That means it is either a symlink, a fifo, or something similar. This could indicate that someone is trying to exploit your system. Please inform your system administrator." ).arg( text ) ); + + break; + } + case ERROR_SYNCHRONIZING: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The synchronization could not the accomplished successfully.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The synchronization could not the accomplished successfully.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_OPENING_FILE: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The file \"%1\" could not be opened." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be opened.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_CLOSING_FILE: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The file \"%1\" could not be closed." ).arg( text ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be closed.\nRead the error message under \"Details\" to find out more." ).arg( text ), details ); + } + + break; + } + case ERROR_NET_COMMAND: + { + KMessageBox::error( 0, i18n( "The list of arguments for the \"net\" command could not be assembled.\nAt the moment it reads: %1" ).arg( text ) ); + + break; + } + case ERROR_GETTING_GIDS: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "The list of supplementary group IDs could not be determined." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "The list of supplementary group IDs could not be determined.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + case ERROR_UNKNOWN: + default: + { + if ( details.stripWhiteSpace().isEmpty() ) + { + KMessageBox::error( 0, i18n( "An unknown error occurred.\nDetailed information cannot be provided because there was no error message." ) ); + } + else + { + KMessageBox::detailedError( 0, i18n( "An unknown error occurred.\nRead the error message under \"Details\" to find out more." ), details ); + } + + break; + } + } +} + + +int Smb4KError::warning( int code, const QString &, const QString & ) +{ + switch ( code ) + { + default: + { + return 0; + } + } +} + + +void Smb4KError::information( int code, const QString &text, const QString &details ) +{ + switch ( code ) + { + case INFO_MIMETYPE_NOT_SUPPORTED: + { + KMessageBox::information( 0, i18n( "The mimetype \"%1\" is not supported. Please convert the file to PostScript or PDF." ).arg( text ) ); + + break; + } + case INFO_DISABLE_SUID_FEATURE: + { + KMessageBox::information( 0, i18n( "You previously chose to use \"%1\", but now it is missing on your system. Smb4K will disable this feature." ).arg( text ) ); + + break; + } + case INFO_BOOKMARK_LABEL_IN_USE: + { + KMessageBox::information( 0, i18n( "The label \"%1\" is used more than once. It will automatically be renamed for bookmark \"%2\" to avoid confusion." ).arg( text, details ) ); + + break; + } + default: + { + break; + } + } +} + +// No moc file needs to be included diff --git a/smb4k/core/smb4kerror.h b/smb4k/core/smb4kerror.h new file mode 100644 index 0000000..fb5f980 --- /dev/null +++ b/smb4k/core/smb4kerror.h @@ -0,0 +1,92 @@ +/*************************************************************************** + smb4kerror - This is the class that manages the error messages. + ------------------- + begin : Fr Sep 22 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KERROR_H +#define SMB4KERROR_H + +#ifdef HAVE_CONFIG_H +#include +#endif + + +class Smb4KError +{ + public: + /** + * Show an error that occurred in the core. + * + * @param code The error code as defined in smb4kdefs.h + * + * @param text Short text which will be included in the message that's shown + * to the user. Normally, a file name or similar is entered here. + * May be left blank if you do not need to fill text into the error + * message. Please note, that this text is not used to show details. + * + * @param details The text passed here is used to show details. Please note, that + * it depends on the kind of error if it is indeed shown. + */ + static void error( int code, + const QString &text = QString::null, + const QString &details = QString::null ); + + /** + * Show a warning. + * + * @param code The code as defined in smb4kdefs.h + * + * @param text Short text which will be included in the message that's shown + * to the user. Normally, a file name or similar is entered here. + * May be left blank if you do not need to fill text into the error + * message. Please note, that this text is not used to show details. + * + * @param details The text passed here is used to show details. Please note, that + * it depends on the kind of error if it is indeed shown. + * + * @returns an integer value according to KMessageBox::ButtonCode or 0 if the warning code + * is unknown. + */ + static int warning( int code, + const QString &text = QString::null, + const QString &details = QString::null ); + + /** + * Show an information. + * + * @param code The code as defined in smb4kdefs.h + * + * @param text Short text which will be included in the message that's shown + * to the user. Normally, a file name or similar is entered here. + * May be left blank if you do not need to fill text into the error + * message. Please note, that this text is not used to show details. + * + * @param details The text passed here is used to show details. Please note, that + * it depends on the kind of error if it is indeed shown. + */ + static void information( int code, + const QString &text = QString::null, + const QString &details = QString::null ); +}; + +#endif diff --git a/smb4k/core/smb4kfileio.cpp b/smb4k/core/smb4kfileio.cpp new file mode 100644 index 0000000..2b77cf5 --- /dev/null +++ b/smb4k/core/smb4kfileio.cpp @@ -0,0 +1,1795 @@ +/*************************************************************************** + smb4kfileio - Does file IO operations for Smb4K + ------------------- + begin : Do Jan 1 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include + +// system specific includes +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4kfileio.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + + + +Smb4KFileIO::Smb4KFileIO( QObject *parent, const char *name ) : QObject( parent, name ) +{ + m_operation = NoOperation; + m_state = Idle; + m_error_occurred = false; + + m_proc = new KProcess( this, "FileIOProcess" ); + m_proc->setUseShell( true ); + + connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( processExited( KProcess * ) ), + this, SLOT( slotProcessExited( KProcess * ) ) ); + + connect( kapp, SIGNAL( shutDown() ), + this, SLOT( slotShutdown() ) ); +} + + +Smb4KFileIO::~Smb4KFileIO() +{ +} + + +bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation ) +{ + m_operation = operation; + bool ok = false; + + // Stop here if nothing has changed: + if ( m_operation == NoOperation ) + { + emit finished(); + + ok = true; + + return ok; + } + + QString file = "sudoers"; + + if ( createLockFile( file ) ) + { + // Find the file first: + QCString canonical_path = findFile( file ); + + if ( !canonical_path.isEmpty() ) + { + // Stat the file, so that we know that it is safe to + // read from and write to it and whether we need to + // ask for the super user's password: + struct stat buf; + + if ( lstat( canonical_path, &buf ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_PERMISSIONS, canonical_path, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + + // Look for the groups the user is in: + long ngroups_max; + ngroups_max = sysconf(_SC_NGROUPS_MAX); + + gid_t list[ngroups_max]; + + if ( getgroups( ngroups_max, list ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_GIDS, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + return ok; // false + } + + gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization + bool found_gid = false; + int i = 0; + + while ( list[i] ) + { + if ( list[i] == buf.st_gid ) + { + sup_gid = list[i]; + found_gid = true; + } + + i++; + } + + // Error out if the file is irregular. + // Yes, yes, I know that this is normally done in a different + // way and that there might be a race here, but, hey, right here + // I don't care! + if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) ) + { + Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, QString::null ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + + // Check access rights: + if ( (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ || + (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ || + ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ ) + { + // The user has read and write access. + + QFile file ( canonical_path ); + QStringList contents; + + if ( file.open( IO_ReadWrite ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( "\n", ts.read(), true ); + + bool write = false; + + switch ( m_operation ) + { + case Insert: + { + size_t hostnamelen = 255; + char *hn = new char[hostnamelen]; + + if ( gethostname( hn, hostnamelen ) == -1 ) + { + int error_number = errno; + Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + + QString hostname( hn ); + + delete [] hn; + + if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 ) + { + contents.append( "# Entries for Smb4K users." ); + contents.append( "# Generated by Smb4K. Please do not modify!" ); + contents.append( "User_Alias\tSMB4KUSERS = "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) ); + contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" ); + contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() ); + contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() ); + contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_mount() ); + contents.append( "# End of Smb4K user entries." ); + + write = true; + } + else + { + // Find the beginning and the end of the entries in + // the sudoers file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 ) + { + (*it).append( ","+QString( getpwuid( getuid() )->pw_name ) ); + + write = true; + + break; + } + else + { + continue; + } + } + } + + break; + } + case Remove: + { + // Find the beginning and the end of the entries in + // the sudoers file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + // Now, check if the user is in the list of users. If he is, + // remove him from there or remove all if he is the only one: + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) ) + { + QString users = (*it).section( "=", 1, 1 ).stripWhiteSpace(); + + if ( users.contains( "," ) == 0 ) + { + // In this case, there is only one user in the list. Check if + // it is the user who requested the removal: + if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 ) + { + // They are equal. Remove everything: + contents.erase( begin, end ); + contents.remove( end ); + + write = true; + + break; + } + else + { + // They are not equal: Do nothing. + break; + } + } + else + { + // In this case there is more than one user in the list. + // Remove the user who requested the removal: + QStringList list = QStringList::split( ",", users, false ); + list.remove( getpwuid( getuid() )->pw_name ); + + (*it).replace( users, list.join( "," ) ); + + write = true; + + break; + } + } + else + { + continue; + } + } + + break; + } + default: + { + file.close(); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + }; + + if ( write ) + { + // Prepare the contents: remove empty lines from the end. + QStringList::Iterator it = contents.end(); + + // Move the iterator to the last entry in the list: + --it; + + while ( (*it).stripWhiteSpace().isEmpty() ) + { + it = contents.remove( it ); + --it; + } + + // Now write the contents to the file. The permissions + // will be preserved by this action. + ts << contents.join( "\n" ) << endl; + + file.close(); + } + else + { + // The entries are already in the file. + } + + ok = true; + + emit finished(); + + removeLockFile(); + + return ok; + } + else + { + Smb4KError::error( ERROR_OPENING_FILE, canonical_path, file.errorString() ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + } + else + { + // The user does not have enough access rights to perform + // the modification of the sudoers file. So, we need to use + // kdesu to get the contents of the file. + + // Compose the command: + QString command; + command.append( "kdesu -t -c \"smb4k_cat " ); + command.append( canonical_path+"\"" ); + command.append( " ; sleep 2" ); + + m_state = ReadSudoers; + + ok = true; + + *m_proc << command; + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); + + // The process is not finished, so finished() will be emitted + // later and the lock file will also be removed at the end. + + return ok; + } + } + else + { + Smb4KError::error( ERROR_FILE_NOT_FOUND, canonical_path ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + } + else + { + // The error message has already been shown by + // Smb4KFileIO::createLockFile() + emit failed(); + emit finished(); + + // We need not remove the lock file here. + + return ok; // false + } + + return ok; +} + + +bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation ) +{ + m_operation = operation; + bool ok = false; + + // Stop here if nothing has changed: + if ( m_operation == NoOperation ) + { + emit finished(); + + ok = true; + + return ok; + } + + QString file = "super.tab"; + + if ( createLockFile( file ) ) + { + // Find the file first: + QCString canonical_path = findFile( file ); + + if ( !canonical_path.isEmpty() ) + { + // Stat the file, so that we know that it is safe to + // read from and write to it and whether we need to + // ask for the super user's password: + struct stat buf; + + if ( lstat( canonical_path, &buf ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_PERMISSIONS, canonical_path, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + + // Look for the groups the user is in: + long ngroups_max; + ngroups_max = sysconf(_SC_NGROUPS_MAX); + + gid_t list[ngroups_max]; + + if ( getgroups( ngroups_max, list ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_GIDS, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + return ok; // false + } + + gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization + bool found_gid = false; + int i = 0; + + while ( list[i] ) + { + if ( list[i] == buf.st_gid ) + { + sup_gid = list[i]; + found_gid = true; + } + + i++; + } + + // Error out if the file is irregular. + // Yes, yes, I know that this is normally done in a different + // way and that there might be a race here, but, hey, right here + // I don't care! + if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) ) + { + Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, QString::null ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + + // Check access rights: + if ( (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ || + (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ || + ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ ) + { + // The user has read and write access. + + QFile file ( canonical_path ); + QStringList contents; + + if ( file.open( IO_ReadWrite ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( "\n", ts.read(), true ); + + bool write = false; + + switch ( m_operation ) + { + case Insert: + { + size_t hostnamelen = 255; + char *hn = new char[hostnamelen]; + + if ( gethostname( hn, hostnamelen ) == -1 ) + { + int error_number = errno; + Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + + QString hostname( hn ); + + delete [] hn; + + if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 ) + { + contents.append( "# Entries for Smb4K users." ); + contents.append( "# Generated by Smb4K. Please do not modify!" ); + contents.append( ":define Smb4KUsers "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) ); +#ifndef __FreeBSD__ + contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+ + "\t$(Smb4KUsers)\tuid=root\tgid=root" ); + contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=root" ); + contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=root\tenv=PASSWD,USER" ); +#else + contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+ + "\t$(Smb4KUsers)\tuid=root\tgid=wheel" ); + contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=wheel" ); + contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=wheel\tsetenv=HOME=$CALLER_HOME\tenv=PASSWD,USER" ); +#endif + contents.append( "# End of Smb4K user entries." ); + + write = true; + } + else + { + // Find the beginning and the end of the entries in + // the super.tab file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 ) + { + (*it).append( ","+QString( getpwuid( getuid() )->pw_name ) ); + + write = true; + + break; + } + else + { + continue; + } + } + } + + break; + } + case Remove: + { + // Find the beginning and the end of the entries in + // the super.tab file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + // Now, check if the user is in the list of users. If he is, + // remove him from there or remove all if he is the only one: + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( ":define Smb4KUsers" ) ) + { + QString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace(); + + if ( users.contains( "," ) == 0 ) + { + // In this case, there is only one user in the list. Check if + // it is the user who requested the removal: + if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 ) + { + // They are equal. Remove everything: + contents.erase( begin, end ); + contents.remove( end ); + + write = true; + + break; + } + else + { + // They are not equal: Do nothing. + break; + } + } + else + { + // In this case there is more than one user in the list. + // Remove the user who requested the removal: + QStringList list = QStringList::split( ",", users, false ); + list.remove( getpwuid( getuid() )->pw_name ); + + (*it).replace( users, list.join( "," ) ); + + write = true; + + break; + } + } + else + { + continue; + } + } + + break; + } + default: + { + file.close(); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + }; + + if ( write ) + { + // Prepare the contents: remove empty lines from the end. + QStringList::Iterator it = contents.end(); + + // Move the iterator to the last entry in the list: + --it; + + while ( (*it).stripWhiteSpace().isEmpty() ) + { + it = contents.remove( it ); + --it; + } + + // Now write the contents to the file. The permissions + // will be preserved by this action. + ts << contents.join( "\n" ) << endl; + + file.close(); + } + else + { + // The entries are already in the file. + } + + ok = true; + + emit finished(); + + removeLockFile(); + + return ok; + } + else + { + Smb4KError::error( ERROR_OPENING_FILE, canonical_path, file.errorString() ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + } + else + { + // The user does not have enough access rights to perform + // the modification of the sudoers file. So, we need to use + // kdesu to get the contents of the file. + + // Compose the command: + QString command; + command.append( "kdesu -t -c \"smb4k_cat " ); + command.append( canonical_path+"\"" ); + command.append( " ; sleep 2" ); + + m_state = ReadSuperTab; + + ok = true; + + *m_proc << command; + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); + + // The process is not finished, so finished() will be emitted + // later and the lock file will also be removed at the end. + + return ok; + } + } + else + { + Smb4KError::error( ERROR_FILE_NOT_FOUND, canonical_path ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return ok; // false + } + } + else + { + // The error message has already been shown by + // Smb4KFileIO::createLockFile() + emit failed(); + emit finished(); + + // We need not remove the lock file here. + + return ok; // false + } + + return ok; +} + + +bool Smb4KFileIO::createLockFile( const QString &filename ) +{ + bool ok = false; + + // Determine the directory where to write the lock file. First, try + // /var/lock and than /var/tmp. If that does not work either, fall + // back to /tmp. + if ( m_lock_file.isEmpty() ) + { + QValueList dirs; + dirs << "/var/lock" << "/var/tmp" << "/tmp"; + + struct stat buf; + + for ( QValueList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) + { + // First check if the directory is available and writable + if ( lstat( *it, &buf ) == -1 ) + { + int error_number = errno; + + if ( error_number != EACCES && error_number != ENOENT ) + { + Smb4KError::error( ERROR_GETTING_PERMISSIONS, *it, strerror( error_number ) ); + + return ok; // false + } + } + else + { + // Look for the groups the user is in: + long ngroups_max; + ngroups_max = sysconf(_SC_NGROUPS_MAX); + + gid_t list[ngroups_max]; + + if ( getgroups( ngroups_max, list ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_GIDS, QString::null, strerror( error_number ) ); + + return ok; // false + } + + gid_t sup_gid = 65534; // set this to gid 'nobody' for initialization + bool found_gid = false; + int i = 0; + + while ( list[i] ) + { + if ( list[i] == buf.st_gid ) + { + sup_gid = list[i]; + found_gid = true; + } + + i++; + } + + // Check whether we are stat'ing a directory and that the + // user has read/write permissions. + if ( S_ISDIR( buf.st_mode ) /* is directory */ && + (buf.st_uid == getuid() && (buf.st_mode & 00600) == (S_IWUSR | S_IRUSR)) /* user */ || + (found_gid && buf.st_gid == sup_gid && (buf.st_mode & 00060) == (S_IWGRP | S_IRGRP)) /* group */ || + ((buf.st_mode & 00006) == (S_IWOTH | S_IROTH)) /* others */ ) + { + m_lock_file = *it+"/smb4k.lock"; + + break; + } + else + { + continue; + } + } + } + } + + int file_descriptor; + + // Create the lock file if necessary and open it: + if ( (file_descriptor = open( m_lock_file, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH )) == -1 ) + { + // Error out if the opening failed: + int error_number = errno; + + Smb4KError::error( ERROR_OPENING_FILE, m_lock_file, strerror( error_number ) ); + + return ok; // false + } + else + { + // Check what we actually opened: + + struct stat file_stat; + + if ( fstat( file_descriptor, &file_stat ) == -1 ) + { + // Error out if we could not get the information about the file: + int error_number = errno; + + // FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT + Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) ); + + return ok; + } + + if ( !S_ISREG( file_stat.st_mode ) || S_ISFIFO( file_stat.st_mode ) || S_ISLNK( file_stat.st_mode ) ) + { + // Close the file and error out, if we have opened an + // "irregular" file (i.e. a symlink, a fifo, etc.). + + Smb4KError::error( ERROR_FILE_IS_IRREGULAR, m_lock_file ); + + if ( close( file_descriptor ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + else + { + // Continue if the file is regular. + + char buffer[1000]; + ssize_t size; + + if ( (size = read( file_descriptor, buffer, 1000 )) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_READING_FILE, m_lock_file, strerror( error_number ) ); + + return ok; // false + } + + if ( size >= 1000 ) + { + // FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED + Smb4KError::error( ERROR_UNKNOWN, QString::null, i18n( "Buffer size exceeded" ) ); + + return ok; // false + } + + QStringList contents = QStringList::split( '\n', QString::fromLocal8Bit( buffer, size ), false ); + QString test_string = ":"+filename; + QString entry = contents.grep( test_string, true ).join( "\n" ).stripWhiteSpace(); + + if ( !entry.isEmpty() ) + { + Smb4KError::error( ERROR_LOCKED, entry ); + + return ok; // false + } + else + { + contents << QString( "%1:%2" ).arg( getpwuid( getuid() )->pw_name ).arg( filename ); + QCString out = contents.join( "\n" ).local8Bit(); + + if ( write( file_descriptor, out, out.length() ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_WRITING_FILE, m_lock_file, strerror( error_number ) ); + + return ok; // false + } + + if ( close( file_descriptor ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) ); + + return ok; // false + } + + ok = true; + } + } + } + + return ok; +} + + +bool Smb4KFileIO::removeLockFile( const bool error_message ) +{ + // We already have the name and location of the lock + // file, so we do not need to define it here. + + int file_descriptor; + bool ok = false; + + // Open the lock file: + if ( (file_descriptor = open( m_lock_file, O_RDWR )) == -1 ) + { + // Error out if the opening failed: + int error_number = errno; + + if ( error_message && error_number != ENOENT ) + { + Smb4KError::error( ERROR_OPENING_FILE, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + else + { + // Check what we actually opened: + + struct stat file_stat; + + if ( fstat( file_descriptor, &file_stat ) == -1 ) + { + // Error out if we could not get the information about the file: + int error_number = errno; + + if ( error_message ) + { + // FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT + Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) ); + } + + return ok; + } + + if ( !S_ISREG( file_stat.st_mode ) || S_ISFIFO( file_stat.st_mode ) || S_ISLNK( file_stat.st_mode ) ) + { + // Close the file and error out, if we have opened an + // "irregular" file (i.e. a symlink, a fifo, etc.). + + if ( error_message ) + { + Smb4KError::error( ERROR_FILE_IS_IRREGULAR, m_lock_file ); + } + + if ( close( file_descriptor ) == -1 ) + { + int error_number = errno; + + if ( error_message ) + { + Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) ); + } + } + + return ok; // false + } + else + { + // Continue if the file is regular. + + char buffer[1000]; + ssize_t size; + + if ( (size = read( file_descriptor, buffer, 1000 )) == -1 ) + { + int error_number = errno; + + if ( error_message ) + { + Smb4KError::error( ERROR_READING_FILE, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + + if ( size >= 1000 ) + { + if ( error_message ) + { + // FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED + Smb4KError::error( ERROR_UNKNOWN, QString::null, i18n( "Buffer size exceeded" ) ); + } + + return ok; // false + } + + QStringList contents = QStringList::split( '\n', QString::fromLocal8Bit( buffer, size ), false ); + + // Prepare the contents of the file and write it to the disk. + // It it should be empty, remove the lock file. + for ( QStringList::Iterator it = contents.begin(); it != contents.end(); it++ ) + { + if ( (*it).startsWith( QString( getpwuid( getuid() )->pw_name )+":" ) ) + { + *it = QString::null; + + continue; + } + else + { + continue; + } + } + + contents.remove( QString::null ); + + if ( !contents.isEmpty() ) + { + // Write the remaining contents to the lock file: + + QCString out = contents.join( "\n" ).local8Bit(); + + if ( write( file_descriptor, out, out.length() ) == -1 ) + { + int error_number = errno; + + if ( error_message ) + { + Smb4KError::error( ERROR_WRITING_FILE, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + + if ( close( file_descriptor ) == -1 ) + { + int error_number = errno; + + if ( error_message ) + { + Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + + ok = true; + } + else + { + // Close and remove the lock file: + + if ( close( file_descriptor ) == -1 ) + { + int error_number = errno; + + if ( error_message ) + { + Smb4KError::error( ERROR_CLOSING_FILE, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + + if ( unlink( m_lock_file ) == -1 ) + { + int error_number = errno; + + if ( error_message ) + { + // FIXME for > 0.8.x: Replace error code with ERROR_REMOVING_FILE + Smb4KError::error( ERROR_UNKNOWN, m_lock_file, strerror( error_number ) ); + } + + return ok; // false + } + + ok = true; + } + } + } + + return ok; +} + + +const QCString Smb4KFileIO::findFile( const QString &filename ) +{ + QStringList paths; + paths << "/etc"; + paths << "/etc/samba"; + paths << "/usr/local/etc"; + paths << "/usr/local/etc/samba"; + + QString canonical_path = QString::null; + + for ( QStringList::ConstIterator it = paths.begin(); it != paths.end(); it++ ) + { + QDir::setCurrent( *it ); + + if ( QFile::exists( filename ) ) + { + canonical_path = QDir::current().canonicalPath()+"/"+filename; + + break; + } + else + { + continue; + } + } + + return canonical_path.local8Bit(); +} + + +void Smb4KFileIO::processSudoers() +{ + // If the output buffer is empty, we stop, because + // that most likely means, the user cancelled the + // kdesu dialog. + if ( m_buffer.stripWhiteSpace().isEmpty() ) + { + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + QStringList contents = QStringList::split( "\n", m_buffer, true ); + bool write = false; + + switch ( m_operation ) + { + case Insert: + { + size_t hostnamelen = 255; + char *hn = new char[hostnamelen]; + + if ( gethostname( hn, hostnamelen ) == -1 ) + { + int error_number = errno; + Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + } + + QString hostname( hn ); + + delete [] hn; + + if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 ) + { + contents.append( "# Entries for Smb4K users." ); + contents.append( "# Generated by Smb4K. Please do not modify!" ); + contents.append( "User_Alias\tSMB4KUSERS = "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) ); + contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" ); + contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() ); + contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() ); + contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_mount() ); + contents.append( "# End of Smb4K user entries." ); + + write = true; + } + else + { + // Find the beginning and the end of the entries in + // the sudoers file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 ) + { + (*it).append( ","+QString( getpwuid( getuid() )->pw_name ) ); + + write = true; + + break; + } + else + { + continue; + } + } + } + + break; + } + case Remove: + { + // Find the beginning and the end of the entries in + // the sudoers file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + // Now, check if the user is in the list of users. If he is, + // remove him from there or remove all if he is the only one: + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) ) + { + QString users = (*it).section( "=", 1, 1 ).stripWhiteSpace(); + + if ( users.contains( "," ) == 0 ) + { + // In this case, there is only one user in the list. Check if + // it is the user who requested the removal: + if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 ) + { + // They are equal. Remove everything: + contents.erase( begin, end ); + contents.remove( end ); + + write = true; + + break; + } + else + { + // They are not equal: Do nothing. + break; + } + } + else + { + // In this case there is more than one user in the list. + // Remove the user who requested the removal: + QStringList list = QStringList::split( ",", users, false ); + list.remove( getpwuid( getuid() )->pw_name ); + + (*it).replace( users, list.join( "," ) ); + + write = true; + + break; + } + } + else + { + continue; + } + } + + break; + } + default: + { + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + } + + if ( write ) + { + // Prepare the contents: remove empty lines from the end. + QStringList::Iterator it = contents.end(); + + // Move the iterator to the last entry in the list: + --it; + + while ( (*it).stripWhiteSpace().isEmpty() ) + { + it = contents.remove( it ); + --it; + } + + // Create a temporary file and write the data to it: + QCString template_string = tempDir().local8Bit()+"/XXXXXX"; + char tmp[template_string.length()+1]; + (void) qstrncpy( tmp, template_string, template_string.length()+1 ); + + QFile temp_file; + int file_descriptor; + + if ( (file_descriptor = mkstemp( tmp )) == -1 ) + { + int err = errno; + + Smb4KError::error( ERROR_CREATING_TEMP_FILE, tmp, strerror( err ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + if ( temp_file.open( IO_WriteOnly, file_descriptor ) ) + { + QTextStream ts( &temp_file ); + ts.setEncoding( QTextStream::Locale ); + + ts << contents.join( "\n" ) << endl; + + temp_file.close(); + } + else + { + Smb4KError::error( ERROR_WRITING_FILE, temp_file.name() ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + // Now move the file to the right location. Preserve the permissions + // and the owner: + QString canonical_path = findFile( "sudoers" ); + struct stat file_stat; + + if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + QString perms = QString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 ); + perms = perms.right( 4 ); + QString owner = QString( "%1" ).arg( (int)file_stat.st_uid ); + QString group = QString( "%1" ).arg( (int)file_stat.st_gid ); + QString temp_file_name = QString( tmp ); + + // Assemble the command. + QString command; + command.append( "kdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " ); + command.append( temp_file_name+" " ); + command.append( canonical_path+"\" ; " ); + command.append( "rm -f "+temp_file_name ); + + m_state = WriteSudoers; + + *m_proc << command; + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); + } + else + { + // Everything OK. + emit finished(); + + removeLockFile(); + } +} + + +void Smb4KFileIO::processSuperTab() +{ + // If the output buffer is empty, we stop, because + // that most likely means, the user cancelled the + // kdesu dialog. + if ( m_buffer.stripWhiteSpace().isEmpty() ) + { + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + QStringList contents = QStringList::split( "\n", m_buffer, true ); + bool write = false; + + switch ( m_operation ) + { + case Insert: + { + size_t hostnamelen = 255; + char *hn = new char[hostnamelen]; + + if ( gethostname( hn, hostnamelen ) == -1 ) + { + int error_number = errno; + Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + } + + QString hostname( hn ); + + delete [] hn; + + if ( contents.grep( "# Entries for Smb4K users." ).count() == 0 ) + { + contents.append( "# Entries for Smb4K users." ); + contents.append( "# Generated by Smb4K. Please do not modify!" ); + contents.append( ":define Smb4KUsers "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) ); +#ifndef __FreeBSD__ + contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+ + "\t$(Smb4KUsers)\tuid=root\tgid=root" ); + contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=root" ); + contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=root\tenv=PASSWD,USER" ); +#else + contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+ + "\t$(Smb4KUsers)\tuid=root\tgid=wheel" ); + contents.append( "smb4k_umount\t"+Smb4KSettings::smb4k_umount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=wheel" ); + contents.append( "smb4k_mount\t"+Smb4KSettings::smb4k_mount()+ + "\t$(Smb4KUsers)\tuid=root\tgid=wheel\tsetenv=HOME=$CALLER_HOME\tenv=PASSWD,USER" ); +#endif + contents.append( "# End of Smb4K user entries." ); + + write = true; + } + else + { + // Find the beginning and the end of the entries in + // the super.tab file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 ) + { + (*it).append( ","+QString( getpwuid( getuid() )->pw_name ) ); + + write = true; + + break; + } + else + { + continue; + } + } + } + + break; + } + case Remove: + { + // Find the beginning and the end of the entries in + // the super.tab file: + QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." ); + QStringList::Iterator end = contents.find( "# End of Smb4K user entries." ); + + // Now, check if the user is in the list of users. If he is, + // remove him from there or remove all if he is the only one: + for ( QStringList::Iterator it = begin; it != end; ++it ) + { + if ( (*it).startsWith( ":define Smb4KUsers" ) ) + { + QString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace(); + + if ( users.contains( "," ) == 0 ) + { + // In this case, there is only one user in the list. Check if + // it is the user who requested the removal: + if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 ) + { + // They are equal. Remove everything: + contents.erase( begin, end ); + contents.remove( end ); + + write = true; + + break; + } + else + { + // They are not equal: Do nothing. + break; + } + } + else + { + // In this case there is more than one user in the list. + // Remove the user who requested the removal: + QStringList list = QStringList::split( ",", users, false ); + list.remove( getpwuid( getuid() )->pw_name ); + + (*it).replace( users, list.join( "," ) ); + + write = true; + + break; + } + } + else + { + continue; + } + } + + break; + } + default: + { + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + } + + if ( write ) + { + // Prepare the contents: remove empty lines from the end. + QStringList::Iterator it = contents.end(); + + // Move the iterator to the last entry in the list: + --it; + + while ( (*it).stripWhiteSpace().isEmpty() ) + { + it = contents.remove( it ); + --it; + } + + // Create a temporary file and write the data to it: + QCString template_string = tempDir().local8Bit()+"/XXXXXX"; + char tmp[template_string.length()+1]; + (void) qstrncpy( tmp, template_string, template_string.length()+1 ); + + QFile temp_file; + int file_descriptor; + + if ( (file_descriptor = mkstemp( tmp )) == -1 ) + { + int err = errno; + + Smb4KError::error( ERROR_CREATING_TEMP_FILE, tmp, strerror( err ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + if ( temp_file.open( IO_WriteOnly, file_descriptor ) ) + { + QTextStream ts( &temp_file ); + ts.setEncoding( QTextStream::Locale ); + + ts << contents.join( "\n" ) << endl; + + temp_file.close(); + } + else + { + Smb4KError::error( ERROR_WRITING_FILE, temp_file.name() ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + // Now move the file to the right location. Preserve the permissions + // and the owner: + QString canonical_path = findFile( "super.tab" ); + struct stat file_stat; + + if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 ) + { + int error_number = errno; + + Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) ); + + emit failed(); + emit finished(); + + removeLockFile(); + + return; + } + + QString perms = QString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 ); + perms = perms.right( 4 ); + QString owner = QString( "%1" ).arg( (int)file_stat.st_uid ); + QString group = QString( "%1" ).arg( (int)file_stat.st_gid ); + QString temp_file_name = QString( tmp ); + + // Assemble the command. + QString command; + command.append( "kdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " ); + command.append( temp_file_name+" " ); + command.append( canonical_path+"\" ; " ); + command.append( "rm -f "+temp_file_name ); + + m_state = WriteSuperTab; + + *m_proc << command; + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); + } + else + { + // Everything OK. + emit finished(); + + removeLockFile(); + } +} + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KFileIO::slotShutdown() +{ + removeLockFile( false ); +} + + +void Smb4KFileIO::slotReceivedStderr( KProcess *, char *buf, int len ) +{ + QString error_output = QString::fromLocal8Bit( buf, len ); + + if ( error_output.contains( "smb4k_mv" ) != 0 ) + { + m_error_occurred = true; + + QString canonical_path = findFile( (m_state == WriteSudoers ? "sudoers" : "super.tab") ); + + Smb4KError::error( ERROR_WRITING_FILE, canonical_path, m_buffer ); + + emit failed(); + emit finished(); + + removeLockFile(); + } + else if ( error_output.contains( "smb4k_cat" ) != 0 ) + { + m_error_occurred = true; + + QString canonical_path = findFile( (m_state == ReadSudoers ? "sudoers" : "super.tab") ); + + Smb4KError::error( ERROR_READING_FILE, canonical_path, m_buffer ); + + emit failed(); + emit finished(); + + removeLockFile(); + } +} + + +void Smb4KFileIO::slotReceivedStdout( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KFileIO::slotProcessExited( KProcess * ) +{ + m_proc->clearArguments(); + + if ( !m_error_occurred ) + { + switch ( m_state ) + { + case ReadSudoers: + { + processSudoers(); + + break; + } + case WriteSudoers: + { + emit finished(); + + removeLockFile(); + + break; + } + case ReadSuperTab: + { + processSuperTab(); + + break; + } + default: + { + emit finished(); + + removeLockFile(); + + break; + } + } + } + else + { + // Smb4KFileIO::slotReceivedStderr() has already done the + // necessary things. + } + + m_buffer = QString::null; + m_state = Idle; + m_error_occurred = false; +} + +#include "smb4kfileio.moc" diff --git a/smb4k/core/smb4kfileio.h b/smb4k/core/smb4kfileio.h new file mode 100644 index 0000000..bbfbbe0 --- /dev/null +++ b/smb4k/core/smb4kfileio.h @@ -0,0 +1,246 @@ +/*************************************************************************** + smb4kfileio - Does file IO operations for Smb4K + ------------------- + begin : Do Jan 1 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KFILEIO_H +#define SMB4KFILEIO_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// KDE include +#include + + +/** + * This class belongs to the core classes of Smb4K. It handles IO + * operations that are performed on system configuration files. + * + * @author Alexander Reinholdt + */ + +class Smb4KFileIO : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent object of this class + * + * @param name The name of this class + */ + Smb4KFileIO( QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KFileIO(); + + /** + * Enumeration that determines for which super user program we perform + * the current action. + */ + enum Operation { Insert, Remove, NoOperation }; + + /** + * This function writes changes to the sudoers configuration file. + * + * @param operation Defines whether entries should be inserted or if + * they should be removed. With Smb4KFileIO::NoOperation + * the function exits immediately and returns TRUE. + * + * @returns TRUE if the write process was successfully initiate and FALSE + * otherwise. + * + * @note You need to connect to the finished() and failed() signals to find + * out if the the write process finished successfully. + * + */ + bool writeSudoers( Smb4KFileIO::Operation operation ); + + /** + * This function writes changes to the super.tab configuration file. + * + * @param operation Defines whether entries should be inserted or if + * they should be removed. With Smb4KFileIO::NoOperation + * the function exits immediately and returns TRUE. + * + * @returns TRUE if the write process was successfully initiate and FALSE + * otherwise. + * + * @note You need to connect to the finished() and failed() signals to find + * out if the the write process finished successfully. + * + */ + bool writeSuperTab( Smb4KFileIO::Operation operation ); + + signals: + /** + * This signal is emitted when somthing went wrong with the writing to + * the system configuration files. + */ + void failed(); + + /** + * This signal is emitted when the writing to the system configuration + * files has finished. It is emitted in case the writing was successful + * as well as in case it wasn't. + */ + void finished(); + + protected slots: + /** + * This slot is invokes when the application is closed. It is connected + * to KApplication::shutDown(). + */ + void slotShutdown(); + + /** + * This slot receives shell program output from Stderr. + * + * @param proc The KProcess object + * + * @param buf The buffer that holds the error output + * + * @param len The length of the buffer + */ + void slotReceivedStderr( KProcess *proc, char *buf, int len ); + + /** + * This slot receives shell program output from Stdout. + * + * @param proc The KProcess object + * + * @param buf The buffer that holds the output + * + * @param len The length of the buffer + */ + void slotReceivedStdout( KProcess *proc, char *buf, int len ); + + /** + * This slot is called, when the process exited. + * + * @param proc The KProcess object + */ + void slotProcessExited( KProcess *proc ); + + private: + /** + * This function creates a lock file in /tmp if it does not + * exist already. If the user is not allowed to write to the + * desired file a the moment, the user will be shown an error + * dialog and the function will return FALSE. + * + * Checks are performed to make sure it is save to write to an + * existing lock file using the system call lstat(). + * + * @param filename The name of the file that is to be modified. + * + * @returns TRUE if the creation was successful and FALSE if + * something went wrong. + */ + bool createLockFile( const QString &filename ); + + /** + * This function removes the lock file or at least the + * entry within it. + * + * Checks are performed to make sure it is save to write to an + * existing lock file using the system call lstat(). + * + * @param shutdown Should be set to FALSE if you do not want to have + * any error message shown. Otherwise you should set it + * to TRUE. + * + * @returns TRUE if the removal was successful and FALSE if + * something went wrong. + */ + bool removeLockFile( const bool error_message = true ); + + /** + * This function finds a file. + * + * @param filename The name of the file + * + * @returns the canonical path of the file or an empty string if it could not be + * found. + */ + const QCString findFile( const QString &filename ); + + /** + * Enumeration that is used to tell the process what has to be done. + */ + enum State { ReadSudoers, ReadSuperTab, WriteSudoers, WriteSuperTab, Idle }; + + /** + * This integer holds one of the entries of the enumeration above. + */ + State m_state; + + /** + * This buffer holds the output that was received at Stdout. + */ + QString m_buffer; + + /** + * Process the sudoers file. + */ + void processSudoers(); + + /** + * Process the sudoers file. + */ + void processSuperTab(); + + /** + * This is the absolute path of the lock file. + */ + QCString m_lock_file; + + /** + * Which operation should be performed + */ + Operation m_operation; + + /** + * The KProcess object + */ + KProcess *m_proc; + + /** + * Tell if an error occurred. + */ + bool m_error_occurred; +}; + + +#endif diff --git a/smb4k/core/smb4kglobal.cpp b/smb4k/core/smb4kglobal.cpp new file mode 100644 index 0000000..c1fe706 --- /dev/null +++ b/smb4k/core/smb4kglobal.cpp @@ -0,0 +1,78 @@ +/*************************************************************************** + smb4kglobal - This is the global namespace for Smb4K. + ------------------- + begin : Sa Apr 2 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include +#include + +// application specific includes +#include "smb4kglobal.h" +#include "smb4kglobal_p.h" +#include "smb4kdefs.h" + + +static Smb4KGlobalPrivate p; + + +QTimer *Smb4KGlobal::timer() +{ + return p.timer(); +} + + +const int Smb4KGlobal::timerInterval() +{ + return TIMER_INTERVAL; +} + + +const QString Smb4KGlobal::specifyUser( const QString &host, QWidget *parent, const char *name ) +{ + return p.homesHandler()->specifyUser( host, parent, name ); +} + + +Smb4KPasswordHandler *Smb4KGlobal::passwordHandler() +{ + return p.passwordHandler(); +} + + +Smb4KSambaOptionsHandler *Smb4KGlobal::optionsHandler() +{ + return p.optionsHandler(); +} + + +const QString &Smb4KGlobal::tempDir() +{ + return p.tempDir(); +} + + +const QStringList Smb4KGlobal::homesUsers( const QString &host ) +{ + return p.homesUsers( host ); +} diff --git a/smb4k/core/smb4kglobal.h b/smb4k/core/smb4kglobal.h new file mode 100644 index 0000000..815938f --- /dev/null +++ b/smb4k/core/smb4kglobal.h @@ -0,0 +1,115 @@ +/*************************************************************************** + smb4kglobal - This is the global namespace for Smb4K. + ------------------- + begin : Sa Apr 2 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KGLOBAL_H +#define SMB4KGLOBAL_H + +#include +#include + +#include + +// forward declarations: +class Smb4KPasswordHandler; +class Smb4KSambaOptionsHandler; +class Smb4KHomesSharesHandler; + +/** + * This is the global namespace for the core classes of Smb4K. + * + * @author Alexander Reinholdt + */ + +namespace Smb4KGlobal +{ + /** + * This returns the pointer to the global timer for the application. + * WARNING: Du *NOT* stop this timer anywhere in the program or all + * actions that need a timer are stopped all over the application! + * + * @returns A pointer to the global timer. + */ + QTimer *timer() KDE_DEPRECATED; + + /** + * This function returns the interval of the timer. + * + * @returns The interval of the timer in msec. + */ + const int timerInterval(); + + /** + * This function will open a dialog where the user has to define a + * user name to access a 'homes' share. Besides returning this name, + * this function will also store the name in the configuration file. + * + * @param host The host where the homes share is located + * + * @param parent The parent widget + * + * @param name The name of this dialog + * + * @returns A user name + */ + const QString specifyUser( const QString &host, QWidget *parent = 0, const char *name = 0 ); + + /** + * This function returns the password handler. + * + * @returns a pointer to the global password handler object. + */ + Smb4KPasswordHandler *passwordHandler(); + + /** + * This function returns a pointer to the global Smb4KOptionsHandler object. + * You need to use it if you want to retrieve (a) the custom options defined for + * a share, (b) the argument strings for the 'net', 'smbclient', or 'nmblookup' + * command, or (c) the options in the global section of the smb.conf configuration + * file. + * + * @returns a pointer to the global options handler object. + */ + Smb4KSambaOptionsHandler *optionsHandler(); + + /** + * This function creates a temporary directory and returns its name. If it already + * exists, only the name will be returned. If an failure occurrs, an error message + * will be shown and an empty string is returned. + * + * @returns the name of the temporary directory. + */ + const QString &tempDir(); + + /** + * Get the user names that are defined for a homes share. + * + * @param host The name of the host where the 'homes' share is located. + * + * @returns the list of user names for this homes share. + */ + const QStringList homesUsers( const QString &host ); +}; + +#endif diff --git a/smb4k/core/smb4kglobal_p.cpp b/smb4k/core/smb4kglobal_p.cpp new file mode 100644 index 0000000..f5da58f --- /dev/null +++ b/smb4k/core/smb4kglobal_p.cpp @@ -0,0 +1,123 @@ +/*************************************************************************** + smb4kglobal_p - This is the private helper class of the Smb4KGlobal + namespace. + ------------------- + begin : Di Jul 24 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// system includes +#include +#include + +// application specific includes +#include "smb4kglobal_p.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" + + +Smb4KGlobalPrivate::Smb4KGlobalPrivate() +{ + m_timer = new QTimer(); + m_timer->start( TIMER_INTERVAL, false ); + + // Do NOT initialize these classes here; you'll + // get crashes. + m_passwd_handler = NULL; + m_options_handler = NULL; + m_homes_handler = NULL; + + m_temp_dir = QString::null; +} + + +Smb4KGlobalPrivate::~Smb4KGlobalPrivate() +{ + rmdir( m_temp_dir.local8Bit() ); + + delete m_timer; + delete m_passwd_handler; + delete m_options_handler; + delete m_homes_handler; +} + + +QTimer *Smb4KGlobalPrivate::timer() +{ + return m_timer; +} + + +Smb4KHomesSharesHandler *Smb4KGlobalPrivate::homesHandler() +{ + return m_homes_handler ? m_homes_handler : + (m_homes_handler = new Smb4KHomesSharesHandler()); +} + + +Smb4KPasswordHandler *Smb4KGlobalPrivate::passwordHandler() +{ +#ifndef __FreeBSD__ + return m_passwd_handler ? m_passwd_handler : + (m_passwd_handler = new Smb4KPasswordHandler( homesHandler() )); +#else + return m_passwd_handler ? m_passwd_handler : + (m_passwd_handler = new Smb4KPasswordHandler( homesHandler(), optionsHandler() )); +#endif +} + + +Smb4KSambaOptionsHandler *Smb4KGlobalPrivate::optionsHandler() +{ + return m_options_handler ? m_options_handler : + (m_options_handler = new Smb4KSambaOptionsHandler()); +} + + +const QString &Smb4KGlobalPrivate::tempDir() +{ + if ( m_temp_dir.isEmpty() ) + { + char tmpd_name[] = "/tmp/smb4k.XXXXXX"; + + if ( mkdtemp( tmpd_name ) == NULL ) + { + Smb4KError::error( ERROR_CREATING_TEMP_DIR, tmpd_name, strerror( errno ) ); + + return QString::null; + } + + m_temp_dir = QString( tmpd_name ); + } + + return m_temp_dir; +} + + +const QStringList Smb4KGlobalPrivate::homesUsers( const QString &host ) +{ + if ( !m_homes_handler ) + { + m_homes_handler = new Smb4KHomesSharesHandler(); + } + + return m_homes_handler->homesUsers( host ); +} diff --git a/smb4k/core/smb4kglobal_p.h b/smb4k/core/smb4kglobal_p.h new file mode 100644 index 0000000..e1bad0a --- /dev/null +++ b/smb4k/core/smb4kglobal_p.h @@ -0,0 +1,102 @@ +/*************************************************************************** + smb4kglobal_p - This is the private helper class of the Smb4KGlobal + namespace. + ------------------- + begin : Di Jul 24 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KGLOBAL_P_H +#define SMB4KGLOBAL_P_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include + +// application specific includes +#include "smb4kpasswordhandler.h" +#include "smb4ksambaoptionshandler.h" +#include "smb4khomesshareshandler.h" + +/** + * This class is a private helper for the Smb4KGlobal namespace. + * + * @author Alexander Reinholdt + */ + +class Smb4KGlobalPrivate +{ + public: + /** + * Constructor + */ + Smb4KGlobalPrivate(); + + /** + * Destructor + */ + ~Smb4KGlobalPrivate(); + + /** + * Returns a pointer to the global timer + */ + QTimer *timer(); + + /** + * Returns the handler for homes shares + */ + Smb4KHomesSharesHandler *homesHandler(); + + /** + * Returns a pointer to the global password handler object + */ + Smb4KPasswordHandler *passwordHandler(); + + /** + * Returns a pointer to the global Samba options handler + */ + Smb4KSambaOptionsHandler *optionsHandler(); + + /** + * Returns the name of the temporary directory. + */ + const QString &tempDir(); + + /** + * Return the user names defined for a certain homes share + */ + const QStringList homesUsers( const QString &host ); + + private: + QTimer *m_timer; + Smb4KPasswordHandler *m_passwd_handler; + Smb4KSambaOptionsHandler *m_options_handler; + Smb4KHomesSharesHandler *m_homes_handler; + QString m_temp_dir; +}; + +#endif diff --git a/smb4k/core/smb4khomesshareshandler.cpp b/smb4k/core/smb4khomesshareshandler.cpp new file mode 100644 index 0000000..a81a6e7 --- /dev/null +++ b/smb4k/core/smb4khomesshareshandler.cpp @@ -0,0 +1,361 @@ +/*************************************************************************** + smb4khomesshareshandler - This class handles the homes shares. + ------------------- + begin : Do Aug 10 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4khomesshareshandler.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" + + +Smb4KHomesSharesHandler::Smb4KHomesSharesHandler( QObject *parent, const char *name ) +: QObject( parent, name ) +{ + // First we need the directory. + KStandardDirs *stddir = new KStandardDirs(); + QString dir = locateLocal( "data", "smb4k", KGlobal::instance() ); + + if ( !stddir->exists( dir ) ) + { + stddir->makeDir( dir ); + } + + delete stddir; + + m_dlg = NULL; +} + + +Smb4KHomesSharesHandler::~Smb4KHomesSharesHandler() +{ + delete m_dlg; +} + + +const QString Smb4KHomesSharesHandler::specifyUser( const QString &host, QWidget *parent, const char *name ) +{ + QString username = QString::null; + + m_dlg = new KDialogBase( KDialogBase::Plain, i18n( "Specify User" ), KDialogBase::User1|KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, parent, name, true, true ); + m_dlg->setButtonGuiItem( KDialogBase::User1, KGuiItem( i18n( "Clear List" ), "editdelete", 0, 0 ) ); + m_dlg->enableButton( KDialogBase::Ok, false ); + m_dlg->enableButton( KDialogBase::User1, false ); + + // Set up the ask pass dialog. + QFrame *frame = m_dlg->plainPage(); + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 5 ); + + QLabel *pic = new QLabel( frame ); + pic->setPixmap( DesktopIcon( "personal" ) ); + pic->setMargin( 10 ); + + QLabel *text = new QLabel( i18n( "Please specify a user name." ), frame ); + + QLabel *userLabel = new QLabel( i18n( "User:" ), frame ); + KComboBox *userCombo = new KComboBox( true, frame, "UserComboBox" ); + userCombo->setDuplicatesEnabled( false ); + + QSpacerItem *spacer1 = new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Preferred ); + + layout->addWidget( pic, 0, 0, 0 ); + layout->addMultiCellWidget( text, 0, 0, 1, 3, 0 ); + layout->addWidget( userLabel, 1, 0, 0 ); + layout->addMultiCellWidget( userCombo, 1, 1, 1, 4, 0 ); + layout->addItem( spacer1, 0, 2 ); + + connect( userCombo, SIGNAL( textChanged( const QString &) ), + this, SLOT( slotTextChanged( const QString & ) ) ); + connect( m_dlg, SIGNAL( user1Clicked() ), + this, SLOT( slotClearClicked() ) ); + + // Read the list of logins, that are already defined + // for this 'homes' share. + QStringList list = read_names( host ); + + if ( !list.isEmpty() ) + { + userCombo->insertStringList( list, -1 ); + m_dlg->enableButton( KDialogBase::User1, true ); + } + + userCombo->setCurrentText( QString::null ); + + // Do the last things before showing. + userCombo->setFocus(); + m_dlg->setFixedSize( m_dlg->sizeHint() ); + + if ( m_dlg->exec() == KDialogBase::Accepted ) + { + // First make sure, the list is cleared: + list.clear(); + + // Write the new list of logins to the config file. + if ( !userCombo->lineEdit()->text().isEmpty() ) + { + list.append( userCombo->lineEdit()->text() ); + } + + int index = 0; + + while ( index < userCombo->count() ) + { + if ( list.find( userCombo->text( index ) ) == list.end() ) + { + list.append( userCombo->text( index ) ); + } + + index++; + } + + list.sort(); + + write_names( host, list ); + + username = userCombo->currentText(); + } + + delete m_dlg; + m_dlg = NULL; + + return username; +} + + +const QStringList &Smb4KHomesSharesHandler::read_names( const QString &host ) +{ + // Clear the old contents of this list: + m_names.clear(); + + QFile file( locateLocal( "data", "smb4k/homes_shares", KGlobal::instance() ) ); + + if ( file.open( IO_ReadOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + QString line; + bool get_names = false; + + while ( !ts.atEnd() ) + { + line = ts.readLine(); + + if ( !get_names ) + { + if ( QString::compare( line.stripWhiteSpace(), "["+host.upper()+"]" ) == 0 ) + { + // Found the host: + get_names = true; + + continue; + } + else + { + // No match yet... + continue; + } + } + else + { + if ( !line.stripWhiteSpace().isEmpty() ) + { + // Write the names to the list: + m_names = QStringList::split( ",", line, false ); + + // This is not needed, but let's do it anyway: + get_names = false; + + break; + } + } + } + + file.close(); + } + else + { + if ( file.exists() ) + { + Smb4KError::error( ERROR_READING_FILE, file.name() ); + + // The list is empty: + return m_names; + } + } + + return m_names; +} + + +void Smb4KHomesSharesHandler::write_names( const QString &host, const QStringList &names ) +{ + // First get the whole contents of the file, so that + // we can easily modify it: + QStringList contents; + + QFile file( locateLocal( "data", "smb4k/homes_shares", KGlobal::instance() ) ); + + if ( file.open( IO_ReadOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( '\n', ts.read(), true ); + + file.close(); + } + else + { + if ( file.exists() ) + { + Smb4KError::error( ERROR_READING_FILE, file.name() ); + + return; + } + } + + // Now search for the host: + QStringList::Iterator it; + + for ( it = contents.begin(); it != contents.end(); ++it ) + { + if ( QString::compare( (*it).stripWhiteSpace().upper(), "["+host.upper()+"]" ) == 0 ) + { + if ( !names.isEmpty() ) + { + // Move to the line with the names: + it++; + // Change the line: + *it = names.join( "," ); + } + else + { + // Remove the host entry: + it = contents.remove( it ); + // Remove the user names: + it = contents.remove( it ); + + // Remove the blank line following the entry: + if ( it != contents.end() && (*it).stripWhiteSpace().isEmpty() ) + { + contents.remove( it ); + } + } + + break; + } + else + { + continue; + } + } + + // If we haven't found the host, append it to the end: + if ( it == contents.end() ) + { + if ( !contents.isEmpty() ) + { + contents.append( "" ); + } + + contents.append( "["+host.upper()+"]"); + contents.append( names.join( "," ) ); + } + + + // Now write or remove the file: + if ( !contents.isEmpty() ) + { + if ( file.open( IO_WriteOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + ts << contents.join( "\n" ); + + file.close(); + } + else + { + Smb4KError::error( ERROR_WRITING_FILE, file.name() ); + + return; + } + } + else + { + file.remove(); + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KHomesSharesHandler::slotTextChanged( const QString &text ) +{ + if ( !text.isEmpty() ) + { + m_dlg->enableButtonOK( true ); + } + else + { + m_dlg->enableButtonOK( false ); + } +} + + +void Smb4KHomesSharesHandler::slotClearClicked() +{ + if ( m_dlg ) + { + KComboBox *cb = (KComboBox *)m_dlg->child( "UserComboBox", "KComboBox", true ); + + if ( cb ) + { + cb->clearEdit(); + cb->clear(); + + m_dlg->enableButton( KDialogBase::User1, false ); + } + } +} + +#include "smb4khomesshareshandler.moc" + diff --git a/smb4k/core/smb4khomesshareshandler.h b/smb4k/core/smb4khomesshareshandler.h new file mode 100644 index 0000000..cf501e2 --- /dev/null +++ b/smb4k/core/smb4khomesshareshandler.h @@ -0,0 +1,139 @@ +/*************************************************************************** + smb4khomesshareshandler - This class handles the homes shares. + ------------------- + begin : Do Aug 10 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KHOMESSHARESHANDLER_H +#define SMB4KHOMESSHARESHANDLER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include +#include + + +/** + * This class belongs to the core of Smb4K and takes care of the + * user names that are/were defined for a certain 'homes' share. + * + * @author Alexander Reinholdt + */ + +class Smb4KHomesSharesHandler : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent object of this class + * + * @param name The name of this class + */ + Smb4KHomesSharesHandler( QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KHomesSharesHandler(); + + /** + * This function will open a dialog where the user has to define a + * user name to access a 'homes' share. Besides returning this name, + * this function will also store the name in the configuration file. + * + * @param host The host where the homes share is located + * + * @param parent The parent widget + * + * @param name The name of this dialog + * + * @returns A user name + */ + const QString specifyUser( const QString &host, QWidget *parent = 0, const char *name = 0 ); + + /** + * Read and return the user names that are defined for a homes share. + * + * @param host The name of the host where the 'homes' share is located. + * + * @returns the list of user names for this homes share. + */ + const QStringList &homesUsers( const QString &host ) { return read_names( host ); } + + protected slots: + /** + * Is connected to the textChanged() signal of the combo box + * in the "Specify User" dialog. + * + * @param text The text in the combo box + */ + void slotTextChanged( const QString &text ); + + /** + * This slot is called if the User1 button, i.e. the "Clear" button + * in the "Specify User" dialog has been clicked. It removes all + * entries from the combo box. + */ + void slotClearClicked(); + + private: + /** + * Read the user names for a homes share. + * + * @param host The host where the homes share is located. + */ + const QStringList &read_names( const QString &host ); + + /** + * Write the user names for a certain homes share to the config + * file. + * + * @param host The host where the homes share is located + * + * @param names The list of user names that are defined for + * the homes share and should be written to the + * config file. + */ + void write_names( const QString &host, const QStringList &names ); + + /** + * This is the dialog that's shown the user when he/she has to + * provide a user name. + */ + KDialogBase *m_dlg; + + /** + * This is a buffer for the list of names defined for a 'homes' share. + */ + QStringList m_names; +}; + +#endif diff --git a/smb4k/core/smb4kmounter.cpp b/smb4k/core/smb4kmounter.cpp new file mode 100644 index 0000000..45ccc9c --- /dev/null +++ b/smb4k/core/smb4kmounter.cpp @@ -0,0 +1,1718 @@ +/*************************************************************************** + smb4kmounter.cpp - The core class that mounts the shares. + ------------------- + begin : Die Jun 10 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include + +// system includes +#if !defined(__FreeBSD__) && !defined(__solaris__) && !defined(USE_SOLARIS) +#include +#elif defined(__solaris__) || defined(USE_SOLARIS) +#include +#elif defined(__FreeBSD__) +#include +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +#include +#include +#include +#include +#endif + +// Application specific includes +#include "smb4kmounter.h" +#include "smb4kmounter_p.h" +#include "smb4kauthinfo.h" +#include "smb4ksambaoptionsinfo.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4ksambaoptionshandler.h" +#include "smb4kpasswordhandler.h" +#include "smb4kshare.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + + +Smb4KMounter::Smb4KMounter( QObject *parent, const char *name ) : QObject( parent, name ) +{ + m_priv = new Smb4KMounterPrivate; + + m_proc = new KProcess( this, "MounterProcess" ); + m_proc->setUseShell( true ); + + m_working = false; + + m_queue.setAutoDelete( true ); + + connect( m_proc, SIGNAL( processExited( KProcess * ) ), + this, SLOT( slotProcessExited( KProcess * ) ) ); + + connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); + + connect( kapp, SIGNAL( shutDown() ), + this, SLOT( slotShutdown() ) ); +} + + +Smb4KMounter::~Smb4KMounter() +{ + abort(); + + for ( QValueList::Iterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + delete *it; + } + + m_mounted_shares.clear(); + + delete m_priv; +} + + +void Smb4KMounter::init() +{ + m_queue.enqueue( new QString( QString( "%1:" ).arg( Import ) ) ); + m_queue.enqueue( new QString( QString( "%1:" ).arg( Remount ) ) ); + + startTimer( TIMER_INTERVAL ); +} + + +/*************************************************************************** + Aborts any action of the mounter. +***************************************************************************/ + + +void Smb4KMounter::abort() +{ + m_queue.clear(); + + if ( m_proc->isRunning() ) + { + if ( Smb4KSettings::alwaysUseSuperUser() ) + { + QString suid_program; + + switch( Smb4KSettings::superUserProgram() ) + { + case Smb4KSettings::EnumSuperUserProgram::Sudo: + { + suid_program = Smb4KSettings::sudo(); + + break; + } + case Smb4KSettings::EnumSuperUserProgram::Super: + { + suid_program = Smb4KSettings::super(); + + break; + } + default: + { + // FIXME: Throw an error? + return; + } + } + + KProcess proc; + proc.setUseShell( true ); + proc << QString( "%1 smb4k_kill %2" ).arg( suid_program ).arg( m_proc->pid() ); + proc.start( KProcess::DontCare, KProcess::NoCommunication ); + } + else + { + m_proc->kill(); + } + } +} + + +/*************************************************************************** + Mounts recently used shares. +***************************************************************************/ + + +void Smb4KMounter::remount() +{ + if ( Smb4KSettings::remountShares() ) + { + const QValueList *list = &(optionsHandler()->customOptionsList()); + + for ( QValueList::ConstIterator it = list->begin(); + it != list->end(); ++it ) + { + if ( (*it)->remount() ) + { + QValueList list = findShareByName( (*it)->itemName() ); + + bool mount = true; + + if ( !list.isEmpty() ) + { + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it).isForeign() ) + { + mount = false; + + break; + } + else + { + continue; + } + } + } + + if ( mount ) + { +#ifndef __FreeBSD__ + mountShare( QString::null, (*it)->itemName().section( "/", 2, 2 ), QString::null, (*it)->itemName().section( "/", 3, 3 ) ); +#else + mountShare( QString::null, (*it)->itemName().section( "/", 2, 2 ).section( "@", 1, 1 ), QString::null, (*it)->itemName().section( "/", 3, 3 ) ); +#endif + } + + // If the share is to be remounted the next time, + // slotShutdown() will tell the options handler. + (*it)->setRemount( false ); + + continue; + } + else + { + continue; + } + } + + m_working = false; + emit state( MOUNTER_STOP ); + } + else + { + m_working = false; + emit state( MOUNTER_STOP ); + } +} + + +/*************************************************************************** + Imports all shares, that are mounted externally. +***************************************************************************/ + +void Smb4KMounter::import() +{ + QValueList shares; + +#ifndef __FreeBSD__ + + if ( m_proc_mounts.name().isEmpty() ) + { + m_proc_mounts.setName( "/proc/mounts" ); + } + + if ( !QFile::exists( m_proc_mounts.name() ) ) + { + if ( !m_proc_error ) + { + m_proc_error = true; + Smb4KError::error( ERROR_FILE_NOT_FOUND, m_proc_mounts.name() ); + } + else + { + // No need to do anything here + } + } + else + { + QStringList contents, list; + + // Read /proc/mounts: + + if ( m_proc_mounts.open( IO_ReadOnly ) ) + { + QTextStream ts( &m_proc_mounts ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( "\n", ts.read(), false ); + + m_proc_mounts.close(); + } + else + { + Smb4KError::error( ERROR_OPENING_FILE, m_proc_mounts.name() ); + + return; + } + + // Process the SMBFS and CIFS entries: + + list += contents.grep( " smbfs ", true ); + list += contents.grep( " cifs ", true ); + + if ( !list.isEmpty() ) + { + for ( QStringList::Iterator it = list.begin(); it != list.end(); it++ ) + { + Smb4KShare *new_share = NULL; + + if ( (*it).contains( " smbfs ", false ) != 0 ) + { + QString share_and_path = (*it).section( " smbfs ", 0, 0 ).stripWhiteSpace(); + QString name = share_and_path.section( " ", 0, 0 ).stripWhiteSpace().replace( "\\040", "\040" ); + QString path = share_and_path.section( " ", 1, 1 ).stripWhiteSpace(); + + if ( path.contains( "\\040" ) != 0 || path.contains( "\040" ) != 0 ) + { + name.replace( "_", "\040" ); + path.replace( "\\040", "\040" ); + } + + int uid = (*it).section( "uid=", 1, 1 ).section( ",", 0, 0 ).stripWhiteSpace().toInt(); + int gid = (*it).section( "gid=", 1, 1 ).section( ",", 0, 0 ).stripWhiteSpace().toInt(); + + new_share = new Smb4KShare( name, path, "smbfs", uid, gid ); + } + else if ( (*it).contains( " cifs ", false ) != 0 ) + { + QString share_and_path = (*it).section( " cifs ", 0, 0 ).stripWhiteSpace(); + QString name = share_and_path.section( " ", 0, 0 ).stripWhiteSpace().replace( "\\040", "\040" ); + QString path = share_and_path.section( " ", 1, 1 ).stripWhiteSpace(); + + if ( path.contains( "\\040" ) != 0 || path.contains( "\040" ) != 0 ) + { + name.replace( "_", "\040" ); + path.replace( "\\040", "\040" ); + } + + QString login = (*it).section( "username=", 1, 1 ).section( ",", 0, 0 ).stripWhiteSpace(); + + new_share = new Smb4KShare( name, path, "cifs", login ); + } + else + { + continue; + } + + if ( new_share ) + { + // If the a representative of the new share is already in the list of + // mounted shares, replace the new with the old one. + + Smb4KShare *existing_share = findShareByPath( new_share->path() ); + + if ( existing_share ) + { + delete new_share; + new_share = new Smb4KShare( *existing_share ); + } + + // Check if the share is broken and/or foreign. + + if ( (existing_share && !existing_share->isBroken()) || !existing_share ) + { + checkAccessibility( new_share ); + } + else + { + // Since new_share is a copy of existing_share, we do not need to do + // anything here. + } + + if ( !existing_share && QString::compare( new_share->filesystem(), "cifs" ) == 0 ) + { + bool foreign = true; + + if ( (!new_share->isBroken() && + (qstrncmp( new_share->canonicalPath(), + QDir( Smb4KSettings::mountPrefix() ).canonicalPath(), + QDir( Smb4KSettings::mountPrefix() ).canonicalPath().length() ) == 0 || + qstrncmp( new_share->canonicalPath(), + QDir::home().canonicalPath(), + QDir::home().canonicalPath().length() ) == 0)) || + (new_share->isBroken() && + (qstrncmp( new_share->path(), + QDir::homeDirPath(), + QDir::homeDirPath().length() ) == 0 || + qstrncmp( new_share->path(), + Smb4KSettings::mountPrefix(), + Smb4KSettings::mountPrefix().length() ) == 0)) ) + { + foreign = false; + } + + new_share->setForeign( foreign ); + } + + shares.append( new_share ); + } + } + } + } + +#else + + struct statfs *buf; + int count = getmntinfo( &buf, 0 ); + + if ( count == 0 ) + { + int err_code = errno; + + Smb4KError::error( ERROR_IMPORTING_SHARES, QString::null, strerror( err_code ) ); + + m_working = false; + return; + } + + for ( int i = 0; i < count; ++i ) + { + if ( !strcmp( buf[i].f_fstypename, "smbfs" ) ) + { + QString share_name( buf[i].f_mntfromname ); + QString path( buf[i].f_mntonname ); + QString fs( buf[i].f_fstypename ); + + QFileInfo info( QString( buf[i].f_mntonname )+"/." ); + + int uid = (int)info.ownerId(); + int gid = (int)info.groupId(); + + Smb4KShare *existing_share = findShareByPath( path ); + Smb4KShare *new_share = NULL; + + if ( existing_share ) + { + new_share = new Smb4KShare( *existing_share ); + } + else + { + new_share = new Smb4KShare( share_name, path, fs, uid, gid ); + } + + // Test if share is broken + if ( (existing_share && !existing_share->isBroken()) || !existing_share ) + { + checkAccessibility( new_share ); + } + else + { + // Since new_share is a copy of existing_share, we do not need to do + // anything here. + } + + shares.append( new_share ); + } + } + + // Apparently, under FreeBSD we do not need to delete + // the pointer (see manual page). + +#endif + + // Delete all entries of m_mounted_shares. + for ( QValueList::Iterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + delete *it; + } + + m_mounted_shares.clear(); + + m_mounted_shares = shares; + + emit updated(); + + m_working = false; +} + + +/*************************************************************************** + Mounts a share. (Public part) +***************************************************************************/ + +void Smb4KMounter::mountShare( const QString &workgroup, const QString &host, const QString &ip, const QString &share ) +{ + QString share_name = QString::null; + + if ( QString::compare( share, "homes" ) == 0 ) + { + share_name = specifyUser( host, kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" ); + } + else + { + share_name = share; + } + + if ( !share_name.stripWhiteSpace().isEmpty() ) + { + // Before doing anything else let's check that the + // share has not been mounted by the user already: + QValueList list = findShareByName( QString( "//%1/%2" ).arg( host, share_name ) ); + + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it).isForeign() ) + { + emit mountedShare( (*it).canonicalPath() ); + + return; + } + } + + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4:%5" ).arg( Mount ) + .arg( workgroup, host ) + .arg( ip, share_name ) ) ); + } +} + + + +/*************************************************************************** + Mounts a share. (Private part) +***************************************************************************/ + +void Smb4KMounter::mount( const QString &workgroup, const QString &host, const QString &ip, const QString &share ) +{ + m_priv->setWorkgroup( workgroup ); + m_priv->setHost( host ); + m_priv->setShare( share ); + m_priv->setIP( ip ); + + // Create the mount point: + QDir *dir = new QDir( Smb4KSettings::mountPrefix() ); + + if ( !dir->exists() ) + { + if ( !dir->mkdir( dir->canonicalPath() ) ) + { + Smb4KError::error( ERROR_MKDIR_FAILED, dir->path() ); + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + + dir->setPath( dir->path() + "/" + + (Smb4KSettings::forceLowerCaseSubdirs() ? + m_priv->host().lower() : + m_priv->host()) ); + + if ( !dir->exists() ) + { + if ( !dir->mkdir( dir->canonicalPath() ) ) + { + Smb4KError::error( ERROR_MKDIR_FAILED, dir->path() ); + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + + dir->setPath( dir->path() + "/" + + (Smb4KSettings::forceLowerCaseSubdirs() ? + m_priv->share().lower() : + m_priv->share()) ); + + if ( !dir->exists() ) + { + if ( !dir->mkdir( dir->canonicalPath() ) ) + { + Smb4KError::error( ERROR_MKDIR_FAILED, dir->path() ); + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + + m_priv->setPath( QDir::cleanDirPath( dir->path() ) ); + + delete dir; + + // Now we are prepared to mount the share: + QString command, suid_program; + + switch ( Smb4KSettings::superUserProgram() ) + { + case Smb4KSettings::EnumSuperUserProgram::Sudo: + { + suid_program = "sudo"; + + break; + } + case Smb4KSettings::EnumSuperUserProgram::Super: + { + suid_program = "super"; + + break; + } + default: + { + return; + } + } + + Smb4KAuthInfo authInfo( m_priv->workgroup(), m_priv->host(), m_priv->share() ); + (void) passwordHandler()->readAuth( &authInfo ); + +#ifndef __FreeBSD__ + + // Let's see if the options handler knows the share: + Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( QString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ), true ); + + // Determine the file system we have to use: + int filesystem; + + if ( info ) + { + filesystem = QString::compare( info->filesystem().lower(), "cifs" ) == 0 ? + Smb4KSettings::EnumFilesystem::CIFS : + Smb4KSettings::EnumFilesystem::SMBFS; + } + else + { + filesystem = Smb4KSettings::filesystem(); + } + + // Compile the mount command: + switch ( filesystem ) + { + case Smb4KSettings::EnumFilesystem::CIFS: + { + command.append( Smb4KSettings::alwaysUseSuperUser() ? // FIXME: Check if suid program is installed + QString( "%1 smb4k_mount -s -t cifs " ).arg( suid_program ) : + "smb4k_mount -n -t cifs " ); + + command.append( "-o " ); + + command.append( optionsHandler()->mountOptions( QString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ) ) ); + + command.append( !m_priv->workgroup().stripWhiteSpace().isEmpty() ? + QString( "domain='%1'," ).arg( m_priv->workgroup() ) : + "" ); + + command.append( !m_priv->ip().stripWhiteSpace().isEmpty() ? + QString( "ip=%1," ).arg( m_priv->ip() ) : + "" ); + + command.append( !authInfo.user().isEmpty() ? + QString( "user=%1" ).arg( authInfo.user() ) : + "guest" ); + + command.append( " -- " ); + + command.append( QString( "//'%1'/'%2' '%3'" ).arg( m_priv->host(), m_priv->share(), m_priv->path() ) ); + + m_priv->setCIFSLogin( !authInfo.user().isEmpty() ? + authInfo.user() : + "guest" ); + + m_priv->setFileSystem( "cifs" ); + + break; + } + case Smb4KSettings::EnumFilesystem::SMBFS: + { + command.append( Smb4KSettings::alwaysUseSuperUser() ? // FIXME: Check if suid program is installed + QString( "%1 smb4k_mount -s -t smbfs " ).arg( suid_program ) : + "smb4k_mount -n -t smbfs " ); + + command.append( "-o " ); + + command.append( optionsHandler()->mountOptions( QString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ) ) ); + + command.append( !m_priv->workgroup().stripWhiteSpace().isEmpty() ? + QString( "workgroup='%1'," ).arg( m_priv->workgroup() ) : + "" ); + + command.append( !m_priv->ip().stripWhiteSpace().isEmpty() ? + QString( "ip=%1," ).arg( m_priv->ip() ) : + "" ); + + command.append( !authInfo.user().isEmpty() ? + QString( "username=%1" ).arg( authInfo.user() ) : + "guest" ); + + command.append( " -- " ); + + command.append( QString( "//'%1'/'%2' '%3'" ).arg( m_priv->host(), m_priv->share(), m_priv->path() ) ); + + m_priv->setFileSystem( "smbfs" ); + + break; + } + default: + { + return; + } + } + + m_proc->setEnvironment( "PASSWD", !authInfo.password().isEmpty() ? authInfo.password() : "" ); + +#else + + Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( "//"+m_priv->host()+"/"+m_priv->share() ); + + int port = info && info->port() != -1 ? + info->port() : + Smb4KSettings::remotePort(); + + command.append( Smb4KSettings::alwaysUseSuperUser() ? // FIXME: Check if suid program is installed + QString( "%1 smb4k_mount " ).arg( suid_program ) : + "smb4k_mount " ); + + command.append( optionsHandler()->mountOptions( QString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ) ) ); + + command.append( !m_priv->workgroup().stripWhiteSpace().isEmpty() ? + QString( " -W '%1'" ).arg( m_priv->workgroup() ) : + "" ); + + command.append( !m_priv->ip().stripWhiteSpace().isEmpty() ? + QString( " -I %1" ).arg( m_priv->ip() ) : + "" ); + + command.append( " -N" ); + + command.append( " -- " ); + + command.append( QString( "//%1@'%2':%3/'%4' '%5'" ).arg( !authInfo.user().isEmpty() ? authInfo.user() : "guest" ) + .arg( m_priv->host() ) + .arg( port ) + .arg( m_priv->share(), m_priv->path() ) ); + +#endif + + // Start the mount process: + *m_proc << command; + + startProcess( Mount ); +} + + +/**************************************************************************** + Unmount a share. (Public part) +****************************************************************************/ + +void Smb4KMounter::unmountShare( Smb4KShare *share, bool force, bool noMessage ) +{ + // Do *not* change share->canonicalPath(). It is necessary for the + // checks below to work. + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4" ).arg( Unmount ) + .arg( share->canonicalPath() ) + .arg( force, noMessage ) ) ); +} + + +/*************************************************************************** + Unmount a share. (Private part) +***************************************************************************/ + +void Smb4KMounter::unmount( const QString &mountpoint, bool force, bool noMessage ) +{ + // First let's see if all requirements are fullfilled: + + if ( force ) + { + // Check that the user enabled the "Force Unmounting" ability: + if ( !Smb4KSettings::useForceUnmount() ) + { + Smb4KError::error( ERROR_FEATURE_NOT_ENABLED ); + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + + // Compose the unmount command: + if ( !mountpoint.stripWhiteSpace().isEmpty() ) + { + bool execute = false; + + QString path = mountpoint; + m_priv->setPath( path.replace( '\044', "\044" ) ); + + QString suid_program, command; + + if ( Smb4KSettings::useForceUnmount() || Smb4KSettings::alwaysUseSuperUser() ) + { + switch ( Smb4KSettings::superUserProgram() ) + { + case Smb4KSettings::EnumSuperUserProgram::Sudo: + { + suid_program = Smb4KSettings::sudo(); + + break; + } + case Smb4KSettings::EnumSuperUserProgram::Super: + { + suid_program = Smb4KSettings::super(); + + break; + } + default: + { + // FIXME: Throw an error? + return; + } + } + } + + Smb4KShare *share = findShareByPath( mountpoint ); + + if ( share ) + { + if ( !share->isForeign() ) + { + if ( force ) + { + if ( KMessageBox::questionYesNo( 0, i18n( "Do you really want to force the unmounting of this share?" ), QString::null, KStdGuiItem::yes(), KStdGuiItem::no(), "Dont Ask Forced", KMessageBox::Notify ) == KMessageBox::Yes ) + { +#ifdef __linux__ + command.append( QString( "%1 smb4k_umount -s -l " ).arg( suid_program ) ); +#else +#ifdef __FreeBSD__ + command.append( QString( "%1 smb4k_umount " ).arg( suid_program ) ); +#else + command.append( QString( "%1 smb4k_umount -s " ).arg( suid_program ) ); +#endif +#endif + execute = true; + } + else + { + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + else + { + if ( !Smb4KSettings::alwaysUseSuperUser() ) + { +#ifndef __FreeBSD__ + command.append( "smb4k_umount -n " ); +#else + command.append( "smb4k_umount " ); +#endif + } + else + { +#ifndef __FreeBSD__ + command.append( QString( "%1 smb4k_umount -s " ).arg( suid_program ) ); +#else + command.append( QString( "%1 smb4k_umount " ).arg( suid_program ) ); +#endif + } + } + } + else + { + if ( Smb4KSettings::unmountForeignShares() ) + { + if ( force ) + { + if ( KMessageBox::questionYesNo( 0, i18n( "Do you really want to force the unmounting of this share?" ), QString::null, KStdGuiItem::yes(), KStdGuiItem::no(), "Dont Ask Forced", KMessageBox::Notify ) == KMessageBox::Yes ) + { +#ifdef __linux__ + command.append( QString( "%1 smb4k_umount -s -l " ).arg( suid_program ) ); +#else +#ifdef __FreeBSD__ + command.append( QString( "%1 smb4k_umount " ).arg( suid_program ) ); +#else + command.append( QString( "%1 smb4k_umount -s " ).arg( suid_program ) ); +#endif +#endif + execute = true; + } + else + { + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + else + { + if ( !Smb4KSettings::alwaysUseSuperUser() ) + { +#ifndef __FreeBSD__ + command.append( "smb4k_umount -n " ); +#else + command.append( "smb4k_umount " ); +#endif + } + else + { +#ifndef __FreeBSD__ + command.append( QString( "%1 smb4k_umount -s " ).arg( suid_program ) ); +#else + command.append( QString( "%1 smb4k_umount " ).arg( suid_program ) ); +#endif + } + } + } + else + { + if ( !noMessage ) + { + Smb4KError::error( ERROR_UNMOUNTING_NOT_ALLOWED ); + } + + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } + } + +#ifndef __FreeBSD__ + command.append( QString( "-t %1 " ).arg( share->filesystem() ) ); +#endif + command.append( QString( "'%1'" ).arg( m_priv->path() ) ); + + if ( force && !execute ) + { + return; + } + + emit aboutToUnmount( mountpoint ); + + *m_proc << command; + startProcess( Unmount ); + } + else + { + // FIXME: Throw an error? + return; + } + } + else + { + Smb4KError::error( ERROR_MOUNTPOINT_EMPTY ); + m_working = false; + emit state( MOUNTER_STOP ); + + return; + } +} + + +/*************************************************************************** + Unmounts all shares at once. (Public part) +***************************************************************************/ + +void Smb4KMounter::unmountAllShares() +{ + m_queue.enqueue( new QString( QString( "%1" ).arg( UnmountAll ) ) ); +} + + +/*************************************************************************** + Unmounts all shares at once. +***************************************************************************/ + +void Smb4KMounter::unmountAll() +{ + for ( QValueListIterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + unmountShare( *it, false, true ); + } + + m_working = false; +} + + +/*************************************************************************** + Starts any process. +***************************************************************************/ + +void Smb4KMounter::startProcess( int state ) +{ + m_buffer = QString::null; + m_state = state; + + if ( m_state != Import ) + { + QApplication::setOverrideCursor( waitCursor ); + } + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + + +/*************************************************************************** + Ends any process. This functions tells the mounter what to do + afterwards. +***************************************************************************/ + +void Smb4KMounter::endProcess() +{ + switch ( m_state ) + { + case Mount: + processMount(); + break; + case Unmount: + processUnmount(); + break; + default: + break; + } + + m_state = Idle; + + m_priv->clearData(); + + QApplication::restoreOverrideCursor(); + m_proc->clearArguments(); + + m_working = false; + emit state( MOUNTER_STOP ); +} + + +/*************************************************************************** + Process mounts. +***************************************************************************/ + +void Smb4KMounter::processMount() +{ + Smb4KShare *share = NULL; + +#ifndef __FreeBSD__ + + if ( m_proc->normalExit() ) + { + if ( m_buffer.contains( "smb4k_mount:", true ) == 0 && + m_buffer.contains( "failed", true ) == 0 && + m_buffer.contains( "ERR", true ) == 0 && + m_buffer.contains( "/bin/sh:" ) == 0 && + m_buffer.contains( "mount:", true ) == 0 && + m_buffer.contains( "smbmnt" ) == 0 && + m_buffer.contains( m_priv->path() ) == 0 && + m_buffer.contains( "mount error" ) == 0 && + m_buffer.contains( "bad user name" ) == 0 && + m_buffer.contains( "bad group name" ) == 0 ) + { + QString name = QString( "//%1/%2" ).arg( m_priv->host() ).arg( m_priv->share() ); + + // Check file system +#if !defined(__solaris__) + struct statfs filesystem; +#else + struct statvfs filesystem; +#endif + +#if !defined(__solaris__) && !defined(__irix__) + if ( statfs( m_priv->path(), &filesystem ) == -1 ) +#elif defined(__irix__) + if ( statfs( m_priv->path(), &filesystem, sizeof( filesystem ), 0 ) == -1 ) +#else + if ( statvfs( m_priv->path(), &filesystem ) == -1 ) +#endif + { + // The query failed. Go with the file system already defined in m_priv. + if ( QString::compare( m_priv->filesystem(), "smbfs" ) == 0 ) + { + share = new Smb4KShare( name, m_priv->path(), m_priv->filesystem(), (int)getuid(), (int)getgid() ); + m_mounted_shares.append( share ); + } + else if ( QString::compare( m_priv->filesystem(), "cifs" ) == 0 ) + { + // The user name will be send if no login was specified. + QString cifs_login = !m_priv->cifsLogin().isEmpty() ? + m_priv->cifsLogin() : + getpwuid( getuid() )->pw_name; + + share = new Smb4KShare( name, m_priv->path(), m_priv->filesystem(), cifs_login, false ); + m_mounted_shares.append( share ); + } + } + else + { +#if !defined(__FreeBSD__) && !defined(__solaris__) && !defined(__irix__) + if ( (uint)filesystem.f_type == 0xFF534D42 /* CIFS */) + { + // The user name will be send if no login was specified. + QString cifs_login = !m_priv->cifsLogin().isEmpty() ? + m_priv->cifsLogin() : + getpwuid( getuid() )->pw_name; + + share = new Smb4KShare( name, m_priv->path(), "cifs", cifs_login, false ); + m_mounted_shares.append( share ); + } + else if ( (uint)filesystem.f_type == 0x517B /* SMBFS */) + { + share = new Smb4KShare( name, m_priv->path(), "smbfs", (int)getuid(), (int)getgid() ); + m_mounted_shares.append( share ); + } +#elif defined(__solaris__) + if ( (uint)filesystem.f_basetype == 0xFF534D42 /* CIFS */) + { + // The user name will be send if no login was specified. + QString cifs_login = !m_priv->cifsLogin().isEmpty() ? + m_priv->cifsLogin() : + getpwuid( getuid() )->pw_name; + + share = new Smb4KShare( name, m_priv->path(), "cifs", cifs_login, false ); + m_mounted_shares.append( share ); + } + else if ( (uint)filesystem.f_basetype == 0x517B /* SMBFS */) + { + share = new Smb4KShare( name, m_priv->path(), "smbfs", (int)getuid(), (int)getgid() ); + m_mounted_shares.append( share ); + } +#elif defined(__irix__) + if ( (uint)filesystem.f_fstyp == 0xFF534D42 /* CIFS */) + { + // The user name will be send if no login was specified. + QString cifs_login = !m_priv->cifsLogin().isEmpty() ? + m_priv->cifsLogin() : + getpwuid( getuid() )->pw_name; + + share = new Smb4KShare( name, m_priv->path(), "cifs", cifs_login, false ); + m_mounted_shares.append( share ); + } + else if ( (uint)filesystem.f_basetype == 0x517B && !strncmp( fs, "smbfs", strlen( fs )+1 ) ) + { + share = new Smb4KShare( name, m_priv->path(), "smbfs", (int)getuid(), (int)getgid() ); + m_mounted_shares.append( share ); + } +#endif + else + { + // Error... We don't create a share. + } + } + + if ( share ) + { + // Check that the share is accessible: + checkAccessibility( share ); + + emit mountedShare( m_priv->path() ); + } + } + else + { + if ( m_buffer.contains( "ERRbadpw" ) != 0 || + m_buffer.contains( "ERRnoaccess" ) != 0 || + m_buffer.contains( "mount error 13 = Permission denied" ) != 0 ) + { + int state = Smb4KPasswordHandler::None; + + if ( m_buffer.contains( "ERRbadpw" ) != 0 ) + { + state = Smb4KPasswordHandler::BadPassword; + } + else if ( m_buffer.contains( "ERRnoaccess" ) != 0 ) + { + state = Smb4KPasswordHandler::AccessDenied; + } + else if ( m_buffer.contains( "mount error 13 = Permission denied" ) != 0 ) + { + state = Smb4KPasswordHandler::PermDenied; + } + + // If the user supplied auth information, we will retry mounting. + if ( passwordHandler()->askpass( m_priv->workgroup(), m_priv->host(), m_priv->share(), state ) ) + { + mountShare( m_priv->workgroup(), m_priv->host(), m_priv->ip(), m_priv->share() ); + } + } + else if ( m_buffer.contains( "ERRnosuchshare" ) != 0 && m_priv->share().contains( "_" ) != 0 ) + { + QString share_string = static_cast( m_priv->share() ).replace( "_", " " ); + mountShare( m_priv->workgroup(), m_priv->host(), m_priv->ip(), share_string ); + } + else + { + QString name = QString( "//%1/%2" ).arg( m_priv->host() ).arg( m_priv->share() ); + + Smb4KError::error( ERROR_MOUNTING_SHARE, name, m_buffer ); + } + } + } + +#else + + if ( m_proc->normalExit() ) + { + if ( m_buffer.contains( "smb4k_mount:", true ) == 0 && + m_buffer.contains( "syserr =", true ) == 0 && + /* To make sure we catch all errors, also check for the following + strings. Maybe we can remove them?? */ + m_buffer.contains( "Authentication error", true ) == 0 && + m_buffer.contains( "Connection refused", true ) == 0 && + m_buffer.contains( "Operation not permitted", true ) == 0 ) + { + import(); // FIXME: *cough* What is this for??? + + Smb4KAuthInfo authInfo( m_priv->workgroup(), m_priv->host(), m_priv->share() ); + (void) passwordHandler()->readAuth( &authInfo ); + + QString name = QString( "//%1@%2/%3" ).arg( authInfo.user().upper(), m_priv->host().upper(), m_priv->share().upper() ); + + share = new Smb4KShare( name, m_priv->path(), m_priv->filesystem(), (int)getuid(), (int)getgid() ); + m_mounted_shares.append( share ); + + // Check that the share is accessible: + checkAccessibility( share ); + + emit mountedShare( m_priv->path() ); + } + else + { + if ( m_buffer.contains( "Authentication error" ) != 0 ) + { + // If the user supplied auth information, we will retry mounting. + if ( passwordHandler()->askpass( m_priv->workgroup(), m_priv->host(), m_priv->share(), Smb4KPasswordHandler::AuthError ) ) + { + mountShare( m_priv->workgroup(), m_priv->host(), m_priv->ip() , m_priv->share() ); + } + } + else + { + Smb4KAuthInfo authInfo( m_priv->workgroup(), m_priv->host(), m_priv->share() ); + (void) passwordHandler()->readAuth( &authInfo ); + + QString name = QString( "//%1@%2/%3" ).arg( authInfo.user().upper(), m_priv->host().upper(), m_priv->share().upper() ); + + Smb4KError::error( ERROR_MOUNTING_SHARE, name, m_buffer ); + } + } + } + +#endif + + emit updated(); +} + + +/*************************************************************************** + Process unmounts. +***************************************************************************/ + +void Smb4KMounter::processUnmount() +{ + // Get the share: + Smb4KShare *share = findShareByPath( m_priv->path() ); + + if ( m_proc->normalExit() ) + { + if ( m_buffer.isEmpty() ) + { + if ( qstrncmp( share->canonicalPath(), + QDir( Smb4KSettings::mountPrefix() ).canonicalPath().local8Bit(), + QDir( Smb4KSettings::mountPrefix() ).canonicalPath().local8Bit().length() ) == 0 ) + { + QDir dir( share->canonicalPath() ); + + if ( dir.rmdir( dir.canonicalPath(), true ) ) + { + dir.cdUp(); + dir.rmdir( dir.canonicalPath(), true ); + } + } + + m_mounted_shares.remove(share); + } + else + { + // If the user's computer is configured by a DHCP server, under + // rare circumstances it might occur that sudo reports an error, + // because it is not able to resolve the host. This error message + // will be removed, because it does not affect the unmounting: + if ( m_buffer.contains( "sudo: unable to resolve host", true ) != 0 ) + { + size_t hostnamelen = 255; + char *hostname = new char[hostnamelen]; + + if ( gethostname( hostname, hostnamelen ) == -1 ) + { + int error_number = errno; + Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) ); + } + else + { + QString str = QString( "sudo: unable to resolve host %1\n" ).arg( hostname ); + + m_buffer.remove( str, false /* case insensitive */ ); + + if ( !m_buffer.isEmpty() ) + { + Smb4KError::error( ERROR_UNMOUNTING_SHARE, share->name(), m_buffer ); + } + else + { + if ( qstrncmp( share->canonicalPath(), + QDir( Smb4KSettings::mountPrefix() ).canonicalPath().local8Bit(), + QDir( Smb4KSettings::mountPrefix() ).canonicalPath().local8Bit().length() ) == 0 ) + { + QDir dir( share->canonicalPath() ); + + if ( dir.rmdir( dir.canonicalPath(), true ) ) + { + dir.cdUp(); + dir.rmdir( dir.canonicalPath(), true ); + } + } + + m_mounted_shares.remove(share); + } + } + + delete [] hostname; + } + else + { + Smb4KError::error( ERROR_UNMOUNTING_SHARE, share->name(), m_buffer ); + } + } + } + + emit updated(); +} + + +/*************************************************************************** + Check if a share is already mounted +***************************************************************************/ + +bool Smb4KMounter::isMounted( const QString &name, bool userOnly ) +{ + QValueList list = findShareByName( name ); + + bool mounted = false; + + if ( !list.isEmpty() && userOnly ) + { + for ( QValueList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it).isForeign() ) + { + mounted = true; + + break; + } + else + { + continue; + } + } + } + else + { + mounted = !list.isEmpty(); + } + + return mounted; +} + + +/*************************************************************************** + Find a share in the list with its path +***************************************************************************/ + +Smb4KShare* Smb4KMounter::findShareByPath( const QString &path ) +{ + if ( path.isEmpty() || m_mounted_shares.isEmpty() ) + { + return NULL; + } + + Smb4KShare *share = NULL; + + for ( QValueListIterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + if( QString::compare( path.upper(), QString::fromLocal8Bit( (*it)->path(), -1 ).upper() ) == 0 || + QString::compare( path.upper(), QString::fromLocal8Bit( (*it)->canonicalPath(), -1 ).upper() ) == 0 ) + { + share = *it; + + break; + } + } + + return share; +} + + +/*************************************************************************** + Find the list of mounts of a share +***************************************************************************/ + +QValueList Smb4KMounter::findShareByName( const QString &name ) +{ + QValueList list; + + if ( name.isEmpty() || m_mounted_shares.isEmpty() ) + { + return list; // is empty + } + + QString n = name; + + for ( QValueListIterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + if( QString::compare( (*it)->name().upper(), name.upper() ) == 0 || + QString::compare( (*it)->name().upper(), n.replace( " ", "_" ).upper() ) == 0 ) + { + list.append( *(*it) ); + + continue; + } + else + { + continue; + } + } + + return list; +} + + +/*************************************************************************** + Returns a list of mount points that belong to broken shares +***************************************************************************/ + +const QValueList Smb4KMounter::getBrokenShares() +{ + QValueList broken_shares; + + for ( QValueListIterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + if ( (*it)->isBroken() ) + { + broken_shares.append( *it ); + + continue; + } + else + { + continue; + } + } + + return broken_shares; +} + + +void Smb4KMounter::prepareForShutdown() +{ + slotShutdown(); +} + + +void Smb4KMounter::checkAccessibility( Smb4KShare *share ) +{ + if ( share ) + { + m_priv->thread.setMountpoint( share->path() ); + m_priv->thread.start(); + m_priv->thread.wait( THREAD_WAITING_TIME ); + m_priv->thread.terminate(); + m_priv->thread.wait(); + + share->setBroken( m_priv->thread.isBroken() ); + share->setTotalDiskSpace( m_priv->thread.totalDiskSpace() ); + share->setFreeDiskSpace( m_priv->thread.freeDiskSpace() ); + } + else + { + // FIXME: Should we throw an error here? + } +} + + +void Smb4KMounter::timerEvent( QTimerEvent * ) +{ + if ( !m_working && !m_queue.isEmpty() ) + { + // Tell the mounter, that it is busy. + m_working = true; + + QString *item = m_queue.dequeue(); + int todo = item->section( ":", 0, 0 ).toInt(); + + switch ( todo ) + { + case Remount: + { + remount(); + break; + } + case Import: + { + import(); + break; + } + case Mount: + { + emit state( MOUNTER_MOUNTING ); + mount( item->section( ":", 1, 1 ), item->section( ":", 2, 2 ), item->section( ":", 3, 3 ), item->section( ":", 4, 4 ) ); + break; + } + case Unmount: + { + emit state( MOUNTER_UNMOUNTING ); + unmount( item->section( ":", 1, 1 ), (bool)item->section( ":", 2, 2 ).toInt() /* force */, (bool)item->section( ":", 3, 3 ).toInt() /* noMessage */); + break; + } + case UnmountAll: + { + unmountAll(); + break; + } + default: + { + break; + } + } + + delete item; + } + + m_priv->timerTicks++; + + if ( m_priv->timerTicks * timerInterval() >= Smb4KSettings::checkInterval() /* msec */ && + (!m_working || m_queue.isEmpty()) ) + { + m_queue.enqueue( new QString( QString( "%1:" ).arg( Import ) ) ); + m_priv->timerTicks = 0; + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + + +void Smb4KMounter::slotProcessExited( KProcess * ) +{ + endProcess(); +} + + +void Smb4KMounter::slotReceivedStdout( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KMounter::slotReceivedStderr( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KMounter::slotShutdown() +{ + // Abort any action: + abort(); + + // Prepare for shutdown: + if ( Smb4KSettings::remountShares() && !m_mounted_shares.isEmpty() ) + { + for ( QValueList::ConstIterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + optionsHandler()->remount( *it, !(*it)->isForeign() ); + } + } + + optionsHandler()->sync(); + + QDir dir; + + dir.cd( Smb4KSettings::mountPrefix() ); + + QStringList dirs = dir.entryList( QDir::Dirs, QDir::DefaultSort ); + + QValueList broken_shares = getBrokenShares(); + + for ( QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) + { + if ( QString::compare( *it, "." ) != 0 && QString::compare( *it, ".." ) != 0 ) + { + bool broken = false; + + for ( QValueListIterator bs = broken_shares.begin(); bs != broken_shares.end(); ++bs ) + { + if ( qstrncmp( (*bs)->path(), + Smb4KSettings::mountPrefix()+*it, + (Smb4KSettings::mountPrefix()+*it).length() ) == 0 || + qstrncmp( (*bs)->canonicalPath(), + Smb4KSettings::mountPrefix()+*it, + (Smb4KSettings::mountPrefix()+*it).length() ) == 0 ) + { + broken = true; + + break; + } + else + { + continue; + } + } + + if ( !broken ) + { + dir.cd( *it ); + + QStringList subdirs = dir.entryList( QDir::Dirs, QDir::DefaultSort ); + + for ( QStringList::ConstIterator i = subdirs.begin(); i != subdirs.end(); ++i ) + { + if ( QString::compare( *i, "." ) != 0 && QString::compare( *i, ".." ) != 0 ) + { + dir.rmdir( *i ); + } + } + + dir.cdUp(); + dir.rmdir( *it ); + } + } + } + + broken_shares.clear(); + + if ( Smb4KSettings::unmountSharesOnExit() ) + { + QString suid_program, command; + + switch( Smb4KSettings::superUserProgram() ) + { + case Smb4KSettings::EnumSuperUserProgram::Sudo: + { + suid_program = Smb4KSettings::sudo(); + + break; + } + case Smb4KSettings::EnumSuperUserProgram::Super: + { + suid_program = Smb4KSettings::super(); + + break; + } + default: + { + // FIXME: Throw an error? + return; + } + } + + KProcess proc; + proc.setUseShell( true ); + proc.detach(); + + for ( QValueListIterator it = m_mounted_shares.begin(); it != m_mounted_shares.end(); ++it ) + { + if ( !(*it)->isForeign() ) + { + if ( Smb4KSettings::alwaysUseSuperUser() ) + { +#ifndef __FreeBSD__ + command.append( QString( "%1 smb4k_umount -s -t %2 " ).arg( suid_program ).arg( (*it)->filesystem() ) ); +#else + command.append( QString( "%1 smb4k_umount " ).arg( suid_program ) ); +#endif + command.append( KProcess::quote( (*it)->path() ) ); + command.append( " ; " ); + } + else + { +#ifndef __FreeBSD__ + command.append( QString( "smb4k_umount -n -t %1 " ).arg( (*it)->filesystem() ) ); +#else + command.append( "smb4k_umount " ); +#endif + command.append( KProcess::quote( (*it)->path() ) ); + command.append( " ; " ); + } + + dir.setPath( (*it)->canonicalPath() ); + +#ifndef __FreeBSD__ + command.append( "rmdir --ignore-fail-on-non-empty " ); + command.append( KProcess::quote( dir.canonicalPath() ) ); + command.append( " ; " ); + command.append( "rmdir --ignore-fail-on-non-empty " ); + dir.cdUp(); + command.append( KProcess::quote( dir.canonicalPath() ) ); + command.append( " ; " ); +#else + command.append( "rmdir " ); + command.append( KProcess::quote( dir.canonicalPath() ) ); + command.append( " ; " ); + command.append( "rmdir " ); + dir.cdUp(); + command.append( KProcess::quote( dir.canonicalPath() ) ); + command.append( " ; " ); +#endif + } + else + { + continue; + } + } + + command.truncate( command.length() - 2 ); + + proc << command; + proc.start( KProcess::DontCare, KProcess::NoCommunication ); + } +} + + +#include "smb4kmounter.moc" diff --git a/smb4k/core/smb4kmounter.h b/smb4k/core/smb4kmounter.h new file mode 100644 index 0000000..a5f51db --- /dev/null +++ b/smb4k/core/smb4kmounter.h @@ -0,0 +1,343 @@ +/*************************************************************************** + smb4kmounter.h - The core class that mounts the shares. + ------------------- + begin : Die Jun 10 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KMOUNTER_H +#define SMB4KMOUNTER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include + +// application specific includes +#include "smb4kdefs.h" + +// forward declarations +class Smb4KMounterPrivate; +class Smb4KShare; + + +/** + * This is one of the core classes of Smb4K. It manages the mounting + * and unmounting of remote Samba/Windows shares. Additionally it maintains a + * list of all mounts with SMBFS and CIFS file system that are present + * on the system. + * + * @author Alexander Reinholdt + */ + +class Smb4KMounter : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor. + */ + Smb4KMounter( QObject *parent = 0, const char *name = 0 ); + /** + * The destructor. + */ + ~Smb4KMounter(); + + /** + * Aborts a running process. + */ + void abort(); + + /** + * Enumeration for the state of the process. The members are also + * used in the results() signal as return values. + */ + enum State{ Remount, Import, Mount, Unmount, UnmountAll, Idle }; + + /** + * Unmounts a share. This can either be done the "normal" way, or you may + * force it. If you decide the force the unmounting by setting @p force to TRUE, + * a lazy unmount will be initiated. With the parameter @p noMessage you can + * suppress any error messages. + * + * @param share The share object that should be unmounted. + * + * @param force Force the unmounting of the share. + * + * @param noMessage Determines whether this function should emit an error code in case of an error. + * The default value is FALSE. + */ + void unmountShare( Smb4KShare *share, bool force = false, bool noMessage = false ); + + /** + * Unmounts all shares at once. + */ + void unmountAllShares(); + + /** + * Mounts a share. + * + * @param workgroup The workgroup of the share. + * + * @param host The server where the share is located. + * + * @param ip The IP address of the host. + * + * @param share The name of the share. + */ + void mountShare( const QString &workgroup, const QString &host, const QString &ip, const QString &share ); + + /** + * Returns the unsorted list of mounted shares. + */ + const QValueList &getShares() { return m_mounted_shares; }; + + /** + * Find a share in the list with its path. + */ + Smb4KShare* findShareByPath( const QString &path ); + + /** + * Find all mounts of the particular share @p share on the system. + * + * @param name The name of the share + * + * @returns the complete list of mounts of @p share. + */ + QValueList findShareByName( const QString &name ); + + /** + * This function returns TRUE if a share is mounted and FALSE otherwise. + * + * @param name The name of the share. It has to look like this: + * //HOST/SHARE. + * + * @param userOnly Specifies whether this function should only consider + * shares mounted by the user or all shares that are + * available on the system. The default is TRUE. + * + * @return TRUE if the share is mounted and FALSE otherwise. + */ + bool isMounted( const QString &name, bool userOnly = true ); + + /** + * This function reports if the mounter is running or not. + * + * @returns TRUE if the scanner is running and FALSE otherwise. + */ + bool isRunning() { return m_working; } + + /** + * This function returns the list of broken shares. + * + * @returns The list of broken shares. + */ + const QValueList getBrokenShares(); + + /** + * This function executes Smb4KMounter::slotShutdown(). Under normal circumstances, + * there is no need to use this function, because everything that is done here is + * also done when KApplication::shutDown() is emitted. However, it comes in handy + * when you need to perform last actions in a plugin. + */ + void prepareForShutdown(); + + /** + * This function initializes import of mounted shares and the remounting of recently + * used shares. + */ + void init(); + + signals: + /** + * This signal emits the run state. + * + * @param state The so-called run state. There are several defined + * in the smb4kdefs.h header file. + */ + void state( int state ); + + /** + * Tells the program, that the shares list has been updated. + */ + void updated(); + + /** + * This signal is emitted when a share has successfully been mounted or + * if it has already been mounted. + * + * @param mountpoint The mount point of the share. + */ + void mountedShare( const QString &mountpoint ); + + /** + * This signal is emitted just before a share is unmounted. + * + * @param mountpoint The mount point of the share that is going to + * be unmounted. + */ + void aboutToUnmount( const QString &mountpoint ); + + protected: + /** + * Starts a process. It takes an interger, that determines, + * which process has to be started. + */ + void startProcess( int state ); + + /** + * Is called, when the process ended. + */ + void endProcess(); + + /** + * Finishes the mounting of shares. + */ + void processMount(); + + /** + * Finishes the unmounting of a single share. + */ + void processUnmount(); + + /** + * Reimplemented from QObject + */ + void timerEvent( QTimerEvent *e ); + + protected slots: + /** + * Is called, when the process exits. + */ + void slotProcessExited( KProcess * ); + + /** + * Is called, if output is received on Stdout. + */ + void slotReceivedStdout( KProcess *, char *buf, int len ); + + /** + * Is called, if output is received on Stderr. + */ + void slotReceivedStderr( KProcess *, char *buf, int len ); + + /** + * This slot is called by the KApplication::shutDown() signal. + * Is does everything that has to be done before the program + * really exits. + */ + void slotShutdown(); + + private: + /** + * Remount shares that were used in the last session. + */ + void remount(); + + /** + * Imports mounted shares. + */ + void import(); + + /** + * Mounts a selected share. + */ + void mount( const QString &workgroup, const QString &host, const QString &ip, const QString &share ); + + /** + * Unmounts the selected item. + */ + void unmount( const QString &mountpoint, bool noMessage, bool force = false ); + + /** + * Unmounts all shares at once. + */ + void unmountAll(); + + /** + * Checks if the share @p share is accessible or not and sets Smb4KShare::isBroken() + * accordingly. Additionally, Smb4KShare::totalDiskSpace() and Smb4KShare::freeDiskSpace() + * are set to the current values. + * + * @param share The share that should be checked. + */ + void checkAccessibility( Smb4KShare *share ); + + /** + * The KProcess object. + */ + KProcess *m_proc; + + /** + * The buffer. + */ + QString m_buffer; + + /** + * The queue, where the incoming requests are stored. + */ + QPtrQueue m_queue; + + /** + * Determines, whether the mounter is running or not. + */ + bool m_working; + + /** + * Holds the list of currently mounted shares as a pointer list. + */ + QValueList m_mounted_shares; + + /** + * Makes sure that the error message concerning the missing of + * the file /proc/mounts is only shown once. + */ + bool m_proc_error; + + /** + * The internal state of the process. Do not mix this up with + * the state that's emitted to notify the application about changes. + */ + int m_state; + +#ifndef __FreeBSD__ + /** + * This file object points to /proc/mounts. + */ + QFile m_proc_mounts; +#endif + + /** + * This is the pointer to the private helper class. + */ + Smb4KMounterPrivate *m_priv; +}; + +#endif diff --git a/smb4k/core/smb4kmounter_p.cpp b/smb4k/core/smb4kmounter_p.cpp new file mode 100644 index 0000000..96d1149 --- /dev/null +++ b/smb4k/core/smb4kmounter_p.cpp @@ -0,0 +1,135 @@ +/*************************************************************************** + smb4kmounter_p - This is a private helper class for Smb4KMounter. + ------------------- + begin : Do Jul 19 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + + +// application specific includes +#include "smb4kmounter_p.h" + +Smb4KMounterPrivate::Smb4KMounterPrivate() +{ + timerTicks = 0; + clearData(); +} + + +Smb4KMounterPrivate::~Smb4KMounterPrivate() +{ +} + + +void Smb4KMounterPrivate::clearData() +{ + m_workgroup = QString::null; + m_host = QString::null; + m_share = QString::null; + m_ip = QString::null; + m_path = QString::null; + m_filesystem = QString::null; + m_cifsLogin = QString::null; +} + + +const QString &Smb4KMounterPrivate::workgroup() +{ + return m_workgroup; +} + + +const QString &Smb4KMounterPrivate::host() +{ + return m_host; +} + + +const QString &Smb4KMounterPrivate::share() +{ + return m_share; +} + + +const QString &Smb4KMounterPrivate::ip() +{ + return m_ip; +} + + +const QString &Smb4KMounterPrivate::path() +{ + return m_path; +} + + +const QString &Smb4KMounterPrivate::filesystem() +{ + return m_filesystem; +} + + +const QString &Smb4KMounterPrivate::cifsLogin() +{ + return m_cifsLogin; +} + + +void Smb4KMounterPrivate::setWorkgroup( const QString &wg ) +{ + m_workgroup = wg; +} + + +void Smb4KMounterPrivate::setHost( const QString &h ) +{ + m_host = h; +} + + +void Smb4KMounterPrivate::setShare( const QString &s ) +{ + m_share = s; +} + + +void Smb4KMounterPrivate::setIP( const QString &i ) +{ + m_ip = i; +} + + +void Smb4KMounterPrivate::setPath( const QString &p ) +{ + m_path = p; +} + + +void Smb4KMounterPrivate::setFileSystem( const QString &f ) +{ + m_filesystem = f; +} + + +void Smb4KMounterPrivate::setCIFSLogin( const QString &l ) +{ + m_cifsLogin = l; +} diff --git a/smb4k/core/smb4kmounter_p.h b/smb4k/core/smb4kmounter_p.h new file mode 100644 index 0000000..334ffa3 --- /dev/null +++ b/smb4k/core/smb4kmounter_p.h @@ -0,0 +1,126 @@ +/*************************************************************************** + smb4kmounter_p - This is a private helper class for Smb4KMounter. + ------------------- + begin : Do Jul 19 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KMOUNTER_P_H +#define SMB4KMOUNTER_P_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include + +// system includes +#include + +class Smb4KMounterPrivate +{ + public: + Smb4KMounterPrivate(); + ~Smb4KMounterPrivate(); + int timerTicks; + + class Thread : public QThread + { + public: + Thread() : QThread(), m_mountpoint( QString::null ), m_broken( true ) {} + ~Thread() {} + + void setMountpoint( const QString &mp ) { m_mountpoint = mp; } + + virtual void run() + { + if ( m_mountpoint.isEmpty() ) + { + kdFatal() << "Smb4KMounterPrivate::Thread: No mountpoint specified" << endl; + } + + struct statvfs fs; + + if ( statvfs( m_mountpoint.local8Bit(), &fs ) == -1 ) + { + m_broken = true; + m_total = -1; + m_free = -1; + } + else + { + m_broken = false; + + double kB_block = (double)(fs.f_bsize / 1024); + double total = (double)(fs.f_blocks*kB_block); + double free = (double)(fs.f_bfree*kB_block); + + m_total = total; + m_free = free; + } + + m_mountpoint = QString::null; + } + + bool isBroken() { return m_broken; } + double totalDiskSpace() { return m_total; } + double freeDiskSpace() { return m_free; } + + private: + QString m_mountpoint; + bool m_broken; + double m_total; + double m_free; + }; + + Thread thread; + void clearData(); + const QString &workgroup(); + const QString &host(); + const QString &share(); + const QString &ip(); + const QString &path(); + const QString &filesystem(); + const QString &cifsLogin(); + void setWorkgroup ( const QString &wg ); + void setHost( const QString &h ); + void setShare( const QString &s ); + void setIP( const QString &i ); + void setPath( const QString &p ); + void setFileSystem( const QString &f ); + void setCIFSLogin( const QString &l ); + + private: + QString m_workgroup; + QString m_host; + QString m_share; + QString m_ip; + QString m_path; + QString m_filesystem; + QString m_cifsLogin; +}; + +#endif diff --git a/smb4k/core/smb4knetworkitems.cpp b/smb4k/core/smb4knetworkitems.cpp new file mode 100644 index 0000000..b278640 --- /dev/null +++ b/smb4k/core/smb4knetworkitems.cpp @@ -0,0 +1,239 @@ +/*************************************************************************** + smb4knetworkitems - Network items used by the Smb4KScanner class + to pass and store data. + ------------------- + begin : Mi Jun 2 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include +#include + +// application specific includes +#include "smb4knetworkitems.h" + + +/**************************************************************************** + Smb4KWorkgroupItem class +****************************************************************************/ + +Smb4KWorkgroupItem::Smb4KWorkgroupItem( const QString &name, const QString &master, const QString &masterIP ) +: m_name( name ), m_master( master ), m_pseudo( false ) +{ + m_ip = ipIsValid( masterIP ) ? masterIP : QString::null; +} + + +Smb4KWorkgroupItem::~Smb4KWorkgroupItem() +{ +} + + +void Smb4KWorkgroupItem::setPseudoMaster() +{ + m_pseudo = true; +} + + +void Smb4KWorkgroupItem::setMasterIP( const QString &ip ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; +} + + +void Smb4KWorkgroupItem::setMaster( const QString &name, const QString &ip, bool pseudo ) +{ + m_master = name; + m_ip = ipIsValid( ip ) ? ip : QString::null; + m_pseudo = pseudo; +} + + +bool Smb4KWorkgroupItem::ipIsValid( const QString &ip ) +{ + if ( !ip.isEmpty() ) + { + KNetwork::KIpAddress ip_address = KNetwork::KIpAddress( ip ); + + if ( !ip_address.isIPv4Addr() && !ip_address.isIPv6Addr() ) + { + return false; + } + } + else + { + return false; + } + + return true; +} + + +/**************************************************************************** + Smb4KHostItem class +****************************************************************************/ + +Smb4KHostItem::Smb4KHostItem( const QString &workgroup, const QString &name, const QString &comment, const QString &ip ) +: m_workgroup( workgroup ), m_name( name ), m_comment( comment ), m_server_string( QString::null ), + m_os_string( QString::null ), m_master( false ), m_ip_checked( m_ip.stripWhiteSpace().isEmpty() ? false : true ), + m_info_checked( false ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; +} + + +Smb4KHostItem::Smb4KHostItem( const Smb4KHostItem &host ) +: m_workgroup( host.workgroup() ), m_name( host.name() ), m_comment( host.comment() ), m_ip( host.ip() ), + m_server_string( host.serverString() ), m_os_string( host.osString() ), m_master( host.isMaster() ), + m_ip_checked( host.ipAddressChecked() ), m_info_checked( host.infoChecked() ) +{ + // NOTE: We do not check the IP address here, because that has + // already been done by the copied Smb4KHostItem object. +} + + +Smb4KHostItem::~Smb4KHostItem() +{ +} + + +void Smb4KHostItem::setServerString( const QString &server ) +{ + m_server_string = server; +} + + +void Smb4KHostItem::setOSString( const QString &os ) +{ + m_os_string = os; +} + + +void Smb4KHostItem::setMaster( bool master ) +{ + m_master = master; +} + + +void Smb4KHostItem::setIPAddress( const QString &ip ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; +} + + +void Smb4KHostItem::setComment( const QString &comment ) +{ + m_comment = comment; +} + + +void Smb4KHostItem::setIPAddressChecked( bool yes ) +{ + m_ip_checked = yes; +} + + +void Smb4KHostItem::setInfoChecked( bool yes ) +{ + m_info_checked = yes; +} + + +bool Smb4KHostItem::ipIsValid( const QString &ip ) +{ + if ( !ip.isEmpty() ) + { + KNetwork::KIpAddress ip_address = KNetwork::KIpAddress( ip ); + + if ( !ip_address.isIPv4Addr() && !ip_address.isIPv6Addr() ) + { + return false; + } + } + else + { + return false; + } + + return true; +} + + +/**************************************************************************** + Smb4KShareItem class +****************************************************************************/ + +Smb4KShareItem::Smb4KShareItem( const QString &workgroup, const QString &host, const QString &name, const QString &type, const QString &comment ) +: m_workgroup( workgroup ), m_host( host ), m_name( name ), m_type( type ), m_comment( comment ) +{ +} + + +Smb4KShareItem::~Smb4KShareItem() +{ +} + + +const QString Smb4KShareItem::translatedType() const +{ + QString return_string; + + if ( QString::compare( m_type, "Disk" ) == 0 ) + { + return_string = i18n( "Disk" ); + } + else if ( QString::compare( m_type, "Print" ) == 0 || QString::compare( m_type, "Printer" ) == 0 ) + { + return_string = i18n( "Printer" ); + } + else + { + return_string = m_type; + } + + return return_string; +} + + +bool Smb4KShareItem::isHidden() const +{ + return m_name.stripWhiteSpace().endsWith( "$" ); +} + + +bool Smb4KShareItem::isPrinter() const +{ + return (QString::compare( m_type, "Print" ) == 0 || QString::compare( m_type, "Printer" ) == 0); +} + + +bool Smb4KShareItem::isIPC() const +{ + return (QString::compare( m_name.stripWhiteSpace(), "IPC$" ) == 0); +} + + +bool Smb4KShareItem::isADMIN() const +{ + return (QString::compare( m_name.stripWhiteSpace(), "ADMIN$" ) == 0); +} + diff --git a/smb4k/core/smb4knetworkitems.h b/smb4k/core/smb4knetworkitems.h new file mode 100644 index 0000000..abfff2a --- /dev/null +++ b/smb4k/core/smb4knetworkitems.h @@ -0,0 +1,487 @@ +/*************************************************************************** + smb4knetworkitems - Network items used by the Smb4KScanner class + to pass and store data. + ------------------- + begin : Mi Jun 2 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KNETWORKITEMS_H +#define SMB4KNETWORKITEMS_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +/** + * This class provides a container for a workgroup/domain found in the network + * neighborhood. + */ + +class Smb4KWorkgroupItem +{ + public: + /** + * The constructor. + * + * @param name The name of the workgroup/domain. + * + * @param master The master browser of the workgroup. + * + * @param masterIP The IP address of the workgroup master browser. + */ + Smb4KWorkgroupItem( const QString &name, + const QString &master, + const QString &masterIP = QString::null ); + + /** + * Empty constructor. + */ + Smb4KWorkgroupItem() {} + + /** + * The destructor. + */ + ~Smb4KWorkgroupItem(); + + /** + * Returns the workgroup name. + */ + const QString &name() const { return m_name; } + + /** + * Returns the name of the master browser. + */ + const QString &master() const { return m_master; } + + /** + * Returns the IP address of the master browser. If it is not a valid + * IPv4 or IPv6 address, QString::null is returned. + * + * @returns the valid IP v4 or v6 address of the workgroup master browser + * or QString::null. + */ + const QString &masterIP() const { return m_ip; } + + /** + * You can mark the master as 'pseudo' with this function. That means that + * this master was not reported as being the master browser of this + * workgroup, but it's the only one found (e.g. by a custom search). + */ + void setPseudoMaster(); + + /** + * Returns TRUE, if the master is a 'pseudo' master. @see setPseudoMaster() + * for further information. + */ + bool hasPseudoMaster() const { return m_pseudo; } + + /** + * This function sets the IP address of the master browser. + * + * @param ip The IP address of the master browser + */ + void setMasterIP( const QString &ip ); + + /** + * This function sets the master browser. + * + * @param name The name of the master browser + * + * @param ip The IP address of the master browser + * + * @param pseudo Determines if this is a real master browser or if + * it is a faked one, i.e. a pseudo master. + */ + void setMaster( const QString &name, + const QString &ip, + bool pseudo = false ); + + private: + /** + * The name of the workgroup. + */ + QString m_name; + + /** + * The name of the workgroup master. + */ + QString m_master; + + /** + * The IP address of the master. + */ + QString m_ip; + + /** + * Determines whether the master is a 'pseudo'-master. + */ + bool m_pseudo; + + /** + * This function checks if the IP address is valid, i.e. the + * IP address is either IP v4 or IP v6. It returns either TRUE + * or FALSE. + * + * @param ip The IP address that's going to be checked. + * + * @returns TRUE if the IP address is valid and FALSE otherwise. + */ + bool ipIsValid( const QString &ip ); +}; + + +/** + * This class provides a container for a host found in the network + * neighborhood. + */ + +class Smb4KHostItem +{ + public: + /** + * The default constructor. + * + * @param workgroup The workgroup/domain of the host + * + * @param name The name of the host + * + * @param comment The comment that describes the host. May be empty. + * + * @param ip The IP address of the host + */ + Smb4KHostItem( const QString &workgroup, + const QString &name, + const QString &comment = QString::null, + const QString &ip = QString::null ); + + /** + * The copy constructor. + * + * @param host A Smb4KHostItem representing a host. + */ + Smb4KHostItem( const Smb4KHostItem &host ); + + /** + * The empty constructor. + */ + Smb4KHostItem() {} + + /** + * The destructor. + */ + ~Smb4KHostItem(); + + /** + * Returns the workgroup the host is in. + */ + const QString &workgroup() const { return m_workgroup; } + + /** + * Returns the name of the host. + */ + const QString &name() const { return m_name; } + + /** + * Returns the IP address of the host. + */ + const QString &ip() const { return m_ip; } + + /** + * Returns the comment for this host. + */ + const QString &comment() const { return m_comment; } + + /** + * Sets the Server string that is reported by the host. + */ + void setServerString( const QString &server ); + + /** + * Returns the Server string. + */ + const QString &serverString() const { return m_server_string; } + + /** + * Sets the OS string that is reported by the host. + */ + void setOSString( const QString &os ); + + /** + * Returns the OS string. + */ + const QString &osString() const { return m_os_string; } + + /** + * This functions determines whether this host should be + * registered as a master browser. + * + * @param master Set this to TRUE if the host is a master browser. + */ + void setMaster( bool master ); + + /** + * This function tells you if the host is a master or not. + * + * @returns TRUE if the host is a master browser. + */ + const bool isMaster() const { return m_master; } + + /** + * This function sets the IP address of a host. + * + * @param ip The IP address of a host + */ + void setIPAddress( const QString &ip ); + + /** + * This function sets the command for a host. + * + * @param comment The comment + */ + void setComment( const QString &comment ); + + /** + * This function is used to tell the host item, if a + * check for the IP address has already been performed. + * + * @param yes Should be set to TRUE if a check was performed. + */ + void setIPAddressChecked( bool yes ); + + /** + * Tells if a check for the IP address has already been performed. + * + * @returns TRUE if a check was performed, and FALSE otherwise. + */ + const bool ipAddressChecked() const { return m_ip_checked; } + + /** + * This function is used to tell the host item, if a + * check for the information (OS and Server string ) has already been performed. + * + * @param yes Should be set to TRUE if a check was performed. + */ + void setInfoChecked( bool yes ); + + /** + * Tells if a check for the information (OS and Server string) has already + * been performed. + * + * @returns TRUE is the check was performed previously. + */ + const bool infoChecked() const { return m_info_checked; } + + private: + /** + * The name of the workgroup. + */ + QString m_workgroup; + + /** + * The name of the host. + */ + QString m_name; + + /** + * The comment for this host. + */ + QString m_comment; + + /** + * The IP address of the host. + */ + QString m_ip; + + /** + * The Server string as reported by the host. + */ + QString m_server_string; + + /** + * The operating system string as reported by the host. + */ + QString m_os_string; + + /** + * This boolian determines if the host is a master browser + * or not. + */ + bool m_master; + + /** + * This boolean tells if a check for the IP address was already + * performed. + */ + bool m_ip_checked; + + /** + * This boolean tells if a check for the information (OS and server string) + * was already performed. + */ + bool m_info_checked; + + /** + * This function checks if the IP address is valid, i.e. the + * IP address is either IP v4 or IP v6. It returns either TRUE + * or FALSE. + * + * @param ip The IP address that's going to be checked. + * + * @returns TRUE if the IP address is valid and FALSE otherwise. + */ + bool ipIsValid( const QString &ip ); +}; + + +/** + * This class provides a container for a share found in the + * network neighborhood. + */ + +class Smb4KShareItem +{ + public: + /** + * The constructor. + * + * @param workgroup The workgroup/domain name. + * + * @param host The name of the host where the share is located. + * + * @param name The name of the share. + * + * @param type The type of the share as returned by the Samba programs, i.e. + * "Disk", "Printer", "IPC$" or "ADMIN$". + * + * @param comment The comment of the share. + */ + Smb4KShareItem( const QString &workgroup, + const QString &host, + const QString &name, + const QString &type, + const QString &comment ); + + /** + * Empty constructor. + */ + Smb4KShareItem() {} + + /** + * The destructor. + */ + ~Smb4KShareItem(); + + /** + * Returns the workgroup of the host where the share is located. + */ + const QString &workgroup() const { return m_workgroup; } + + /** + * Returns the name of the host where the share is located. + */ + const QString &host() const { return m_host; } + + /** + * Returns the name of the share. + */ + const QString &name() const { return m_name; } + + /** + * Returns the type of the share. + */ + const QString &plainType() const { return m_type; } + + /** + * Returns a translated version of the type of the share. + * + * @returns The translated share type + */ + const QString translatedType() const; + + /** + * Returns the comment for this share. + */ + const QString &comment() const { return m_comment; } + + /** + * This function tells if the share is a hidden one. + * + * @returns TRUE is the share is a hidden one and FALSE otherwise. + */ + bool isHidden() const; + + /** + * This function is TRUE if the share is a printer and + * FALSE otherwise. + * + * @returns TRUE if the share is a printer + */ + bool isPrinter() const; + + /** + * This function returns TRUE if the share is an IPC$ + * share and FALSE otherwise. + * + * @returns TRUE if the share is an IPC$ share + */ + bool isIPC() const; + + /** + * This function returns TRUE if the share is an ADMIN$ + * share and FALSE otherwise. + * + * @returns TRUE if the share is an ADMIN$ share + */ + bool isADMIN() const; + + private: + /** + * The workgroup object. + */ + QString m_workgroup; + + /** + * The host name. + */ + QString m_host; + + /** + * The name of the share. + */ + QString m_name; + + /** + * The type of the share. + */ + QString m_type; + + /** + * The comment for this share. + */ + QString m_comment; +}; + +#endif diff --git a/smb4k/core/smb4kpasswordhandler.cpp b/smb4k/core/smb4kpasswordhandler.cpp new file mode 100644 index 0000000..0eb896b --- /dev/null +++ b/smb4k/core/smb4kpasswordhandler.cpp @@ -0,0 +1,1001 @@ +/*************************************************************************** + smb4kpasswordhandler - This class handles the passwords for Smb4K. + ------------------- + begin : So Jan 16 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __FreeBSD__ +#include +#include +#include +#endif + +// application specific includes +#include "smb4kpasswordhandler.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kauthinfo.h" +#include "smb4ksettings.h" + + +#ifndef __FreeBSD__ +Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *handler, QObject *parent, const char *name ) +: QObject( parent, name ), m_handler( handler ), m_wallet_support_disabled( false ) +#else +Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *s_handler, Smb4KSambaOptionsHandler *o_handler, QObject *parent, const char *name ) +: QObject( parent, name ), m_handler( s_handler ), m_options_handler( o_handler ), + m_wallet_support_disabled( false ) +#endif +{ + if ( !m_handler ) + { + kdFatal() << "Smb4KPasswordHandler: No Smb4KHomesSharesHandler object" << endl; + } + +#ifdef __FreeBSD__ + if ( !m_options_handler ) + { + kdFatal() << "Smb4KPasswordHandler: No Smb4KSambaOptionsHandler object" << endl; + } +#endif + + m_auth = NULL; + m_dlg = NULL; + m_wallet = NULL; + m_temp_auth = NULL; +} + + +Smb4KPasswordHandler::~Smb4KPasswordHandler() +{ + for ( QValueList::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it ) + { + delete *it; + } + + m_auth_list.clear(); + + delete m_wallet; +} + + +void Smb4KPasswordHandler::open_close_wallet() +{ + if ( Smb4KSettings::useWallet() && !walletSupportIsDisabled() ) + { + if ( !walletIsOpen() ) + { + // Start the wallet manager before accessing the wallet. We + // do not care about the return value, because we do not do + // error handling here. + if ( kapp ) + { + (void) kapp->kdeinitExec( "kwalletmanager" ); + } + else + { + // Do nothing. --- Good luck! + } + + m_wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Synchronous ); + + if ( m_wallet ) + { + if ( !m_wallet->hasFolder( "Smb4K" ) ) + { + m_wallet->createFolder( "Smb4K" ); + m_wallet->setFolder( "Smb4K" ); + } + else + { + m_wallet->setFolder( "Smb4K" ); + + convert_old_entries(); + } + } + else + { + Smb4KError::error( ERROR_OPENING_WALLET_FAILED, KWallet::Wallet::NetworkWallet(), QString::null ); + + delete m_wallet; + m_wallet = NULL; + + m_wallet_support_disabled = true; + } + } + else + { + convert_old_entries(); + } + } + else + { + if ( m_wallet ) + { + delete m_wallet; + m_wallet = NULL; + } + } +} + + +void Smb4KPasswordHandler::convert_old_entries() +{ + // Convert old entries (Smb4K 0.9.2 and earlier) to the + // new map based format. + if ( !m_wallet->entryList().isEmpty() ) + { + QStringList entries = m_wallet->entryList(); + + // Since in the old format the keys contained a string like + // this: HOST:USER, we only need to test whether the first + // key contains a ":". If that's the case, we need to convert + // the entries, otherwise we don't. + if ( entries.first().contains( ":" ) != 0 ) + { + for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) + { + // Get the password. + QString pass; + m_wallet->readPassword( *it, pass ); + + if ( (*it).startsWith( "DEFAULT:" ) ) + { + // Convert the data to the new format. + QMap map; + map["Login"] = (*it).section( ":", 1, 1 ); + map["Password"] = pass; + + m_wallet->writeMap( "DEFAULT_LOGIN", map ); + } + else + { + // Convert the data to the new format. + QMap map; + map["Login"] = (*it).section( ":", 3, 3 ); + map["Password"] = pass; + + if ( QString::compare( (*it).section( ":", 0, 0 ), "*" ) != 0 ) + { + map["Workgroup"] = (*it).section( ":", 0, 0 ).upper(); + } + + if ( QString::compare( (*it).section( ":", 2, 2 ), "*" ) == 0 ) + { + m_wallet->writeMap( (*it).section( ":", 1, 1 ).upper(), map ); + } + else + { + m_wallet->writeMap( "//"+(*it).section( ":", 1, 1 ).upper()+ + "/"+(*it).section( ":", 2, 2 ).upper(), map ); + } + } + + // Delete the old entry. + m_wallet->removeEntry( *it ); + } + } + else + { + // Do nothing. + } + } + else + { + // Do nothing + } +} + + +bool Smb4KPasswordHandler::askpass( const QString &workgroup, const QString &host, const QString &share, int desc, QWidget *parent, const char *name ) +{ + // m_auth is NULL: + m_auth = readAuth( new Smb4KAuthInfo( workgroup, host, share ) ); + + // Set up the askpass dialog: + m_dlg = new KDialogBase( KDialogBase::Plain, i18n( "Authentication" ), KDialogBase::Ok|KDialogBase::Cancel, + KDialogBase::Ok, parent, name, true, true ); + + QFrame *frame = m_dlg->plainPage(); + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 5 ); + layout->setMargin( 0 ); + + QLabel *pixmap_label = new QLabel( frame ); + pixmap_label->setPixmap( DesktopIcon( "identity" ) ); + pixmap_label->adjustSize(); + + layout->addWidget( pixmap_label, 0, 0, Qt::AlignCenter ); + + QString message; + + switch ( desc ) + { + case NewData: + break; + case AccessDenied: + message = i18n( "The access was denied. " ); + break; + case BadPassword: + message = i18n( "The password is not correct. " ); + break; + case PermDenied: + message = i18n( "The permission was denied. " ); + break; + case AuthError: + message = i18n( "An authentication error occurred. " ); + break; + case LogonFailure: + message = i18n( "The logon failed. " ); + break; + default: + break; + } + + if ( m_auth->share().stripWhiteSpace().isEmpty() ) + { + message.append( i18n( "Please enter authentication data for server %1." ).arg( m_auth->host() ) ); + } + else + { + message.append( i18n( "Please enter authentication data for share %1." ).arg( "//"+m_auth->host()+"/"+m_auth->share() ) ); + } + + QLabel *message_label = new QLabel( frame ); + message_label->setText( message.stripWhiteSpace() ); + message_label->setTextFormat( Qt::RichText ); + + layout->addWidget( message_label, 0, 1, 0 ); + + QLabel *user_label = new QLabel( i18n( "User:" ), frame ); + layout->addWidget( user_label, 1, 0, 0 ); + + KLineEdit *user_edit = NULL; + KComboBox *user_combo = NULL; + + if ( QString::compare( m_auth->share(), "homes" ) != 0 ) + { + user_edit = new KLineEdit( frame, "AskPassUserEdit" ); + user_edit->setMinimumWidth( 200 ); + layout->addWidget( user_edit, 1, 1, 0 ); + } + else + { + user_combo = new KComboBox( frame, "AskPassUserCombo" ); + user_combo->setEditable( true ); + user_combo->setMinimumWidth( 200 ); + layout->addWidget( user_combo, 1, 1, 0 ); + } + + QLabel *password_label = new QLabel( i18n( "Password:" ), frame ); + layout->addWidget( password_label, 2, 0, 0 ); + + KLineEdit *pass_edit = new KLineEdit( frame, "AskPassPasswordEdit" ); + pass_edit->setEchoMode( KLineEdit::Password ); + layout->addWidget( pass_edit, 2, 1, 0 ); + + m_dlg->setMainWidget( frame ); + m_dlg->setFixedSize( 350, m_dlg->sizeHint().height() ); + m_dlg->enableButtonOK( false ); + + // Since we have to allow empty passwords, we will only connect + // the edit line for the user to enable/disable the OK button. + if ( user_edit ) + { + connect( user_edit, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotEnableOKButton( const QString& ) ) ); + } + else + { + connect( user_combo, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotEnableOKButton( const QString& ) ) ); + } + + // Process the authentication data: + + if ( QString::compare( share, "homes" ) != 0 ) + { + user_edit->setText( m_auth->user() ); + pass_edit->setText( m_auth->password() ); + + if ( m_auth->user().isEmpty() ) + { + user_edit->setFocus(); + } + else + { + pass_edit->setFocus(); + } + } + else + { + QStringList list = m_handler->homesUsers( host ); + + user_combo->insertStringList( list ); + user_combo->setCurrentText( QString::null ); + + connect( user_combo, SIGNAL( activated( const QString & ) ), + this, SLOT( slotGetPassword( const QString & ) ) ); + + user_combo->setFocus(); + } + + bool ok = false; + + if ( m_dlg->exec() == KDialogBase::Accepted ) + { + if ( QString::compare( share, "homes" ) != 0 ) + { + QString user = user_edit->text(); + QString pass = pass_edit->text(); + + m_auth->setUser( user ); + m_auth->setPassword( pass ); + + writeAuth( m_auth ); + } + else + { + QString user = user_combo->currentText(); + QString pass = pass_edit->text(); + + m_auth->setUser( user ); + m_auth->setPassword( pass ); + + writeAuth( m_auth ); + } + + ok = true; + } + + // Clean up: + + delete m_dlg; + m_dlg = NULL; + + delete m_auth; + m_auth = NULL; + + return ok; +} + + +Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo ) +{ + // Do nothing, if authInfo is NULL: + if ( !authInfo ) + { + return authInfo; + } + + open_close_wallet(); + + if ( walletIsOpen() ) + { + // Get the authentication information from the wallet. + // Always prefer either the exact match or the information + // that was provided for the host. + QMap map; + + if ( !authInfo->share().isEmpty() ) + { + m_wallet->readMap( "//"+authInfo->host().upper()+"/"+authInfo->share().upper(), map ); + + if ( map.isEmpty() ) + { + m_wallet->readMap( authInfo->host().upper(), map ); + + if ( map.isEmpty() ) + { + if ( Smb4KSettings::useDefaultLogin() ) + { + m_wallet->readMap( "DEFAULT_LOGIN", map ); + + if ( map.isEmpty() ) + { + return authInfo; + } + else + { + // We have authentication information. + // So, do nothing here. + } + } + else + { + return authInfo; + } + } + else + { + // Check that the workgroup is correct. + if ( map.contains( "Workgroup" ) && !authInfo->workgroup().isEmpty() ) + { + if ( QString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 ) + { + return authInfo; + } + else + { + // Everything is OK. Do nothing. + } + } + else + { + // We cannot check if the workgroup is OK. So, just return + // the authentication information we just collected. If it + // should be wrong, the user will be asked to provide the + // correct data anyway. + } + } + } + else + { + // Check that the workgroup is correct. + if ( map.contains( "Workgroup" ) && !authInfo->workgroup().isEmpty() ) + { + if ( QString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 ) + { + return authInfo; + } + else + { + // Everything is OK. Do nothing. + } + } + else + { + // We cannot check if the workgroup is OK. So, just process + // the authentication information we just collected. If it + // should be wrong, the user will be asked to provide the + // correct data anyway. + } + } + } + else + { + m_wallet->readMap( authInfo->host().upper(), map ); + + if ( map.isEmpty() ) + { + if ( Smb4KSettings::useDefaultLogin() ) + { + m_wallet->readMap( "DEFAULT_LOGIN", map ); + + if ( map.isEmpty() ) + { + return authInfo; + } + } + else + { + return authInfo; + } + } + else + { + // Check that the workgroup is correct. + if ( map.contains( "Workgroup" ) && !authInfo->workgroup().isEmpty() ) + { + if ( QString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 ) + { + return authInfo; + } + else + { + // Everything is OK. Do nothing. + } + } + else + { + // We cannot check if the workgroup is OK. So, just process + // the authentication information we just collected. If it + // should be wrong, the user will be asked to provide the + // correct data anyway. + } + } + } + + // We have authentication information. Put the data into the + // Smb4KAuthInfo object. + authInfo->setUser( map["Login"] ); + authInfo->setPassword( map["Password"] ); + } + else + { + // Either the opening of the wallet failed or the user does + // not want to use a wallet. + // Let's see if we can get the authentication information from + // the temporary list. + if ( Smb4KSettings::rememberPasswords() ) + { + if ( !m_auth_list.isEmpty() ) + { + for ( QValueList::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it ) + { + if ( !authInfo->share().isEmpty() ) + { + if ( QString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 && + QString::compare( authInfo->share().upper(), (*it)->share().upper() ) == 0 ) + { + if ( QString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 || + (*it)->workgroup().isEmpty() ) + { + // Either the workgroup is OK, or we cannot check if it is OK. + // In both cases we process the data at hand. + authInfo->setUser( (*it)->user() ); + authInfo->setPassword( (*it)->password() ); + + // Exact match. Stop here. + break; + } + else + { + continue; + } + } + else if ( QString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 ) + { + if ( QString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 || + (*it)->workgroup().isEmpty() ) + { + // Either the workgroup is OK, or we cannot check if it is OK. + // In both cases we process the data at hand. + authInfo->setUser( (*it)->user() ); + authInfo->setPassword( (*it)->password() ); + + // Because we always prefer the exact match, we keep + // on searching. + continue; + } + else + { + continue; + } + } + else + { + continue; + } + } + else + { + if ( QString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 ) + { + if ( QString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 || + (*it)->workgroup().isEmpty() ) + { + // Either the workgroup is OK, or we cannot check if it is OK. + // In both cases we process the data at hand. + authInfo->setUser( (*it)->user() ); + authInfo->setPassword( (*it)->password() ); + + break; + } + else + { + continue; + } + } + else + { + continue; + } + } + } + } + else + { + // Do nothing + } + } + else + { + if ( m_temp_auth ) + { + authInfo->setUser( m_temp_auth->user() ); + authInfo->setPassword( m_temp_auth->password() ); + + delete m_temp_auth; + m_temp_auth = NULL; + } + } + } + +#ifdef __FreeBSD__ + + writeToSMBConfFile( authInfo ); + +#endif + + return authInfo; +} + + +void Smb4KPasswordHandler::writeAuth( Smb4KAuthInfo *authInfo ) +{ + open_close_wallet(); + + if ( walletIsOpen() ) + { + QMap map; + map["Login"] = authInfo->user(); + map["Password"] = authInfo->password(); + + if ( !authInfo->workgroup().isEmpty() ) + { + map["Workgroup"] = authInfo->workgroup().upper(); + } + + if ( !authInfo->share().isEmpty() ) + { + m_wallet->writeMap( "//"+authInfo->host().upper()+"/"+authInfo->share().upper(), map ); + } + else + { + m_wallet->writeMap( authInfo->host().upper(), map ); + } + + m_wallet->sync(); + } + else + { + if ( Smb4KSettings::rememberPasswords() ) + { + Smb4KAuthInfo *tmp = NULL; + + for ( QValueList::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it ) + { + if ( ((*it)->workgroup().isEmpty() || + QString::compare( (*it)->workgroup().upper(), authInfo->workgroup().upper() ) == 0) && + QString::compare( (*it)->host().upper(), authInfo->host().upper() ) == 0 && + QString::compare( (*it)->host().upper(), authInfo->share().upper() ) == 0 ) + { + tmp = *it; + + break; + } + else + { + continue; + } + } + + if ( tmp ) + { + delete tmp; + } + + m_auth_list.append( new Smb4KAuthInfo( *authInfo ) ); + } + else + { + if ( !m_temp_auth ) + { + m_temp_auth = new Smb4KAuthInfo( *authInfo ); + } + } + } + +#ifdef __FreeBSD__ + + writeToSMBConfFile( authInfo ); + +#endif +} + + +Smb4KAuthInfo *Smb4KPasswordHandler::readDefaultAuth( Smb4KAuthInfo *authInfo ) +{ + if ( !authInfo ) + { + return authInfo; + } + + open_close_wallet(); + + if ( walletIsOpen() ) + { + // Read the default authentication information. + QMap map; + + m_wallet->readMap( "DEFAULT_LOGIN", map ); + + if ( !map.isEmpty() ) + { + authInfo->setUser( map["Login"] ); + authInfo->setPassword( map["Password"] ); + } + else + { + // Do nothing + } + } + else + { + // Nothing to do. + } + + return authInfo; +} + + +void Smb4KPasswordHandler::writeDefaultAuth( Smb4KAuthInfo *authInfo ) +{ + open_close_wallet(); + + if ( walletIsOpen() ) + { + QMap map; + map["Login"] = authInfo->user(); + map["Password"] = authInfo->password(); + + m_wallet->writeMap( "DEFAULT_LOGIN", map ); + m_wallet->sync(); + } +} + + +#ifdef __FreeBSD__ + +void Smb4KPasswordHandler::writeToSMBConfFile( Smb4KAuthInfo *authInfo ) +{ + m_nsmbrc_auth = *authInfo; + + KProcess *p = new KProcess(); + p->setUseShell( true ); + + connect( p, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivePassword( KProcess *, char *, int ) ) ); + connect( p, SIGNAL( processExited( KProcess * ) ), + this, SLOT( slotWritePassword( KProcess * ) ) ); + + *p << QString( "smbutil crypt %1" ).arg( m_nsmbrc_auth.password() ); + + p->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + +#endif + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + + +void Smb4KPasswordHandler::slotGetPassword( const QString &username ) +{ + if ( m_dlg && m_auth ) + { + // We need to re-read the auth data here, because + // of the homes shares: + Smb4KAuthInfo *auth = readAuth( new Smb4KAuthInfo( m_auth->workgroup().upper(), m_auth->host().upper(), username ) ); + + KLineEdit *lineEdit = static_cast( m_dlg->child( "AskPassPasswordEdit", "KLineEdit", true ) ); + lineEdit->setText( auth->password() ); + + delete auth; + + m_auth->setShare( username ); + } +} + + +void Smb4KPasswordHandler::slotEnableOKButton( const QString &text ) +{ + if ( m_dlg ) + { + m_dlg->enableButtonOK( !text.isEmpty() ); + } +} + +#ifdef __FreeBSD__ +void Smb4KPasswordHandler::slotReceivePassword( KProcess *, char *buffer, int buflen ) +{ + m_buffer.append( QString::fromLocal8Bit( buffer, buflen ) ); +#else +void Smb4KPasswordHandler::slotReceivePassword( KProcess *, char *, int ) +{ +#endif +} + + +void Smb4KPasswordHandler::slotWritePassword( KProcess *proc ) +{ + + delete proc; + +#ifdef __FreeBSD__ + + QString pass = m_buffer.remove( "\n" ).stripWhiteSpace(); + m_buffer = QString::null; + + QDir::setCurrent( QDir::homeDirPath() ); + + QFile file( ".nsmbrc" ); + + QStringList contents; + + if ( file.exists() ) + { + if ( file.open( IO_ReadOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + while ( !ts.atEnd() ) + { + contents.append( ts.readLine().stripWhiteSpace() ); + } + + file.close(); + } + } + + // Check if the [default] section is present. + if ( contents.find( "[default]" ) == contents.end() && + contents.find( "[DEFAULT]" ) == contents.end() ) + { + QMap map = m_options_handler->globalSambaOptions(); + QString workgroup = map["workgroup"]; + QString wins = m_options_handler->winsServer(); + + QStringList::Iterator it = contents.prepend( "[default]" ); + it++; + + if ( !workgroup.isEmpty() ) + { + it = contents.insert( it, "workgroup="+workgroup ); + } + + if ( !wins.isEmpty() ) + { + it = contents.insert( it, "nbns="+wins ); + } + + // FIXME: Should we write the charsets here, too?? + } + + QString section; + + if ( m_nsmbrc_auth.share().isEmpty() ) + { + section.append( QString( "[%1:%2]" ).arg( m_nsmbrc_auth.host().upper(), m_nsmbrc_auth.user().isEmpty() ? "GUEST" : m_nsmbrc_auth.user().upper() ) ); + } + else + { + section.append( QString( "[%1:%2:%3]" ).arg( m_nsmbrc_auth.host().upper(), m_nsmbrc_auth.user().isEmpty() ? "GUEST" : m_nsmbrc_auth.user().upper(), m_nsmbrc_auth.share().upper() ) ); + } + + QStringList::Iterator it = contents.find( section ); + + if ( it == contents.end() ) + { + if ( contents.last() != QString::null ) + { + contents.append( QString::null ); + } + + contents.append( section ); + contents.append( "password="+pass ); + + if ( !m_nsmbrc_auth.workgroup().isEmpty() ) + { + contents.append( "workgroup="+m_nsmbrc_auth.workgroup() ); + } + } + else + { + for ( QStringList::Iterator i = ++it; i != contents.end(); ++i ) + { + if ( (*i).contains( "password=" ) ) + { + QString old_pass = (*i).section( "password=", 1, 1 ).stripWhiteSpace(); + + if ( QString::compare( pass, old_pass ) == 0 ) + { + // The passwords are identical, so stop here. + return; + } + else + { + *i = "password="+pass; + break; + } + } + else if ( (*i).startsWith( "[" ) ) + { + break; + } + else + { + continue; + } + } + } + + QDir::setCurrent( QDir::homeDirPath() ); + + if ( file.open( IO_WriteOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it ) + { + ts << *it << endl; + } + + file.close(); + } + else + { + Smb4KError::error( ERROR_WRITING_FILE, "~/.nsmbrc", QString::null ); + + return; + } + + // Get minimal security: Fix permissions. + QString path = QDir::homeDirPath()+"/"+file.name(); + + int fd; + + if ( (fd = open( path.ascii(), O_WRONLY )) == -1 ) + { + int err_no = errno; + Smb4KError::error( ERROR_OPENING_FILE, path, strerror( err_no ) ); + + return; + } + else + { + if ( fchmod( fd, 00600 ) == -1 ) + { + // FIXME: Do we need to emit an error here at all? + } + } +#endif +} + +#include "smb4kpasswordhandler.moc" diff --git a/smb4k/core/smb4kpasswordhandler.h b/smb4k/core/smb4kpasswordhandler.h new file mode 100644 index 0000000..513f399 --- /dev/null +++ b/smb4k/core/smb4kpasswordhandler.h @@ -0,0 +1,305 @@ +/*************************************************************************** + smb4kpasswordhandler - This class handles the passwords for Smb4K. + ------------------- + begin : So Jan 16 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPASSWORDHANDLER_H +#define SMB4KPASSWORDHANDLER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include + +// forward declarations +#ifndef __FreeBSD__ +class Smb4KAuthInfo; +#endif + +// application specific includes +#include "smb4khomesshareshandler.h" +#ifdef __FreeBSD__ +#include "smb4ksambaoptionshandler.h" +#include "smb4kauthinfo.h" +#endif + + + +/** + * This class handles the passwords used by Smb4K to authenticate to + * the network shares. + * + * @author Alexander Reinholdt + */ + +class Smb4KPasswordHandler : public QObject +{ + Q_OBJECT + + public: +#ifndef __FreeBSD__ + /** + * The constructor. + * + * @param config The KConfig object that should be used + * + * @param handler The Smb4KHomesSharesHandler object that is needed to retrieve + * infos in case we need to look up authentication information for + * 'homes' shares. + * + * @param parent The parent object. + * + * @param name The name this class should carry. + */ + Smb4KPasswordHandler( Smb4KHomesSharesHandler *handler, + QObject *parent = 0, + const char *name = 0 ); +#else + /** + * The constructor (FreeBSD). + * + * @param s_handler The Smb4KHomesSharesHandler object that is needed to retrieve + * infos in case we need to look up authentication information for + * 'homes' shares. + * + * @param o_handler The Smb4KSambaOptionsHandler object. It is needed to write the + * ~/.nsmbrc file correctly. + * + * @param parent The parent object. + * + * @param name The name this class should carry. + */ + Smb4KPasswordHandler( Smb4KHomesSharesHandler *s_handler, + Smb4KSambaOptionsHandler *o_handler, + QObject *parent = 0, + const char *name = 0 ); +#endif + + /** + * The destructor. + */ + ~Smb4KPasswordHandler(); + + /** + * Opens the askpass dialog. + * + * @param workgroup The workgroup where the share is located in (may be empty). + * + * @param host The host the share belongs to. + * + * @param name The name of the share. + * + * @param desc Determines which descriptive label the askpass dialog should carry. + * Values are taken from the Smb4KPasswordHandler::AskPass::Description + * enumeration. + * + * @param parent The parent of this dialog. + * + * @param name The name of this dialog. + * + * @returns TRUE if a new password has been supplied and FALSE otherwise. + */ + bool askpass( const QString &workgroup, const QString &host, const QString &share, int desc, QWidget *parent = 0, const char *name = 0 ); + + /** + * Returns the authentication data that was found for the defined share. You need to + * provide the workgroup, host name, and share name with @p authInfo. + * + * @param authInfo The authentication information object. + * + * @returns a pointer to @p authInfo. This may be NULL if @p authInfo was + * also NULL. + */ + Smb4KAuthInfo *readAuth( Smb4KAuthInfo *authInfo ); + + /** + * Write the provided authentication data to the wallet. + * + * @param authInfo The Smb4KAuthInfo object that holds the authentication information. + */ + void writeAuth( Smb4KAuthInfo *authInfo ); + + /** + * Read the default authentication from the wallet. + * + * @param authInfo The authentication information object. + * + * @returns pointer to the authentication data object if a wallet is used or NULL otherwise + */ + Smb4KAuthInfo *readDefaultAuth( Smb4KAuthInfo *authInfo ); + + /** + * Writes the default authentication data to the wallet. This function seems only to + * be useful for the configuration dialog. + * + * @param authInfo The authentication data for the default login if a wallet is + * used or NULL otherwise. + */ + void writeDefaultAuth( Smb4KAuthInfo *authInfo ); + + /** + * This enumeration destermines which destriptive label the askpass + * dialog should carry. + */ + enum Description{ NewData, AccessDenied, BadPassword, PermDenied, AuthError, LogonFailure, None }; + + /** + * This function returns TRUE if the wallet it open at the moment and FALSE + * if it is closed or not used. + * + * @returns TRUE if the wallet is open. + */ + bool walletIsOpen() { return (m_wallet && m_wallet->isOpen()); } + + /** + * This function returns TRUE if the digital wallet support has been + * disabled. This happens when the wallet could not be opened. + * + * @returns TRUE if the digital wallet support has been disabled. + */ + bool walletSupportIsDisabled() { return m_wallet_support_disabled; } + + protected slots: + /** + * Get the password for a specific share and user name. + */ + void slotGetPassword( const QString &username ); + + /** + * This slot is used to enable the OK button of the askpass + * dialog when text has been entered in the text boxes and/or the + * combo box. + * + * @param text The text that has been entered. + */ + void slotEnableOKButton( const QString &text ); + + /** + * FreeBSD specific: This slot receives output from the process that encrypts + * the passwords. + * + * @param proc The process that sends the output + * + * @param buffer The buffer that contains the output + * + * @param buflen The length of the buffer + */ + void slotReceivePassword( KProcess *proc, char *buffer, int buflen ); + + /** + * FreeBSD specific: This slot is invoked if the process exited. + * + * @param proc The process that exited + */ + void slotWritePassword( KProcess *proc ); + + private: + /** + * This function opens the wallet in which the passwords should be + * stored. + */ + void open_close_wallet(); + + /** + * This function is used to convert old wallet entries to the new + * map based ones. + */ + void convert_old_entries(); + + /** + * The KWallet object. + */ + KWallet::Wallet *m_wallet; + + /** + * The Smb4KAuthInfo object. For use with the askpass dialog. + */ + Smb4KAuthInfo *m_auth; + + /** + * The askpass dialog. + */ + KDialogBase *m_dlg; + + /** + * This list holds the authentication data the user supplied if he/she + * does not want to use KWallet. + */ + QValueList m_auth_list; + + /** + * If the user neither wants to store the passwords in a wallet nor in a + * temporary list, the authentication data received from the askpass dialog + * will the stored in this object. + */ + Smb4KAuthInfo *m_temp_auth; + + /** + * The Smb4KHomesSharesHandler object + */ + Smb4KHomesSharesHandler *m_handler; + + /** + * Is the wallet support disabled? + */ + bool m_wallet_support_disabled; + +#ifdef __FreeBSD__ + + /** + * FreeBSD specific: This function writes authentication information + * to the ~/.nsmbrc file, which is used by mount_smbfs. + * + * @param authInfo The authentication information that should be written + * to ~/.nsmbrc file. + */ + void writeToSMBConfFile( Smb4KAuthInfo *authInfo ); + + /** + * FreeBSD specific: Holds the authentication information that should + * be written to ~/.nsmbrc. + */ + Smb4KAuthInfo m_nsmbrc_auth; + + /** + * The buffer for the process that encrypts the password. + */ + QString m_buffer; + + /** + * The Smb4KSambaOptionsHandler object. + */ + Smb4KSambaOptionsHandler *m_options_handler; + +#endif +}; + +#endif diff --git a/smb4k/core/smb4kpreviewer.cpp b/smb4k/core/smb4kpreviewer.cpp new file mode 100644 index 0000000..2d3c850 --- /dev/null +++ b/smb4k/core/smb4kpreviewer.cpp @@ -0,0 +1,361 @@ +/*************************************************************************** + smb4kpreviewer - This class queries a remote share for a preview + ------------------- + begin : Mo Mai 28 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4kpreviewer.h" +#include "smb4kpreviewitem.h" +#include "smb4kdefs.h" +#include "smb4kglobal.h" +#include "smb4kpasswordhandler.h" +#include "smb4kauthinfo.h" +#include "smb4ksambaoptionshandler.h" +#include "smb4kerror.h" + +using namespace Smb4KGlobal; + + +Smb4KPreviewer::Smb4KPreviewer( QObject *parent, const char *name ) +: QObject( parent, name ) +{ + m_item = NULL; + + m_buffer = QString::null; + + m_working = false; + + m_proc = new KProcess( this, "PreviewProcess" ); + m_proc->setUseShell( true ); + + connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( processExited( KProcess* ) ), + this, SLOT( slotProcessExited( KProcess * ) ) ); + + connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); +} + + +Smb4KPreviewer::~Smb4KPreviewer() +{ + // Do not delete m_item here, because it belongs to an + // outside class. +} + + +bool Smb4KPreviewer::preview( Smb4KPreviewItem *item ) +{ + // If there is no item, stop right here. + if ( !item ) + { + return false; + } + + if ( QString::compare( item->share(), "homes" ) == 0 ) + { + QString share_name = specifyUser( item->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" ); + + if ( !share_name.isEmpty() ) + { + // The Smb4KPreviewItem::setShare() function will take care + // that no share name is overwritten, that is *not* named + // 'homes'. + item->setShare( share_name ); + } + else + { + return false; + } + } + + m_timer_id = startTimer( TIMER_INTERVAL ); + + m_queue.enqueue( item ); + + return true; +} + + +void Smb4KPreviewer::abort() +{ + m_queue.clear(); + + if ( m_proc->isRunning() ) + { + m_proc->kill(); + } +} + + +void Smb4KPreviewer::timerEvent( QTimerEvent * ) +{ + if ( m_working ) + { + return; + } + + // Declare the previewer working: + emit state( PREVIEWER_START ); + + m_working = true; + + m_item = m_queue.dequeue(); + + // Assemble the command. + // + // Here are some things to remember: + // (a) Do not convert the path to local 8 bit. It won't work with umlauts or other + // special characters. + // (b) Do not pass the path unquoted, or you'll get a NT_STATUS_OBJECT_NAME_NOT_FOUND + // error message in the case the path is empty. + QString command; + command.append( QString( "smbclient //%1/%2 " ).arg( KProcess::quote( m_item->host() ), KProcess::quote( m_item->share() ) ) ); + command.append( QString( " -d1 -W %1 -D %2 " ).arg( KProcess::quote( m_item->workgroup() ), KProcess::quote( m_item->path() ) ) ); + command.append( " -c \"ls\" " ); + + if ( !m_item->ip().isEmpty() ) + { + command.append( QString( " -I %1 " ).arg( m_item->ip() ) ); + } + + command.append( optionsHandler()->smbclientOptions( "//"+m_item->host()+"/"+m_item->share() ) ); + + Smb4KAuthInfo *auth = passwordHandler()->readAuth( new Smb4KAuthInfo( m_item->workgroup(), m_item->host(), m_item->share() ) ); + + if ( !auth->user().isEmpty() ) + { + command.append( QString( " -U %1" ).arg( KProcess::quote( auth->user() ) ) ); + + if ( !auth->password().isEmpty() ) + { + m_proc->setEnvironment( "PASSWD", auth->password() ); + } + } + else + { + command.append( " -U guest%" ); + } + + delete auth; + + *m_proc << command; + + QApplication::setOverrideCursor( waitCursor ); + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KPreviewer::slotReceivedStdout( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KPreviewer::slotReceivedStderr( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KPreviewer::slotProcessExited( KProcess * ) +{ + // Disconnect the timer: + if ( m_queue.isEmpty() ) + { + killTimer( m_timer_id ); + } + + m_proc->clearArguments(); + + QStringList list = QStringList::split( "\n", m_buffer, false ); + + m_buffer = QString::null; + + // Check whether an error occurred: + if ( list.grep( "NT_STATUS" ).count() != 0 ) + { + // Something went wrong. Let's check if this "only" an + // authentication issue or if we have to error out: + + QString error_code = list.grep( "NT_STATUS" ).first().stripWhiteSpace().section( " ", 0, 0 ); + + // The error output of smbclient is a little bit inconsistent: + if ( error_code.contains( "NT_STATUS" ) == 0 ) + { + error_code = list.grep( "NT_STATUS" ).first().stripWhiteSpace().section( " ", -1, -1 ); + } + + // Authentication issue? + if ( QString::compare( error_code, "NT_STATUS_ACCESS_DENIED" ) == 0 || + QString::compare( error_code, "NT_STATUS_LOGON_FAILURE" ) == 0 ) + { + int state = Smb4KPasswordHandler::None; + + if ( QString::compare( error_code, "NT_STATUS_ACCESS_DENIED" ) == 0 ) + { + state = Smb4KPasswordHandler::AccessDenied; + } + else if ( QString::compare( error_code, "NT_STATUS_LOGON_FAILURE" ) == 0 ) + { + state = Smb4KPasswordHandler::LogonFailure; + } + + if ( passwordHandler()->askpass( m_item->workgroup(), m_item->host(), + m_item->share(), state, + kapp->mainWidget() ? kapp->mainWidget() : 0, + "AskPass" ) ) + { + // Now we have a password. Retry. + // NOTE: Since the item is appended to the queue, there might + // be the case, that another preview is generated before the + // retry is executed. I think, we can live with that. + preview( m_item ); + } + else + { + // The user cancelled the askpass dialog. We won't show an + // error dialog here, but will only clear the contents of + // the preview item and emit the failed() signal. + m_item->clearContents(); + + emit failed(); + } + } + else + { + // OK, error out. We cannot recover from it: + Smb4KError::error( ERROR_GETTING_PREVIEW, QString::null, m_buffer ); + + m_item->clearContents(); + + emit failed(); + } + } + else if ( list.grep( "Connection to" ).count() != 0 || + (list.grep( "Error returning browse list:" ).count() != 0 && + list.grep( "NT_STATUS" ).count() == 0) ) + { + // These are errors that we cannot work around. Error out. + Smb4KError::error( ERROR_GETTING_PREVIEW, QString::null, m_buffer ); + + m_item->clearContents(); + + emit failed(); + } + else + { + for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + { + if ( (*it).stripWhiteSpace().startsWith( "Domain" ) || + (*it).stripWhiteSpace().startsWith( "OS" ) || + (*it).stripWhiteSpace().startsWith( "Anonymous" ) ) + { + continue; + } + else if ( (*it).contains( "blocks of size" ) != 0 ) + { + continue; + } + else + { + QString tmp = (*it).stripWhiteSpace().section( " ", 0, -9 ).stripWhiteSpace(); + + QString item = tmp.section( " ", 0, -2 ).stripWhiteSpace(); + + if ( !item.isEmpty() && tmp.section( " ", -1, -1 ).contains( "D" ) != 0 ) + { + // We have a directory here. + if ( item.startsWith( "." ) && + (QString::compare( item.stripWhiteSpace(), "." ) != 0 && + QString::compare( item.stripWhiteSpace(), ".." ) != 0) ) + { + m_item->addContents( ContentsItem( Smb4KPreviewItem::HiddenDirectory, item ) ); + } + else + { + m_item->addContents( ContentsItem( Smb4KPreviewItem::Directory, item ) ); + } + + continue; + } + else if ( item.isEmpty() || tmp.section( " ", -1, -1 ).contains( "D" ) == 0 ) + { + // We have a file + if ( item.isEmpty() ) + { + if ( tmp.startsWith( "." ) ) + { + m_item->addContents( ContentsItem( Smb4KPreviewItem::HiddenFile, tmp ) ); + } + else + { + m_item->addContents( ContentsItem( Smb4KPreviewItem::File, tmp ) ); + } + } + else + { + if ( item.startsWith( "." ) ) + { + m_item->addContents( ContentsItem( Smb4KPreviewItem::HiddenFile, item ) ); + } + else + { + m_item->addContents( ContentsItem( Smb4KPreviewItem::File, item ) ); + } + } + + continue; + } + else + { + continue; + } + } + } + } + + emit result( m_item ); + + QApplication::restoreOverrideCursor(); + + m_working = false; + + emit state( PREVIEWER_STOP ); +} + +#include "smb4kpreviewer.moc" diff --git a/smb4k/core/smb4kpreviewer.h b/smb4k/core/smb4kpreviewer.h new file mode 100644 index 0000000..f946f9f --- /dev/null +++ b/smb4k/core/smb4kpreviewer.h @@ -0,0 +1,190 @@ +/*************************************************************************** + smb4kpreviewer - This class queries a remote share for a preview + ------------------- + begin : Mo Mai 28 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPREVIEWER_H +#define SMB4KPREVIEWER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// KDE includes +#include + +// forward declarations +class Smb4KPreviewItem; + +/** + * This class is part of the core of Smb4K. It queries a remote SMB share for + * a preview and returns the result. + * + * @author Alexander Reinholdt + */ + +class Smb4KPreviewer : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent object + * + * @param name The name of this object + */ + Smb4KPreviewer( QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KPreviewer(); + + /** + * Get a preview of the contents of @p item. + * + * In the case that @p item represents a 'homes' share, the user will be + * prompted for the user name with which he wants to log in and the share + * name of @p item will be set to the result. + * + * @param item The item for which a preview should be + * requested. + * + * @returns TRUE if einter the share name is not 'homes' or if it could + * successfully be set to a user name. Otherwise it returns FALSE. + */ + bool preview( Smb4KPreviewItem *item ); + + /** + * Using this function, you can find out whether the previewer is running + * at the moment. + * + * @returns TRUE if the previewer is running or FALSE otherwise. + */ + bool isRunning() { return m_working; } + + /** + * Abort any action the previewer is performing at the moment and clear + * the queue. + */ + void abort(); + + signals: + /** + * Emits the state the previewer is in + * + * @param state The state + */ + void state( int state ); + + /** + * Emits the preview after the process exited successfully. Get the contents + * of the remote share by looping through the Smb4KPreviewItem::contents() list. + * + * @param item The item for which the preview was received. + */ + void result( Smb4KPreviewItem *item ); + + /** + * This signal is emitted if an error occurred. + */ + void failed(); + + protected: + /** + * Reimplemented from QObject + */ + void timerEvent( QTimerEvent *e ); + + protected slots: + /** + * This slot receives output from stdout. + * + * @param proc The process + * + * @param buf The buffer + * + * @param len The length of the buffer + */ + void slotReceivedStdout( KProcess *proc, char *buf, int len ); + + /** + * This slot receives output from stderr. + * + * @param proc The process + * + * @param buf The buffer + * + * @param len The length of the buffer + */ + void slotReceivedStderr( KProcess *proc, char *buf, int len ); + + /** + * Is called, when the KProcess exited. + * + * @param proc The process that exited + */ + void slotProcessExited( KProcess *proc ); + + private: + /** + * The KProcess object + */ + KProcess *m_proc; + + /** + * The output buffer + */ + QString m_buffer; + + /** + * This is the pointer to the Smb4KPreviewItem that's + * processed. + */ + Smb4KPreviewItem *m_item; + + /** + * Indicates whether the previewer is running or not. + */ + bool m_working; + + /** + * This pointer queue holds the pointers to the Smb4KPreviewItem + * objects that are to be processed. + */ + QPtrQueue m_queue; + + /** + * The timer id + */ + int m_timer_id; +}; + +#endif diff --git a/smb4k/core/smb4kpreviewitem.cpp b/smb4k/core/smb4kpreviewitem.cpp new file mode 100644 index 0000000..c712a48 --- /dev/null +++ b/smb4k/core/smb4kpreviewitem.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + smb4kpreviewitem - A container for previews of a remote share + ------------------- + begin : Mo Mai 28 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include + +// application specific includes +#include "smb4kpreviewitem.h" + +Smb4KPreviewItem::Smb4KPreviewItem( Smb4KShareItem *item, const QString &ip, const QString &path ) +: m_workgroup( item->workgroup() ), m_host( item->host() ), m_share( item->name() ), m_path( path ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; + m_location = "//"+m_host+"/"+m_share+"/"+m_path; +} + + +Smb4KPreviewItem::~Smb4KPreviewItem() +{ +} + + +void Smb4KPreviewItem::setShare( const QString &share ) +{ + if ( QString::compare( m_share, "homes" ) == 0 ) + { + m_share = share; + } +} + + +void Smb4KPreviewItem::setIP( const QString &ip ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; +} + + +void Smb4KPreviewItem::setPath( const QString &path ) +{ + m_path = path; + m_location = "//"+m_host+"/"+m_share+"/"+m_path; + + clearContents(); +} + + +void Smb4KPreviewItem::addContents( const ContentsItem &item ) +{ + // Do not set the last argument to TRUE, because then + // we would be in overwrite mode. + m_contents.append( item ); +} + + +void Smb4KPreviewItem::clearContents() +{ + m_contents.clear(); +} + + +bool Smb4KPreviewItem::ipIsValid( const QString &ip ) +{ + if ( !ip.isEmpty() ) + { + KNetwork::KIpAddress ip_address = KNetwork::KIpAddress( ip ); + + if ( !ip_address.isIPv4Addr() && !ip_address.isIPv6Addr() ) + { + return false; + } + } + else + { + return false; + } + + return true; +} + diff --git a/smb4k/core/smb4kpreviewitem.h b/smb4k/core/smb4kpreviewitem.h new file mode 100644 index 0000000..d3663d5 --- /dev/null +++ b/smb4k/core/smb4kpreviewitem.h @@ -0,0 +1,216 @@ +/*************************************************************************** + smb4kpreviewitem - A container for previews of a remote share + ------------------- + begin : Mo Mai 28 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPREVIEWITEM_H +#define SMB4KPREVIEWITEM_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// application specific includes +#include "smb4knetworkitems.h" + +typedef QPair ContentsItem; + +/** + * This class provides a container for the preview of the contents of a remote + * SMB share. + * + * @author Alexander Reinholdt + */ + +class Smb4KPreviewItem +{ + public: + /** + * The default constructor. + * + * @param item The share for that a preview should be collected. + * + * @param ip The IP address of the host where the share + * is located. + * + * @param path The path for that the preview should be collected. + */ + Smb4KPreviewItem( Smb4KShareItem *item, const QString &ip = QString::null, const QString &path = QString::null ); + + /** + * The empty constructor. + */ + Smb4KPreviewItem() {} + + /** + * The destructor. + */ + ~Smb4KPreviewItem(); + + /** + * Returns the workgroup where the host is located + */ + const QString &workgroup() const { return m_workgroup; } + + /** + * Return the name of the host where the share is located. + */ + const QString &host() const { return m_host; } + + /** + * Return the name of the share that is to be previewed. + */ + const QString &share() const { return m_share; } + + /** + * With this function you can set the share name if this item + * represents a homes share. In all other cases it will do just + * nothing. + * + * @param share The new share name + */ + void setShare( const QString &share ); + + /** + * Return the path that is to be previewed. + */ + const QString &path() const { return m_path; } + + /** + * Returns the IP address of the host where the share + * is located. + */ + const QString &ip() const { return m_ip; } + + /** + * Set the IP address of the host. + * + * @param ip The IP address of the host. + */ + void setIP( const QString &ip ); + + /** + * Set the path for which the preview. + * + * @param path The path + * + * @note As soon as this function is used, the list of files and directories + * will be cleared. + */ + void setPath( const QString &path ); + + /** + * Returns the current location in the form //HOST/SHARE/PATH. + * It can be used for displaying in a preview dialog or for checks. + * + * @returns The current location + */ + const QString &location() const { return m_location; } + + /** + * This enumeration is used for the contents. It determines if + * an item is a file, a hidden file, a directory, or a hidden + * directory. + */ + enum Contents { File, HiddenFile, Directory, HiddenDirectory }; + + /** + * Returns the contents of the location. + * + * @returns a map of (hidden) files and (hidden) directories. + */ + const QValueList &contents() const { return m_contents; } + + /** + * Add a file or directory to the contents. + * + * @param item A ContentsItem object. This is a QPair + * with the integer being a value from the Contents + * enumeration and the string being the full path of + * the file or directory. + * + * @see Smb4KPreviewItem::setPath() or Smb4KPreviewItem::clearContents() for how + * the list of files and directories is cleared. + */ + void addContents( const ContentsItem &item ); + + /** + * Clears the contents. + */ + void clearContents(); + + private: + /** + * The workgroup of the host + */ + QString m_workgroup; + + /** + * The host's name + */ + QString m_host; + + /** + * The share name + */ + QString m_share; + + /** + * The IP address of the host + */ + QString m_ip; + + /** + * The path that has to be previewed. + */ + QString m_path; + + /** + * The current location + */ + QString m_location; + + /** + * This map stores the contents of the current + * location. + */ + QValueList m_contents; + + /** + * This function checks if the IP address is valid, i.e. the + * IP address is either IP v4 or IP v6. It returns either TRUE + * or FALSE. + * + * @param ip The IP address that's going to be checked. + * + * @returns TRUE if the IP address is valid and FALSE otherwise. + */ + bool ipIsValid( const QString &ip ); +}; + +#endif diff --git a/smb4k/core/smb4kprint.cpp b/smb4k/core/smb4kprint.cpp new file mode 100644 index 0000000..9567926 --- /dev/null +++ b/smb4k/core/smb4kprint.cpp @@ -0,0 +1,372 @@ +/*************************************************************************** + smb4kprint - The printing core class. + ------------------- + begin : Tue Mar 30 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include + +// system includes +#include +#include + +// application specific includes +#include "smb4kprint.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4kauthinfo.h" +#include "smb4kpasswordhandler.h" +#include "smb4kprintinfo.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + + + +Smb4KPrint::Smb4KPrint( QObject *parent, const char *name ) : QObject( parent, name ) +{ + m_proc = new KProcess( this, "PrintProcess" ); + m_proc->setUseShell( true ); + + m_info = NULL; + + m_working = false; + + connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( processExited( KProcess * ) ), + this, SLOT( slotProcessExited( KProcess * ) ) ); +} + + +Smb4KPrint::~Smb4KPrint() +{ + abort(); +} + + +/**************************************************************************** + Aborts the current process. +****************************************************************************/ + +void Smb4KPrint::abort() +{ + if ( m_proc->isRunning() ) + { + m_proc->kill(); + } +} + + +/**************************************************************************** + Start the printing. +****************************************************************************/ + +bool Smb4KPrint::print( Smb4KPrintInfo *info ) +{ + // Do nothing if we receive a NULL pointer: + if ( !info ) + { + return false; + } + + m_working = true; + m_info = info; + + // Start processing the file: + if ( QFile::exists( m_info->path() ) ) + { + // Determine the mimetype of the file: + KURL url; + url.setPath( m_info->path() ); + + KFileItem file_item = KFileItem( KFileItem::Unknown, KFileItem::Unknown, url, false ); + + if ( QString::compare( file_item.mimetype(), "application/postscript" ) == 0 || + QString::compare( file_item.mimetype(), "application/pdf" ) == 0 || + file_item.mimetype().startsWith( "image" ) ) + { + setDeviceURI(); + printNormal(); + } + else if ( QString::compare( file_item.mimetype(), "application/x-dvi" ) == 0 && + !Smb4KSettings::dvips().isEmpty() ) + { + setDeviceURI(); + printDVI(); + } + else if ( (file_item.mimetype().startsWith( "text" ) || + file_item.mimetype().startsWith( "message" ) || + QString::compare( file_item.mimetype(), "application/x-shellscript" ) == 0) && + !Smb4KSettings::enscript().isEmpty() ) + { + setDeviceURI(); + printText(); + } + else + { + Smb4KError::information( INFO_MIMETYPE_NOT_SUPPORTED, file_item.mimetype() ); + + delete m_info; + m_info = NULL; + + m_working = false; + emit state( PRINT_STOP ); + return false; + } + } + else + { + Smb4KError::error( ERROR_FILE_NOT_FOUND, m_info->path() ); + + delete m_info; + m_info = NULL; + + m_working = false; + emit state( PRINT_STOP ); + return false; + } + + return true; +} + + +/**************************************************************************** + Sets the device URI +****************************************************************************/ + +void Smb4KPrint::setDeviceURI() +{ + Smb4KAuthInfo *auth = passwordHandler()->readAuth( new Smb4KAuthInfo( m_info->workgroup(), + m_info->host(), m_info->printer() ) ); + + QString uri; + + // It seems that we must not quote the entries for the DEVICE_URI + // environment variable. Printing will fail if you do it. + + if ( !m_info->workgroup().isEmpty() ) + { + if ( !auth->user().isEmpty() ) + { + uri = QString( "smb://%1:%2@%3/%4/%5" ).arg( auth->user(), auth->password() ).arg( m_info->workgroup(), m_info->host(), m_info->printer() ); + } + else + { + uri = QString( "smb://%1/%2/%3" ).arg( m_info->workgroup(), m_info->host(), m_info->printer() ); + } + } + else + { + if ( !auth->user().isEmpty() ) + { + uri = QString( "smb://%1:%2@%3/%4" ).arg( auth->user(), auth->password() ).arg( m_info->host(), m_info->printer() ); + } + else + { + uri = QString( "smb://%1/%2" ).arg( m_info->host(), m_info->printer() ); + } + } + + m_proc->setEnvironment( "DEVICE_URI", uri ); + + delete auth; +} + + +/**************************************************************************** + Do normal printing. +****************************************************************************/ + +void Smb4KPrint::printNormal() +{ + QString command; + + command.append( "smbspool 111 "+QString( getpwuid( getuid() )->pw_name ) ); + command.append( " \"Smb4K print job\" "+QString( "%1" ).arg( m_info->copies() ) ); + command.append( " \"\" "+KProcess::quote( m_info->path() ) ); + + *m_proc << command; + + emit state( PRINT_START ); + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + + +/**************************************************************************** + Print DVI files. +****************************************************************************/ + +void Smb4KPrint::printDVI() +{ + // The temporary file. + QString temp_file = tempDir()+"/smb4k_print.ps"; + + QString command; + + // First we need the conversion: + command.append( "cd "+KProcess::quote( m_info->path().section( "/", 0, -2 ) )+" && " ); + command.append( "dvips -P pdf -o "+temp_file+" "+KProcess::quote( m_info->path().section( "/", -1, -1 ) )+" && " ); + + // The actual print command: + command.append( "smbspool 111 "+QString( getpwuid( getuid() )->pw_name ) ); + command.append( " \"Smb4K print job\" "+QString( "%1" ).arg( m_info->copies() ) ); + command.append( " \"\" "+KProcess::quote( temp_file )+" && " ); + + // Clean up: + command.append( "rm -f "+temp_file ); + + *m_proc << command; + + emit state( PRINT_START ); + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + + +/**************************************************************************** + Print text files. +****************************************************************************/ + +void Smb4KPrint::printText() +{ + // The temporary file. + QString temp_file = tempDir()+"/smb4k_print.ps"; + + QString command; + + // Conversion: + command.append( "enscript --columns=1 --no-header --ps-level=2 " ); + command.append( "-o "+KProcess::quote( temp_file )+" " ); + command.append( KProcess::quote( m_info->path() )+ " && " ); + + // The actual print command: + command.append( "smbspool 111 "+QString( getpwuid( getuid() )->pw_name ) ); + command.append( " \"Smb4K print job\" "+QString( "%1" ).arg( m_info->copies() ) ); + command.append( " \"\" "+KProcess::quote( temp_file )+" && " ); + + // Clean up: + command.append( "rm -f "+temp_file ); + + *m_proc << command; + + emit state( PRINT_START ); + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KPrint::slotReceivedStdout( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KPrint::slotReceivedStderr( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); + + if ( m_buffer.contains( "NT_STATUS" ) != 0 ) + { + abort(); + } +} + + +void Smb4KPrint::slotProcessExited( KProcess * ) +{ + bool retry = false; + + if ( m_buffer.contains( "NT_STATUS", true ) != 0 || + m_buffer.contains( "enscript", true ) != 0 || + m_buffer.contains( "dvips", true ) != 0 ) + { + if ( m_buffer.contains( "NT_STATUS_ACCESS_DENIED" ) != 0 || m_buffer.contains( "NT_STATUS_LOGON_FAILURE" ) != 0 ) + { + int state = Smb4KPasswordHandler::None; + + if ( m_buffer.contains( "NT_STATUS_ACCESS_DENIED" ) != 0 ) + { + state = Smb4KPasswordHandler::AccessDenied; + } + else if (m_buffer.contains( "NT_STATUS_LOGON_FAILURE" ) != 0 ) + { + state = Smb4KPasswordHandler::LogonFailure; + } + + if ( passwordHandler()->askpass( m_info->workgroup(), m_info->host(), m_info->printer(), state ) ) + { + retry = true; + QTimer::singleShot( 50, this, SLOT( slotRetry() ) ); + } + } + else + { + Smb4KError::error( ERROR_PRINTING, m_info->path(), m_buffer ); + + // Clean up: + QFile::remove( QString( "%1/smb4k_print.ps" ).arg( tempDir() ) ); + } + } + else + { + // Clean up: + QFile::remove( QString( "%1/smb4k_print.ps" ).arg( tempDir() ) ); + } + + m_proc->clearArguments(); + + if ( !retry ) + { + delete m_info; + m_info = NULL; + } + + m_working = false; + emit state( PRINT_STOP ); +} + + +void Smb4KPrint::slotRetry() +{ + print( m_info ); +} + + +#include "smb4kprint.moc" diff --git a/smb4k/core/smb4kprint.h b/smb4k/core/smb4kprint.h new file mode 100644 index 0000000..8a9a5cd --- /dev/null +++ b/smb4k/core/smb4kprint.h @@ -0,0 +1,170 @@ +/*************************************************************************** + smb4kprint - The printing core class. + ------------------- + begin : Tue Mar 30 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPRINT_H +#define SMB4KPRINT_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include + +// forward declarations +class Smb4KPrintInfo; + + +/** + * This is a core class. It provides the interface for printing documents over + * the network neighborhood. + * + * You shouldn't use this class directly but access it through Smb4KCore. + * + * @author Alexander Reinholdt + */ + +class Smb4KPrint : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor. + */ + Smb4KPrint( QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KPrint(); + + /** + * This function starts the printing of a file. It takes a Smb4KPrintInfo object + * and constructs the print dialog from it. The information entered there will be + * used to print the file. + * + * Note that @p info will be deleted. So do not try to use the pointer later in your + * code! + * + * @param info The Smb4KShareItem object + */ + bool print( Smb4KPrintInfo *info ); + + /** + * Aborts the print process. + */ + void abort(); + + /** + * This function returns TRUE if the printer handler is running and + * FALSE otherwise. + * + * @returns TRUE is the printer handler is running and FALSE otherwise. + */ + bool isRunning() { return m_working; } + + signals: + /** + * This signal emits the run state. + * + * @param state The so-called run state. There are several defined + * in the smb4kdefs.h header file. + */ + void state( int state ); + + protected slots: + /** + * This slot receives output at stdout. + */ + void slotReceivedStdout( KProcess *, char *buf, int len ); + + /** + * This slot receives output at stderr. + */ + void slotReceivedStderr( KProcess *, char *buf, int len ); + + /** + * This slot is called when the process exited. + */ + void slotProcessExited( KProcess * ); + + /** + * This slot is invoked if the print process should be restarted + * (i.e. because authentication data was missing, etc.). + */ + void slotRetry(); + + private: + + /** + * The KProcess object. + */ + KProcess *m_proc; + + /** + * The buffer + */ + QString m_buffer; + + /** + * This boolean is TRUE if the printer handler is running and + * FALSE otherwise. + */ + bool m_working; + + /** + * The print info object + */ + Smb4KPrintInfo *m_info; + + /** + * Sets the device URI + */ + void setDeviceURI(); + + /** + * Do normal printing. + */ + void printNormal(); + + /** + * Print DVI files. + */ + void printDVI(); + + /** + * Print text files + */ + void printText(); +}; + +#endif diff --git a/smb4k/core/smb4kprintinfo.cpp b/smb4k/core/smb4kprintinfo.cpp new file mode 100644 index 0000000..7f546c7 --- /dev/null +++ b/smb4k/core/smb4kprintinfo.cpp @@ -0,0 +1,76 @@ +/*************************************************************************** + smb4kprintinfo - description + ------------------- + begin : Mo Apr 19 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include + +// application specific includes +#include "smb4kprintinfo.h" + + +Smb4KPrintInfo::Smb4KPrintInfo( Smb4KShareItem *item, const QString &ip, const QString &path, int copies ) +: m_workgroup( item->workgroup() ), m_host( item->host() ), m_printer( item->name() ), m_path( path ), + m_copies( copies ), m_comment( item->comment() ) +{ + m_ip = ipIsValid( ip ) ? ip : QString::null; +} + + +Smb4KPrintInfo::~Smb4KPrintInfo() +{ +} + + +void Smb4KPrintInfo::setPath( const QString &path ) +{ + m_path = path; +} + + +void Smb4KPrintInfo::setCopies( int num ) +{ + m_copies = num; +} + + +bool Smb4KPrintInfo::ipIsValid( const QString &ip ) +{ + if ( !ip.isEmpty() ) + { + KNetwork::KIpAddress ip_address = KNetwork::KIpAddress( ip ); + + if ( !ip_address.isIPv4Addr() && !ip_address.isIPv6Addr() ) + { + return false; + } + } + else + { + return false; + } + + return true; +} + diff --git a/smb4k/core/smb4kprintinfo.h b/smb4k/core/smb4kprintinfo.h new file mode 100644 index 0000000..9b25c9e --- /dev/null +++ b/smb4k/core/smb4kprintinfo.h @@ -0,0 +1,147 @@ +/*************************************************************************** + smb4kprintinfo - description + ------------------- + begin : Mo Apr 19 2004 + copyright : (C) 2004 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPRINTINFO_H +#define SMB4KPRINTINFO_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// application specific includes +#include "smb4knetworkitems.h" + +/** + * This class provides a container that holds all the info + * that is needed to print a file. + */ + +class Smb4KPrintInfo +{ + public: + /** + * The constructor. + * + * @param item The Smb4KShareItem that represents the printer + * + * @param ip The IP address of the host + * + * @param filepath The path of the file to print + * + * @param copies The number of copies + */ + Smb4KPrintInfo( Smb4KShareItem *item, const QString &ip, const QString &filepath = QString::null, int copies = 1 ); + /** + * Empty constructor. + */ + Smb4KPrintInfo() {} + /** + * The destructor. + */ + ~Smb4KPrintInfo(); + /** + * Returns the path of the file. + */ + const QString &path() const { return m_path; } + /** + * Returns the host where the printer is located. + */ + const QString &host() const { return m_host; } + /** + * Returns the workgroup in which the host located. + */ + const QString &workgroup() const { return m_workgroup; } + /** + * Returns the name of the printer. + */ + const QString &printer() const { return m_printer; } + /** + * Returns the IP address of the host. + */ + const QString &ip() const { return m_ip; } + /** + * Sets the path to the file to print. + */ + void setPath( const QString &path ); + /** + * Returns the number of copies the user wants to have. + */ + int copies() const { return m_copies; } + /** + * Sets the number of copies. + */ + void setCopies( int num ); + /** + * Returns the comment. + */ + const QString &comment() const { return m_comment; } + + private: + /** + * The workgroup. + */ + QString m_workgroup; + /** + * The host. + */ + QString m_host; + /** + * The IP address. + */ + QString m_ip; + /** + * The printer name. + */ + QString m_printer; + /** + * The path to the file to print. + */ + QString m_path; + /** + * Holds the number of copies the user wants to have. + */ + int m_copies; + /** + * The comment + */ + QString m_comment; + + /** + * This function checks if the IP address is valid, i.e. the + * IP address is either IP v4 or IP v6. It returns either TRUE + * or FALSE. + * + * @param ip The IP address that's going to be checked. + * + * @returns TRUE if the IP address is valid and FALSE otherwise. + */ + bool ipIsValid( const QString &ip ); +}; + +#endif + diff --git a/smb4k/core/smb4ksambaoptionshandler.cpp b/smb4k/core/smb4ksambaoptionshandler.cpp new file mode 100644 index 0000000..e31648d --- /dev/null +++ b/smb4k/core/smb4ksambaoptionshandler.cpp @@ -0,0 +1,1559 @@ +/*************************************************************************** + smb4ksambaoptionshandler - This class handles the Samba options. + ------------------- + begin : So Mai 14 2006 + copyright : (C) 2006-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include + +// system specific includes +#include +#include +#include + +// application specific includes +#include "smb4ksambaoptionshandler.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4ksambaoptionsinfo.h" +#include "smb4kshare.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + + +Smb4KSambaOptionsHandler::Smb4KSambaOptionsHandler( QObject *parent, const char *name ) +: QObject( parent, name ) +{ + // We need the directory. + KStandardDirs *stddir = new KStandardDirs(); + QString dir = locateLocal( "data", "smb4k", KGlobal::instance() ); + + if ( !stddir->exists( dir ) ) + { + stddir->makeDir( dir ); + } + + delete stddir; + + m_wins_server = QString::null; +} + + +Smb4KSambaOptionsHandler::~Smb4KSambaOptionsHandler() +{ + for ( QValueList::Iterator it = m_list.begin(); + it != m_list.end(); ++it ) + { + delete *it; + } + + m_list.clear(); +} + + +const QValueList &Smb4KSambaOptionsHandler::customOptionsList() +{ + if ( m_list.isEmpty() ) + { + read_options(); + } + + return m_list; +} + + +void Smb4KSambaOptionsHandler::read_options() +{ + // Clear the list before filling it (again) + if ( !m_list.isEmpty() ) + { + for ( QValueList::Iterator it = m_list.begin(); + it != m_list.end(); ++it ) + { + delete *it; + } + + m_list.clear(); + } + + QFile file( locateLocal( "data", "smb4k/custom_options", KGlobal::instance() ) ); + + QStringList contents; + + if ( file.open( IO_ReadOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( '\n', ts.read(), true ); + + file.close(); + } + else + { + if ( file.exists() ) + { + Smb4KError::error( ERROR_READING_FILE, file.name() ); + } + + return; + } + + if ( !contents.isEmpty() ) + { + for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it ) + { + if ( (*it).startsWith( "[" ) ) + { + Smb4KSambaOptionsInfo *info = new Smb4KSambaOptionsInfo( (*it).section( "[", 1, -1 ).section( "]", -2, 0 ) ); + + for ( QStringList::ConstIterator i = ++it; i != contents.end(); ++i ) + { + if ( (*i).startsWith( "remount=" ) ) + { + bool remount = QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 ? true : false; + + info->setRemount( remount ); + + continue; + } + else if ( (*i).startsWith( "port=" ) ) + { + int port = (*i).section( "=", 1, 1 ).stripWhiteSpace().toInt(); + + info->setPort( port ); + + continue; + } +#ifndef __FreeBSD__ + else if ( (*i).startsWith( "filesystem=" ) ) + { + info->setFilesystem( (*i).section( "=", 1, 1 ).stripWhiteSpace() ); + + continue; + } + else if ( (*i).startsWith( "read-write=" ) ) // Deprecated since version 0.9.0 + { + info->setWriteAccess( QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 ); + + continue; + } + else if ( (*i).startsWith( "write access=" ) ) + { + info->setWriteAccess( QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 ); + + continue; + } +#endif + else if ( (*i).startsWith( "protocol=" ) ) + { + info->setProtocol( (*i).section( "=", 1, 1 ).stripWhiteSpace() ); + + continue; + } + else if ( (*i).startsWith( "kerberos=" ) ) + { + info->setKerberos( QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 ); + + continue; + } + else if ( (*i).startsWith( "uid=" ) ) + { + info->setUID( (*i).section( "=", 1, 1 ).stripWhiteSpace() ); + + continue; + } + else if ( (*i).startsWith( "gid=" ) ) + { + info->setGID( (*i).section( "=", 1, 1 ).stripWhiteSpace() ); + + continue; + } + else if ( (*i).isEmpty() || (*i).stripWhiteSpace().startsWith( "[" ) ) + { + it = i; + + break; + } + else + { + continue; + } + } + + m_list.append( info ); + } + else + { + continue; + } + } + } +} + + +void Smb4KSambaOptionsHandler::write_options() +{ + QString protocol_hint; + + // Determine the protocol hint specified by the user: + switch ( Smb4KSettings::protocolHint() ) + { + case Smb4KSettings::EnumProtocolHint::Automatic: + { + // In this case the user leaves it to the net + // command to determine the right protocol. + protocol_hint = QString::null; + + break; + } + case Smb4KSettings::EnumProtocolHint::RPC: + { + protocol_hint = "rpc"; + + break; + } + case Smb4KSettings::EnumProtocolHint::RAP: + { + protocol_hint = "rap"; + + break; + } + case Smb4KSettings::EnumProtocolHint::ADS: + { + protocol_hint = "ads"; + + break; + } + default: + { + protocol_hint = QString::null; + + break; + } + } + +#ifndef __FreeBSD__ + + QString default_filesystem; + + switch( Smb4KSettings::filesystem() ) + { + case Smb4KSettings::EnumFilesystem::CIFS: + { + default_filesystem = "cifs"; + + break; + } + case Smb4KSettings::EnumFilesystem::SMBFS: + { + default_filesystem = "smbfs"; + + break; + } + default: + { + // FIXME: Set default_filesystem to "cifs"? + break; + } + } + + bool write_access = true; + + switch( Smb4KSettings::writeAccess() ) + { + case Smb4KSettings::EnumWriteAccess::ReadWrite: + { + write_access = true; + + break; + } + case Smb4KSettings::EnumWriteAccess::ReadOnly: + { + write_access = false; + + break; + } + default: + { + break; + } + } + +#endif + + QFile file( locateLocal( "data", "smb4k/custom_options", KGlobal::instance() ) ); + + if ( !m_list.isEmpty() ) + { + if ( file.open( IO_WriteOnly ) ) + { + QTextStream ts( &file ); + ts.setEncoding( QTextStream::Locale ); + + for ( QValueList::ConstIterator it = m_list.begin(); it != m_list.end(); ++it ) + { + switch ( (*it)->type() ) + { + case Smb4KSambaOptionsInfo::Host: + { + // Check if we need to write anything: + if ( (*it)->port() != -1 || + !(*it)->protocol().stripWhiteSpace().isEmpty() || + ((*it)->kerberos() != Smb4KSettings::useKerberos()) ) + { + ts << "[" << (*it)->itemName() << "]" << endl; + + ts << "port=" << ((*it)->port() != -1 ? (*it)->port() : + Smb4KSettings::remotePort()) << endl; + + ts << "kerberos=" << ((*it)->kerberos() ? "true" : "false") << endl; + + ts << "protocol=" << (!(*it)->protocol().stripWhiteSpace().isEmpty() ? + (*it)->protocol() : protocol_hint) << endl; + } + else + { + // Do nothing + } + + break; + } + case Smb4KSambaOptionsInfo::Share: + { + if ( (*it)->port() != -1 || + (*it)->remount() || +#ifndef __FreeBSD__ + (*it)->kerberos() != Smb4KSettings::useKerberos() || + !(*it)->filesystem().isEmpty() || + (*it)->writeAccess() != write_access || +#endif + !(*it)->uid().isEmpty() || + !(*it)->gid().isEmpty() ) + { + ts << "[" << (*it)->itemName() << "]" << endl; + + ts << "port=" << ((*it)->port() != -1 ? (*it)->port() : + Smb4KSettings::remotePort()) << endl; + + ts << "remount=" << ((*it)->remount() ? "true" : "false") << endl; +#ifndef __FreeBSD__ + // FreeBSD does not know Kerberos for mounting: + ts << "kerberos=" << ((*it)->kerberos() ? "true" : "false") << endl; + + ts << "filesystem=" << (!(*it)->filesystem().stripWhiteSpace().isEmpty() ? + (*it)->filesystem() : default_filesystem) << endl; + + ts << "write access=" << ((*it)->writeAccess() ? "true" : "false") << endl; +#endif + ts << "uid=" << (!(*it)->uid().stripWhiteSpace().isEmpty() ? + (*it)->uid() : Smb4KSettings::userID()) << endl; + + ts << "gid=" << (!(*it)->gid().stripWhiteSpace().isEmpty() ? + (*it)->gid() : Smb4KSettings::groupID()) << endl; + } + else + { + // Do nothing + } + + break; + } + default: + { + break; + } + } + + ts << endl; + } + + file.close(); + } + } + else + { + file.remove(); + } +} + + +void Smb4KSambaOptionsHandler::remount( Smb4KShare *share, bool yes ) +{ + if ( share ) + { + Smb4KSambaOptionsInfo *info = NULL; + + if ( (info = find_item( share->name() )) ) + { + info->setRemount( yes ); + } + else if ( !info && yes ) + { + info = new Smb4KSambaOptionsInfo( share ); + info->setRemount( yes ); + + m_list.append( info ); + } + } +} + + +void Smb4KSambaOptionsHandler::sync() +{ + write_options(); +} + + +Smb4KSambaOptionsInfo *Smb4KSambaOptionsHandler::find_item( const QString &item, bool exactMatch ) +{ + // If the list is empty, we'll read the file. + if ( m_list.isEmpty() ) + { + read_options(); + } + + QString host = item.section( "/", 2, 2 ).stripWhiteSpace(); + + Smb4KSambaOptionsInfo *info = NULL; + + if ( !item.stripWhiteSpace().isEmpty() ) + { + for ( QValueList::ConstIterator it = m_list.begin(); + it != m_list.end(); ++it ) + { + if ( QString::compare( item.lower(), (*it)->itemName().lower() ) == 0 ) + { + info = *it; + + break; + } + else if ( QString::compare( host.lower(), (*it)->itemName().lower() ) == 0 ) + { + if ( !info && !exactMatch ) + { + info = *it; + } + + continue; + } + else + { + continue; + } + } + } + + return info; +} + + +const QString Smb4KSambaOptionsHandler::smbclientOptions( const QString &share ) +{ + // Get the global Samba options + (void) globalSambaOptions(); + + Smb4KSambaOptionsInfo *info = find_item( share ); + QString args = QString::null; + + // Get the strings that are needed to put the + // argument list together: + QString resolve_order = (!Smb4KSettings::nameResolveOrder().isEmpty() && + QString::compare( Smb4KSettings::nameResolveOrder(), + m_samba_options["name resolve order"] ) != 0) ? + Smb4KSettings::nameResolveOrder() : + QString::null; + + QString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() && + QString::compare( Smb4KSettings::netBIOSName(), + m_samba_options["netbios name"] ) != 0) ? + Smb4KSettings::netBIOSName() : + QString::null; + + QString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() && + QString::compare( Smb4KSettings::netBIOSScope(), + m_samba_options["netbios scope"] ) != 0) ? + Smb4KSettings::netBIOSScope() : + QString::null; + + QString socket_options = (!Smb4KSettings::socketOptions().isEmpty() && + QString::compare( Smb4KSettings::socketOptions(), + m_samba_options["socket options"] ) != 0) ? + Smb4KSettings::socketOptions() : + QString::null; + + bool kerberos = info ? + info->kerberos() : + Smb4KSettings::useKerberos(); + + int port = info && info->port() != -1 ? + info->port() : + Smb4KSettings::remotePort(); + + // Options that are not customizable: + args.append( !resolve_order.isEmpty() ? + QString( " -R '%1'" ).arg( resolve_order ) : + QString::null ); + + args.append( !netbios_name.isEmpty() ? + QString( " -n '%1'" ).arg( netbios_name ) : + QString::null ); + + args.append( !netbios_scope.isEmpty() ? + QString( " -i '%1'" ).arg( netbios_scope ) : + QString::null ); + + args.append( !socket_options.isEmpty() ? + QString( " -O '%1'" ).arg( socket_options ) : + QString::null ); + + args.append( Smb4KSettings::bufferSize() != 65520 ? + QString( " -b %1" ).arg( Smb4KSettings::bufferSize() ) : + QString::null ); + + args.append( Smb4KSettings::machineAccount() ? " -P" : QString::null ); + + switch ( Smb4KSettings::signingState() ) + { + case Smb4KSettings::EnumSigningState::None: + { + // The user does not want this setting + // to be used. + break; + } + case Smb4KSettings::EnumSigningState::On: + { + args.append( " -S on" ); + + break; + } + case Smb4KSettings::EnumSigningState::Off: + { + args.append( " -S off" ); + + break; + } + case Smb4KSettings::EnumSigningState::Required: + { + args.append( " -S required" ); + + break; + } + default: + { + break; + } + } + + args.append( kerberos ? " -k" : QString::null ); + + args.append( QString( " -p %1" ).arg( port ) ); + + return args; +} + + +const QString Smb4KSambaOptionsHandler::nmblookupOptions( bool with_broadcast ) +{ + // Get the global Samba options + (void) globalSambaOptions(); + + QString args = QString::null; + + QString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() && + QString::compare( Smb4KSettings::netBIOSName(), + m_samba_options["netbios name"] ) != 0) ? + Smb4KSettings::netBIOSName() : + QString::null; + + QString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() && + QString::compare( Smb4KSettings::netBIOSScope(), + m_samba_options["netbios scope"] ) != 0) ? + Smb4KSettings::netBIOSScope() : + QString::null; + + QString socket_options = (!Smb4KSettings::socketOptions().isEmpty() && + QString::compare( Smb4KSettings::socketOptions(), + m_samba_options["socket options"] ) != 0) ? + Smb4KSettings::socketOptions() : + QString::null; + + QString domain = (!Smb4KSettings::domainName().isEmpty() && + QString::compare( Smb4KSettings::domainName(), + m_samba_options["workgroup"] ) != 0) ? + Smb4KSettings::domainName() : + QString::null; + + args.append( !netbios_name.isEmpty() ? + QString( " -n '%1'" ).arg( netbios_name ) : + QString::null ); + + args.append( !netbios_scope.isEmpty() ? + QString( " -i '%1'" ).arg( netbios_scope ) : + QString::null ); + + args.append( !socket_options.isEmpty() ? + QString( " -O '%1'" ).arg( socket_options ) : + QString::null ); + + args.append( !domain.isEmpty() ? + QString( " -W '%1'" ).arg( domain ) : + QString::null ); + + args.append( (!Smb4KSettings::broadcastAddress().isEmpty() && + with_broadcast) ? + QString( " -B %1" ).arg( Smb4KSettings::broadcastAddress() ) : + QString::null ); + + args.append( Smb4KSettings::usePort137() ? + " -r" : + QString::null ); + + return args; +} + + +const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &networkItem, const QString &protocol ) +{ + QString args = QString::null; + + Smb4KSambaOptionsInfo *info = find_item( networkItem ); + + QString protocol_hint; + + // Determine the protocol hint specified by the user: + switch ( Smb4KSettings::protocolHint() ) + { + case Smb4KSettings::EnumProtocolHint::Automatic: + { + // In this case the user leaves it to the net + // command to determine the right protocol. + protocol_hint = QString::null; + + break; + } + case Smb4KSettings::EnumProtocolHint::RPC: + { + protocol_hint = "rpc"; + + break; + } + case Smb4KSettings::EnumProtocolHint::RAP: + { + protocol_hint = "rap"; + + break; + } + case Smb4KSettings::EnumProtocolHint::ADS: + { + protocol_hint = "ads"; + + break; + } + default: + { + protocol_hint = QString::null; + + break; + } + } + + QString default_protocol = (info && !info->protocol().isEmpty()) ? + info->protocol() : + protocol_hint; + + QString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() && + QString::compare( Smb4KSettings::netBIOSName(), + m_samba_options["netbios name"] ) != 0) ? + Smb4KSettings::netBIOSName() : + QString::null; + + QString domain = (!Smb4KSettings::domainName().isEmpty() && + QString::compare( Smb4KSettings::domainName(), + m_samba_options["workgroup"] ) != 0) ? + Smb4KSettings::domainName() : + QString::null; + + int port = (info && info->port() != -1) ? + info->port() : + Smb4KSettings::remotePort(); + + // Add command specific arguments: + switch ( command ) + { + case Share: + { + // We can only use the RAP or RPC protocol here. + if ( !protocol.stripWhiteSpace().isEmpty() ) + { + // Protocol can only be defined by us developers, + // and we should know what we are doing. So, no + // checks for the right protocol here: + args.append( QString( " %1" ).arg( protocol ) ); + } + else + { + args.append( QString( " %1" ).arg( QString::compare( default_protocol, "ads" ) != 0 ? + default_protocol : + QString::null /* FIXME: Is that the best way how to do it? */) ); + } + + args.append( " share -l" ); + + break; + } + case ServerDomain: + { + // NOTE: Since version 3.0.25, the command 'net rap server domain ...' + // will through an error. We have to use 'net rap server ...'. This is + // also compatible with earlier version. + + // This only works with the rap protocol: + args.append( " rap server" ); + + break; + } + case LookupHost: + { + // Check that the server name is present: + if ( networkItem.stripWhiteSpace().isEmpty() ) + { + Smb4KError::error( ERROR_NET_COMMAND, args.stripWhiteSpace() ); + + return args; // still empty + } + + // This lookup command takes no protocol: + args.append( QString( " lookup host %1" ).arg( networkItem ) ); + + break; + } + case LookupMaster: + { + // Check that the domain name is present: + if ( networkItem.stripWhiteSpace().isEmpty() ) + { + Smb4KError::error( ERROR_NET_COMMAND, args.stripWhiteSpace() ); + + return args; // still empty + } + + // This lookup command takes no protocol: + args.append( QString( " lookup master '%1'" ).arg( networkItem ) ); + + break; + } + case Domain: + { + // This only works with the rap protocol: + args.append( " rap domain" ); + + break; + } + default: + { + // Bypass the rest and return an + // empty string: + return args; + } + } + + args.append( !domain.isEmpty() ? + QString( " -W '%1'" ).arg( domain ) : + QString::null ); + + args.append( !netbios_name.isEmpty() ? + QString( " -n '%1'" ).arg( netbios_name ) : + QString::null ); + + args.append( Smb4KSettings::machineAccount() ? + " -P" : + QString::null ); + + args.append( QString( " -p %1" ).arg( port ) ); + + return args; +} + + +const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share ) +{ + Smb4KSambaOptionsInfo *info = find_item( share ); + QString args; + + // Read the global Samba options from smb.conf: + (void) globalSambaOptions(); + + // Get the strings needed to put the argument list together: + QString uid = (info && !info->uid().isEmpty()) ? + info->uid() : + Smb4KSettings::userID(); + + QString gid = (info && !info->gid().isEmpty()) ? + info->gid() : + Smb4KSettings::groupID(); + + QString charset, codepage; + + switch ( Smb4KSettings::clientCharset() ) + { + case Smb4KSettings::EnumClientCharset::default_charset: + { + charset = m_samba_options["unix charset"].lower(); // maybe empty + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_1: + { + charset = "iso8859-1"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_2: + { + charset = "iso8859-2"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_3: + { + charset = "iso8859-3"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_4: + { + charset = "iso8859-4"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_5: + { + charset = "iso8859-5"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_6: + { + charset = "iso8859-6"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_7: + { + charset = "iso8859-7"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_8: + { + charset = "iso8859-8"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_9: + { + charset = "iso8859-9"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_13: + { + charset = "iso8859-13"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_14: + { + charset = "iso8859-14"; + + break; + } + case Smb4KSettings::EnumClientCharset::iso8859_15: + { + charset = "iso8859-15"; + + break; + } + case Smb4KSettings::EnumClientCharset::utf8: + { + charset = "utf8"; + + break; + } + case Smb4KSettings::EnumClientCharset::koi8_r: + { + charset = "koi8-r"; + + break; + } + case Smb4KSettings::EnumClientCharset::koi8_u: + { + charset = "koi8-u"; + + break; + } + case Smb4KSettings::EnumClientCharset::koi8_ru: + { + charset = "koi8-ru"; + + break; + } + case Smb4KSettings::EnumClientCharset::cp1251: + { + charset = "cp1251"; + + break; + } + case Smb4KSettings::EnumClientCharset::gb2312: + { + charset = "gb2312"; + + break; + } + case Smb4KSettings::EnumClientCharset::big5: + { + charset = "big5"; + + break; + } + case Smb4KSettings::EnumClientCharset::euc_jp: + { + charset = "euc-jp"; + + break; + } + case Smb4KSettings::EnumClientCharset::euc_kr: + { + charset = "euc-kr"; + + break; + } + case Smb4KSettings::EnumClientCharset::tis_620: + { + charset = "tis-620"; + + break; + } + default: + { + break; + } + } + + switch ( Smb4KSettings::serverCodepage() ) + { + case Smb4KSettings::EnumServerCodepage::default_codepage: + { + codepage = m_samba_options["dos charset"].lower(); // maybe empty + + break; + } + case Smb4KSettings::EnumServerCodepage::cp437: + { + codepage = "cp437"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp720: + { + codepage = "cp720"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp737: + { + codepage = "cp737"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp775: + { + codepage = "cp775"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp850: + { + codepage = "cp850"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp852: + { + codepage = "cp852"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp855: + { + codepage = "cp855"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp857: + { + codepage = "cp857"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp858: + { + codepage = "cp858"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp860: + { + codepage = "cp860"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp861: + { + codepage = "cp861"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp862: + { + codepage = "cp862"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp863: + { + codepage = "cp863"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp864: + { + codepage = "cp864"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp865: + { + codepage = "cp865"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp866: + { + codepage = "cp866"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp869: + { + codepage = "cp869"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp874: + { + codepage = "cp874"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp932: + { + codepage = "cp932"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp936: + { + codepage = "cp936"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp949: + { + codepage = "cp949"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp950: + { + codepage = "cp950"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1250: + { + codepage = "cp1250"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1251: + { + codepage = "cp1251"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1252: + { + codepage = "cp1252"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1253: + { + codepage = "cp1253"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1254: + { + codepage = "cp1254"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1255: + { + codepage = "cp1255"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1256: + { + codepage = "cp1256"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1257: + { + codepage = "cp1257"; + + break; + } + case Smb4KSettings::EnumServerCodepage::cp1258: + { + codepage = "cp1258"; + + break; + } + case Smb4KSettings::EnumServerCodepage::unicode: + { + codepage = "unicode"; + + break; + } + default: + { + break; + } + } + +#ifndef __FreeBSD__ + + QString netbios_name = !Smb4KSettings::netBIOSName().isEmpty() ? + Smb4KSettings::netBIOSName() : + m_samba_options["netbios name"]; + + QString socket_options = (!Smb4KSettings::socketOptions().isEmpty() && + QString::compare( Smb4KSettings::socketOptions(), + m_samba_options["socket options"] ) != 0) ? + Smb4KSettings::socketOptions() : + QString::null; + + QString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() && + QString::compare( Smb4KSettings::netBIOSScope(), + m_samba_options["netbios scope"] ) != 0) ? + Smb4KSettings::netBIOSScope() : + QString::null; + + int port = info && info->port() != -1 ? + info->port() : + Smb4KSettings::remotePort(); + + bool kerberos = info ? + info->kerberos() : + Smb4KSettings::useKerberos(); + + bool read_write = info ? + info->writeAccess() : + (Smb4KSettings::writeAccess() == Smb4KSettings::EnumWriteAccess::ReadWrite); + + // Compile the arguments list: + args.append( !netbios_name.isEmpty() ? + QString( "netbiosname='%1'," ).arg( netbios_name ) : + QString::null ); + + args.append( !uid.isEmpty() ? + QString( "uid=%1," ).arg( uid ) : + QString::null ); + + args.append( !gid.isEmpty() ? + QString( "gid=%1," ).arg( gid ) : + QString::null ); + + args.append( QString( "port=%1," ).arg( port ) ); + + args.append( !charset.isEmpty() ? + QString( "iocharset=%1," ).arg( charset ) : + QString::null ); + + args.append( read_write ? "rw," : "ro," ); + + switch ( Smb4KSettings::filesystem() ) + { + case Smb4KSettings::EnumFilesystem::CIFS: + { + args.append( !Smb4KSettings::fileMask().isEmpty() ? + QString( "file_mode=%1," ).arg( Smb4KSettings::fileMask() ) : + QString::null ); + + args.append( !Smb4KSettings::directoryMask().isEmpty() ? + QString( "dir_mode=%1," ).arg( Smb4KSettings::directoryMask() ) : + QString::null ); + + args.append( Smb4KSettings::permissionChecks() ? + "perm," : + "noperm," ); + + args.append( Smb4KSettings::clientControlsIDs() ? + "setuids," : + "nosetuids," ); + + args.append( Smb4KSettings::serverInodeNumbers() ? + "serverino," : + "noserverino," ); + + args.append( Smb4KSettings::inodeDataCaching() ? + "directio," : + QString::null ); // FIXME: Does 'nodirectio' exist? + + args.append( Smb4KSettings::translateReservedChars() ? + "mapchars," : + "nomapchars," ); + + args.append( Smb4KSettings::noLocking() ? + "nolock," : + QString::null ); // FIXME: Does 'lock' exist? + + args.append( !Smb4KSettings::customCIFSOptions().isEmpty() ? + Smb4KSettings::customCIFSOptions() : + QString::null ); + + break; + } + case Smb4KSettings::EnumFilesystem::SMBFS: + { + args.append( !socket_options.isEmpty() ? + QString( "sockopt='%1'," ).arg( socket_options ) : + QString::null ); + + args.append( !netbios_scope.isEmpty() ? + QString( "scope=%1," ).arg( netbios_scope ) : + QString::null ); + + args.append( !codepage.isEmpty() ? + QString( "codepage=%1," ).arg( codepage ) : + QString::null ); + + args.append( !Smb4KSettings::fileMask().isEmpty() ? + QString( "fmask=%1," ).arg( Smb4KSettings::fileMask() ) : + QString::null ); + + args.append( !Smb4KSettings::directoryMask().isEmpty() ? + QString( "dmask=%1," ).arg( Smb4KSettings::directoryMask() ) : + QString::null ); + + args.append( kerberos ? "krb," : QString::null ); + + args.append( Smb4KSettings::cachingTime() != 1000 ? + QString( "ttl=%1," ).arg( Smb4KSettings::cachingTime() ) : + QString::null ); + + args.append( Smb4KSettings::unicodeSupport() ? + "unicode," : + QString::null ); + + args.append( Smb4KSettings::largeFileSystemSupport() ? + "lfs," : + QString::null ); + + break; + } + default: + { + break; + } + } + +#else + + // Compile the arguments list: + args.append( !uid.isEmpty() ? + QString( " -u %1" ).arg( uid ) : + QString::null ); + + args.append( !gid.isEmpty() ? + QString( " -g %1" ).arg( gid ) : + QString::null ); + + args.append( !charset.isEmpty() && !codepage.isEmpty() ? + QString( " -E %1:%2" ).arg( charset, codepage ) : + QString::null ); + + args.append( !Smb4KSettings::fileMask().isEmpty() ? + QString( " -f %1" ).arg( Smb4KSettings::fileMask() ) : + QString::null ); + + args.append( !Smb4KSettings::directoryMask().isEmpty() ? + QString( " -d %1" ).arg( Smb4KSettings::directoryMask() ) : + QString::null ); + + // NOTE: Under FreeBSD the port must be managed by the mounter. + + // FIXME: If the manual page was of more use, we could probably implement + // more of the arguments that are available for mount_smbfs. + +#endif + + return args; +} + + +void Smb4KSambaOptionsHandler::read_smb_conf() +{ + // Clear the options list before reading. + m_samba_options.clear(); + + QStringList paths; + paths << "/etc"; + paths << "/etc/samba"; + paths << "/usr/local/etc"; + paths << "/usr/local/etc/samba"; + + QFile f( "smb.conf" ); + + QStringList contents; + + // Locate the file and read its contents: + for ( QStringList::Iterator it = paths.begin(); it != paths.end(); ++it ) + { + QDir::setCurrent( *it ); + + if ( f.exists() ) + { + if ( f.open( IO_ReadOnly ) ) + { + QTextStream ts( &f ); + ts.setEncoding( QTextStream::Locale ); + + contents = QStringList::split( '\n', ts.read(), false ); + } + + f.close(); + + break; + } + else + { + continue; + } + } + + // Process the file contents. + for ( QStringList::Iterator it = contents.erase( contents.begin(), ++(contents.find( "[global]" )) ); it != contents.end(); ++it ) + { + if ( (*it).stripWhiteSpace().startsWith( "#" ) || (*it).stripWhiteSpace().startsWith( ";" ) ) + { + *it = QString::null; + } + else if ( (*it).stripWhiteSpace().startsWith( "include" ) ) + { + // Put the contents of the included at this position. + QString file = (*it).section( "=", 1, 1 ).stripWhiteSpace(); + *it = QString::null; + f.setName( file ); + + QStringList include; + + if ( f.exists() ) + { + if ( f.open( IO_ReadOnly ) ) + { + QTextStream ts( &f ); + ts.setEncoding( QTextStream::Locale ); + + include = QStringList::split( '\n', ts.read(), false ); + } + + f.close(); + } + + for ( QStringList::Iterator i = include.begin(); i != include.end(); ++i ) + { + if ( !(*i).stripWhiteSpace().isEmpty() ) + { + contents.insert( it, *i ); + + continue; + } + else + { + continue; + } + } + + continue; + } + else if ( (*it).startsWith( "[" ) ) + { + contents.erase( it, contents.end() ); + + break; + } + else + { + continue; + } + } + + contents.remove( QString::null ); + + // Write all options into the map: + for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it ) + { + QString key = (*it).section( "=", 0, 0 ).stripWhiteSpace().lower(); + m_samba_options[key] = QString( (*it).section( "=", 1, 1 ).stripWhiteSpace().upper() ); + } + + // Post-processing. Some values should be entered with their defaults, if they are + // not already present. + if ( !m_samba_options.contains( "netbios name" ) ) + { + size_t hostnamelen = 255; + char *hostname = new char[hostnamelen]; + + if ( gethostname( hostname, hostnamelen ) == -1 ) + { + int error = errno; + Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error ) ); + } + else + { + m_samba_options["netbios name"] = ( QString( "%1" ).arg( hostname ) ).upper(); + } + + delete [] hostname; + } +} + + +const QMap &Smb4KSambaOptionsHandler::globalSambaOptions() +{ + if ( m_samba_options.isEmpty() ) + { + read_smb_conf(); + } + + return m_samba_options; +} + + +const QString &Smb4KSambaOptionsHandler::winsServer() +{ + if ( m_wins_server.isEmpty() ) + { + (void) globalSambaOptions(); + + if ( !m_samba_options["wins server"].isEmpty() ) + { + m_wins_server = m_samba_options["wins server"]; + } + else if ( !m_samba_options["wins support"].isEmpty() && + (QString::compare( m_samba_options["wins support"].lower(), "yes" ) == 0 || + QString::compare( m_samba_options["wins support"].lower(), "true" ) == 0) ) + { + m_wins_server = "127.0.0.1"; + } + } + + return m_wins_server; +} + + +void Smb4KSambaOptionsHandler::addItem( Smb4KSambaOptionsInfo *info, bool s ) +{ + Smb4KSambaOptionsInfo *item = find_item( info->itemName() ); + + if ( item && QString::compare( item->itemName().lower(), info->itemName().lower() ) == 0 ) + { + item->setPort( info->port() ); +#ifndef __FreeBSD__ + item->setFilesystem( info->filesystem() ); + item->setWriteAccess( info->writeAccess() ); +#endif + item->setRemount( info->remount() ); + item->setProtocol( info->protocol() ); + item->setKerberos( info->kerberos() ); + item->setUID( info->uid() ); + item->setGID( info->gid() ); + + delete info; + } + else + { + m_list.append( info ); + } + + if ( s ) + { + sync(); + } +} + + +void Smb4KSambaOptionsHandler::removeItem( const QString &name, bool s ) +{ + Smb4KSambaOptionsInfo *item = find_item( name ); + + if ( item && QString::compare( item->itemName().lower(), name.lower() ) == 0 ) + { + m_list.remove( item ); + delete item; + } + + if ( s ) + { + sync(); + } +} + +#include "smb4ksambaoptionshandler.moc" diff --git a/smb4k/core/smb4ksambaoptionshandler.h b/smb4k/core/smb4ksambaoptionshandler.h new file mode 100644 index 0000000..6bb5565 --- /dev/null +++ b/smb4k/core/smb4ksambaoptionshandler.h @@ -0,0 +1,253 @@ +/*************************************************************************** + smb4ksambaoptionshandler - This class handles the Samba options. + ------------------- + begin : So Mai 14 2006 + copyright : (C) 2006-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSAMBAOPTIONSHANDLER_H +#define SMB4KSAMBAOPTIONSHANDLER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include + +// forward declarations +class Smb4KSambaOptionsInfo; +class Smb4KShare; + + +/** + * This class belongs to the core classes of Smb4K and handles the global + * and the custom Samba options. + * + * @author Alexander Reinholdt + */ + +class Smb4KSambaOptionsHandler : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent object + * + * @param name The name of this object + */ + Smb4KSambaOptionsHandler( QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KSambaOptionsHandler(); + + /** + * Retrieve the list of shares that have custom options defined. + * You will not only get those options that have different ports etc. + * defined but also all shares that are to be remounted. + * + * @returns the list of all shares that have custom options defined. + */ + const QValueList &customOptionsList(); + + /** + * This functions sets the remount flag of the share @p share to TRUE or FALSE. + * In case the share is not yet in the list of shares that are to be remounted, + * it will be added. If you set the remount flag to FALSE on an existing entry, + * it will stay in the list even if no other custom options were defined. + * + * @param share The Smb4KShare object that represents the share + * + * @param yes TRUE if you want the share to be remounted and FALSE + * otherwise + */ + void remount( Smb4KShare *share, bool yes ); + + /** + * Commit the whole list of shares with custom options to the configuration + * file. You should call this if you exit the application. + */ + void sync(); + + /** + * This function returns the line of arguments for the 'smbclient' program. + * The arguments are spcific to the share that is defined by @p share. You have + * to provide the name of the shares - as always - in the form //HOST/SHARE. + * + * @param share The name of the share. + * + * @returns a list of arguments for use with the 'smbclient' program. + */ + const QString smbclientOptions( const QString &share = QString::null ); + + /** + * This function returns the "global" options for nmblookup, i.e. the domain + * the client is in, if Kerberos should be used, etc. + * + * @param with_broadcast Return the global broadcast address if defined. + * + * @returns a string with the "global" options for nmblookup + */ + const QString nmblookupOptions( bool with_broadcast = true ); + + /** + * This function returns the options defined in the global section of the smb.conf + * file. All option names have been converted to lower case and you can find each + * entry by providing the option name in lowercase (!) as key. + * + * @returns a list of the options defined in smb.conf. + */ + const QMap &globalSambaOptions(); + + /** + * This function returns the WINS server the system is using. + * + * @returns the name or IP of the WINS server + */ + const QString &winsServer(); + + /** + * This enumeration is for use with the netOptions() function. It tells which + * command to use. + */ + enum NetCommand { Share, ServerDomain, LookupHost, LookupMaster, Domain }; + + /** + * This function returns the options for the net command. + * + * @param command One of the entries of the NetCommand enumeration. + * + * @param networkItem The name of the network Item. May be empty. + * + * @param protocol Force a certain protocol (rap/rpc/ads) to be used. + * + * @returns the list of arguments for the net command or QString::null if an error occurred. + */ + const QString netOptions( int command, const QString &networkItem, const QString &protocol = QString::null ); + + /** + * This function returns the options for smbmount/mount.cifs under Linux + * and similar operating systems or for mount_smbfs under FreeBSD. + * + * Note: Under Linux etc. this is a comma-separated list which ends with + * a comma, so remember this when you build up the command line. + * + * @param share The share that is to be mounted. + */ + const QString mountOptions( const QString &share ); + + /** + * Find a network item in the list. + * + * Please note that if the host where a share you are probing for + * is located, a pointer to this *host* item will be returned unless + * you set @p exactMatch to TRUE in which case NULL is returned! If + * neither the host nor the share is found, NULL is returned. + * + * @param item The name of the network item to find. + * + * @param exactMatch The name has to match exactly the result that's returned. + * + * @returns the network item. + */ + Smb4KSambaOptionsInfo *findItem( const QString &item, bool exactMatch = false ) { return find_item( item, exactMatch ); } + + /** + * Add a new Smb4KSambaOptionsInfo object to the list of custom options. If the item already exists, + * the old options will be replaced by the new ones. + * + * @param info The Smb4KSambaOptionsInfo object + * + * @param sync If TRUE, the list is sync'ed with the config file. + */ + void addItem( Smb4KSambaOptionsInfo *info, bool sync ); + + /** + * Remove an item from the list. + * + * @param name The name of the item. + * + * @param sync If TRUE, the list is sync'ed with the config file. + */ + void removeItem( const QString &name, bool sync ); + + private: + /** + * The list of network items that have custom options defined. + */ + QValueList m_list; + + /** + * This function reads the options from the config file. + */ + void read_options(); + + /** + * Write the list of custom shares to the file. + */ + void write_options(); + + /** + * This function searches a particular network item in the list. If this item is a share + * and it is not found, @p exactMatch determines if NULL is returned or if the values of + * the item that matches @p item closest (i.e. the host, or another share that's located + * on the host). In most cases you want @p exactMatch to be FALSE. + * Please note: Do not delete the pointer that's returned by this function or you will + * remove an item from the list! + * + * @param item The name of the network item. + * + * @param exactMatch The name has to match exactly the result that's returned. + * + * @returns The Smb4KSambaOptionsInfo object associated with the network item. + */ + Smb4KSambaOptionsInfo *find_item( const QString &item, bool exactMatch = false ); + + /** + * This function reads the entries of the global section of Samba's configuration + * file smb.conf and puts them into a map. + */ + void read_smb_conf(); + + /** + * This map carries the options defined in the [global] section of Samba's configuration + * file smb.conf. You can access a certain value by providing the lower case option name + * as key. + */ + QMap m_samba_options; + + /** + * The WINS server + */ + QString m_wins_server; +}; + + +#endif diff --git a/smb4k/core/smb4ksambaoptionsinfo.cpp b/smb4k/core/smb4ksambaoptionsinfo.cpp new file mode 100644 index 0000000..5ea5b51 --- /dev/null +++ b/smb4k/core/smb4ksambaoptionsinfo.cpp @@ -0,0 +1,137 @@ +/*************************************************************************** + smb4ksambaoptionsinfo - This is a container class that carries + various information of extra options for a specific host. + ------------------- + begin : Mi Okt 18 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + + +// application specific includes +#include "smb4ksambaoptionsinfo.h" +#include "smb4kshare.h" + + +Smb4KSambaOptionsInfo::Smb4KSambaOptionsInfo( const QString &name ) +: m_name( name ), m_remount( false ), m_port( -1 ), +#ifndef __FreeBSD__ +m_filesystem( QString::null ), m_write_access( true ), +#endif +m_protocol( QString::null ), m_kerberos( false ), +m_uid( QString::null ), m_gid( QString::null ) +{ +} + + +Smb4KSambaOptionsInfo::Smb4KSambaOptionsInfo( Smb4KShare *share ) +: m_name( share->name() ), m_remount( false ), m_port( -1 ), +#ifndef __FreeBSD__ +m_filesystem( share->filesystem() ), m_write_access( true ), +#endif +m_protocol( QString::null ), m_kerberos( false ), +m_uid( QString( "%1" ).arg( share->uid() ) ), m_gid( QString( "%1" ).arg( share->gid() ) ) +{ +} + + + +Smb4KSambaOptionsInfo::Smb4KSambaOptionsInfo( const Smb4KSambaOptionsInfo &info ) +: m_name( info.itemName() ), m_remount( info.remount() ), m_port( info.port() ), +#ifndef __FreeBSD__ +m_filesystem( info.filesystem() ), m_write_access( info.writeAccess() ), +#endif +m_protocol( info.protocol() ), m_kerberos( info.kerberos() ), +m_uid( info.uid() ), m_gid( info.gid() ) +{ +} + + +Smb4KSambaOptionsInfo::~Smb4KSambaOptionsInfo() +{ +} + + +void Smb4KSambaOptionsInfo::setRemount( bool rm ) +{ + m_remount = rm; +} + + +void Smb4KSambaOptionsInfo::setItemName( const QString &name ) +{ + m_name = name; +} + + +void Smb4KSambaOptionsInfo::setPort( int port ) +{ + m_port = port; +} + +void Smb4KSambaOptionsInfo::setProtocol( const QString &p ) +{ + if ( QString::compare( p, "auto" ) != 0 ) + { + m_protocol = p; + } + else + { + m_protocol = QString::null; + } +} + + +void Smb4KSambaOptionsInfo::setKerberos( bool krb ) +{ + m_kerberos = krb; +} + + +int Smb4KSambaOptionsInfo::type() +{ + return m_name.contains( "/" ) == 3 ? Share : Host; +} + + +void Smb4KSambaOptionsInfo::setUID( const QString &uid ) +{ + m_uid = uid; +} + + +void Smb4KSambaOptionsInfo::setGID( const QString &gid ) +{ + m_gid = gid; +} + +#ifndef __FreeBSD__ +void Smb4KSambaOptionsInfo::setFilesystem( const QString &fs ) +{ + m_filesystem = fs; +} + + +void Smb4KSambaOptionsInfo::setWriteAccess( bool rw ) +{ + m_write_access = rw; +} +#endif + diff --git a/smb4k/core/smb4ksambaoptionsinfo.h b/smb4k/core/smb4ksambaoptionsinfo.h new file mode 100644 index 0000000..706aa66 --- /dev/null +++ b/smb4k/core/smb4ksambaoptionsinfo.h @@ -0,0 +1,291 @@ +/*************************************************************************** + smb4ksambaoptionsinfo - This is a container class that carries + various information of extra options for a specific host. + ------------------- + begin : Mi Okt 18 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSAMBAOPTIONSINFO_H +#define SMB4KSAMBAOPTIONSINFO_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// forward declarations +class Smb4KShare; + + +/** + * This class provides a container for all extra options that the user defined + * for a certain share. + * + * @author Alexander Reinholdt + */ + +class Smb4KSambaOptionsInfo +{ + public: + /** + * Constructor. It takes the name of the network item in the form + * HOST or //HOST/SHARE as only argument. If you use this constructor, you + * need to use the set* functions to add information. + * + * @param name The network item's name. + */ + Smb4KSambaOptionsInfo( const QString &name ); + + /** + * Constructor. It takes a Smb4KShare object and extracts the name and the + * filesystem from it. All other information has to be set with the set* + * functions. + * + * @param share A Smb4KShare object representing a share. + */ + Smb4KSambaOptionsInfo( Smb4KShare *share ); + + /** + * The copy constructor. + * + * @param info A Smb4KShareOptionsInfo object + */ + Smb4KSambaOptionsInfo( const Smb4KSambaOptionsInfo &info ); + + /** + * The destructor. + */ + ~Smb4KSambaOptionsInfo(); + + /** + * Sets the "should be remounted" flag. + * + * @param rm TRUE if the share is to be remounted and + * FALSE otherwise. + */ + void setRemount( bool rm ); + + /** + * Returns TRUE if the share is to be remounted and FALSE otherwise. + * + * @returns TRUE if the share is to be remounted and FALSE otherwise + */ + bool remount() const { return m_remount; } + + /** + * This function sets the item name. + * + * @param name The name of the network item + */ + void setItemName( const QString &name ); + + /** + * This function returns the name of the network item, i.e. the server or + * share. + * + * @returns the name of the network item. + */ + const QString &itemName() const { return m_name; } + + /** + * This function sets the port that should be used when querying this share. + * + * @param port The port number + */ + void setPort( int port ); + + /** + * This function returns the port that should be used when working with this + * share. Please note, that it will be returned as an integer. If no port has been + * defined, -1 will be returned. + * + * @returns the port number + */ + int port() const { return m_port; } + + /** + * This function sets the protocol to use with the net command. If @p protocol + * is equal to "auto", the protocol will automatically be set to "" internally, + * so that Smb4KSambaOptionsInfo::protocol() returns an empty string. + * + * @param protocol the protocol + */ + void setProtocol( const QString &protocol ); + + /** + * This function returns the protocol to use with the net command. + * + * @retuns the protocol + */ + const QString &protocol() const { return m_protocol; } + + /** + * Set the 'Use Kerberos' flag. + * + * @param krb TRUE if the user wants to use Kerberos + * and FALSE otherwise. + */ + void setKerberos( bool krb ); + + /** + * This functions returns TRUE if the user wants to use Kerberos and + * otherwise it returns FALSE. + * + * @returns TRUE if Kerberos should be used and FALSE + * otherwise. + */ + bool kerberos() const { return m_kerberos; } + + /** + * With this function you can set the UID you want to use for this item. + * However, it makes only sense with shares. + * + * @param uid The UID + */ + void setUID( const QString &uid ); + + /** + * This functions returns the UID defined for this item. + * + * @returns the UID. + */ + const QString &uid() const { return m_uid; } + + /** + * With this function you can set the GID you want to use for this item. + * However, it makes only sense with shares. + * + * @param gid The GID + */ + void setGID( const QString &gid ); + + /** + * This functions returns the GID defined for this item. + * + * @returns the GID. + */ + const QString &gid() const { return m_gid; } + + /** + * This function returns the type of the network item for which the options + * have been defined. + * + * @returns the type according to the Type enumeration. + */ + int type(); + + /** + * The Type enumeration. + */ + enum Type { Share, Host }; + +#ifndef __FreeBSD__ + /** + * This function sets the file system that is to be used when mounting the share. + * + * Note: This function is not available und FreeBSD. + * + * @param fs the file system name + */ + void setFilesystem( const QString &fs ); + + /** + * This function returns the file system that is to be used. + * + * Note: This function is not available und FreeBSD. + * + * @returns the file system name + */ + const QString &filesystem() const { return m_filesystem; } + + /** + * Set if the share is to be mounted read-write or read-only. + * + * Note: This function is not available und FreeBSD. + * + * @param rw TRUE if read-write and FALSE otherwise. + */ + void setWriteAccess( bool rw ); + + /** + * This functions returns TRUE if the user wants to mount a share read-write + * otherwise it returns FALSE. + * + * Note: This function is not available und FreeBSD. + * + * @returns TRUE if read-write and FALSE otherwise. + */ + bool writeAccess() const { return m_write_access; } +#endif + + private: + /** + * The share name. + */ + QString m_name; + + /** + * Should be remounted? + */ + bool m_remount; + + /** + * The port number + */ + int m_port; + +#ifndef __FreeBSD__ + /** + * The file system + */ + QString m_filesystem; + + /** + * Mount read-write or read-only? + */ + bool m_write_access; +#endif + + /** + * The protocol + */ + QString m_protocol; + + /** + * Use Kerberos or not + */ + bool m_kerberos; + + /** + * The UID + */ + QString m_uid; + + /** + * The GID + */ + QString m_gid; +}; + +#endif diff --git a/smb4k/core/smb4kscanner.cpp b/smb4k/core/smb4kscanner.cpp new file mode 100644 index 0000000..737bf55 --- /dev/null +++ b/smb4k/core/smb4kscanner.cpp @@ -0,0 +1,1720 @@ +/*************************************************************************** + smb4kscanner.cpp - The network scan core class of Smb4K. + ------------------- + begin : Sam Mai 31 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include + +// system includes +#include + +// Application specific includes. +#include "smb4kscanner.h" +#include "smb4kscanner_p.h" +#include "smb4kauthinfo.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4ksambaoptionshandler.h" +#include "smb4kpasswordhandler.h" +#include "smb4knetworkitems.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + +static bool created_workgroups_list = false; +static bool created_hosts_list = false; + + + +Smb4KScanner::Smb4KScanner( QValueList *workgroups, QValueList *hosts, +QObject *parent, const char *name ) +: QObject( parent, name ), m_workgroups_list( workgroups ), m_hosts_list( hosts ) +{ + m_priv = new Smb4KScannerPrivate; + + if ( !m_workgroups_list ) + { + created_workgroups_list = true; + m_workgroups_list = new QValueList; + } + else + { + // The list was passed to the constructor from outside. + } + + if ( !m_hosts_list ) + { + created_hosts_list = true; + m_hosts_list = new QValueList; + } + else + { + // The list was passed to the constructor from outside. + } + + m_proc = new KProcess( this, "ScannerMainProcess" ); + m_proc->setUseShell( true ); + + m_working = false; + + m_queue.setAutoDelete( true ); + + connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( processExited( KProcess* ) ), + this, SLOT( slotProcessExited( KProcess * ) ) ); + + connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); +} + + +Smb4KScanner::~Smb4KScanner() +{ + abort(); + + // Delete the list of workgroups, if necessary: + if ( created_workgroups_list ) + { + for ( QValueList::Iterator it = m_workgroups_list->begin(); it != m_workgroups_list->end(); ++it ) + { + delete *it; + } + + m_workgroups_list->clear(); + + delete m_workgroups_list; + } + else + { + // The list of workgroups is handled outside of this class. + } + + // Delete the list of hosts, if necessary: + if ( created_hosts_list ) + { + for ( QValueList::Iterator it = m_hosts_list->begin(); it != m_hosts_list->end(); ++it ) + { + delete *it; + } + + m_hosts_list->clear(); + + delete m_hosts_list; + } + else + { + // The list of hosts is handled outside of this class. + } + + delete m_priv; +} + + +void Smb4KScanner::init() +{ + m_timer_id = startTimer( TIMER_INTERVAL ); + rescan(); +} + + +void Smb4KScanner::rescan() +{ + m_queue.enqueue( new QString( QString( "%1:" ).arg( Init ) ) ); +} + + +/**************************************************************************** + Scans for workgroup members. (public part) +****************************************************************************/ + +void Smb4KScanner::getWorkgroupMembers( const QString &workgroup, const QString &master, const QString &ip ) +{ + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4" ).arg( Hosts ).arg( workgroup, master, ip ) ) ); +} + + +/**************************************************************************** + Scans for shares on a selected host. (public part) +****************************************************************************/ + +void Smb4KScanner::getShares( const QString &workgroup, const QString &host, const QString &ip, const QString &protocol ) +{ + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4:%5" ).arg( Shares ).arg( workgroup, host, ip ).arg( protocol ) ) ); +} + + +/**************************************************************************** + Gets more info on a selected host. (public part) +****************************************************************************/ + +void Smb4KScanner::getInfo( const QString &workgroup, const QString &host, const QString &ip ) +{ + Smb4KHostItem *item = getHost( host, workgroup ); + + if ( item && item->infoChecked() ) + { + emit info( item ); + + return; + } + else + { + // Avoid several queueing up: + item->setInfoChecked( true ); + } + + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4" ).arg( Info ).arg( workgroup, host, ip ) ) ); +} + + +/**************************************************************************** + Searches for a host. (public part) +****************************************************************************/ + +void Smb4KScanner::search( const QString &host ) +{ + // Check whether we already have this host in + // the list: + Smb4KHostItem *item = getHost( host ); + + if ( item ) + { + emit searchResult( item ); + + return; + } + + m_queue.enqueue( new QString( QString( "%1:%2" ).arg( Search ).arg( host ) ) ); +} + + +/**************************************************************************** + Aborts any process that is running. +****************************************************************************/ + +void Smb4KScanner::abort() +{ + m_queue.clear(); + + if ( m_proc->isRunning() ) + { + m_proc->kill(); + } +} + + +/**************************************************************************** + This function retrieves the initial browse list +****************************************************************************/ + +void Smb4KScanner::scanNetwork() +{ + abort(); + + QString command; + + // Look up the workgroups/domains and their master browsers. + // At the moment we have three methods: + // (1) Smb4KSettings::EnumBrowseList::LookupDomains: This method is + // the most reliable one. It uses nmblookup and will only find + // *active* workgroup master browsers and thus active domains. + // (2) Smb4KSettings::EnumBrowseList::QueryCurrentMaster: This + // method will query the current master browser of the local + // workgroup/domain. This method is not as reliable as the first + // one, because you might get wrong (i. e. outdated) master + // browsers for the workgroups or even empty workgroups. + // (3) Smb4KSettings::EnumBrowseList::QueryCustomMaster: This method + // is similar to the second one, but the user has defined a fixed + // host name or IP address. + // (4) Smb4KSettings::EnumBrowseList::ScanBroadcastAreas: Scan the + // user given broadcast addresses for active hosts (IP scan) + + switch ( Smb4KSettings::browseList() ) + { + case Smb4KSettings::EnumBrowseList::LookupDomains: + { + command.append( "nmblookup -M " ); + command.append( optionsHandler()->nmblookupOptions() ); + command.append( " -- - | grep '<01>' | awk '{print $1}'" ); + command.append( !optionsHandler()->winsServer().isEmpty() ? + QString( " | xargs nmblookup -R -U %1 -A " ).arg( optionsHandler()->winsServer() ) : + " | xargs nmblookup -A " ); + command.append( optionsHandler()->nmblookupOptions() ); + + *m_proc << command; + + startProcess( Workgroups ); + + break; + } + case Smb4KSettings::EnumBrowseList::QueryCurrentMaster: + { + command.append( "net " ); + command.append( optionsHandler()->netOptions( Smb4KSambaOptionsHandler::LookupMaster, + Smb4KSettings::domainName() ) ); + command.append( " -U % | xargs net " ); + command.append( optionsHandler()->netOptions( Smb4KSambaOptionsHandler::Domain, + QString::null ) ); + command.append( " -U % -S" ); + + *m_proc << command; + + startProcess( QueryHost ); + + break; + } + case Smb4KSettings::EnumBrowseList::QueryCustomMaster: + { + command.append( "net " ); + command.append( optionsHandler()->netOptions( Smb4KSambaOptionsHandler::LookupHost, + Smb4KSettings::customMasterBrowser() ) ); + command.append( " -U % -S "+KProcess::quote( Smb4KSettings::customMasterBrowser() ) ); + command.append( " | xargs net " ); + command.append( optionsHandler()->netOptions( Smb4KSambaOptionsHandler::Domain, + QString::null ) ); + command.append( " -U % -S "+KProcess::quote( Smb4KSettings::customMasterBrowser() )+" -I " ); + + *m_proc << command; + + startProcess( QueryHost ); + + break; + } + case Smb4KSettings::EnumBrowseList::ScanBroadcastAreas: + { + // Get the broadcast addresses that are to be scanned: + QStringList addresses = QStringList::split( ",", Smb4KSettings::broadcastAreas(), false ); + + // Build the command: + for ( QStringList::ConstIterator it = addresses.begin(); it != addresses.end(); ++it ) + { + if ( !(*it).isEmpty() ) + { + command.append( "nmblookup " ); + // We want all globally defined options for nmblookup, except + // the broadcast address, because that is needed for the IP + // scan: + command.append( optionsHandler()->nmblookupOptions( false ) ); + command.append( " -B "+*it+" -- '*' " ); + command.append( "| sed -e /querying/d | awk '{print $1}' " ); + command.append( "| xargs nmblookup " ); + // This time we want to have the globally defined broadcast + // address: + command.append( optionsHandler()->nmblookupOptions() ); + // Include the WINS server: + command.append( !optionsHandler()->winsServer().isEmpty() ? + " -R -U "+optionsHandler()->winsServer()+" " : "" ); + command.append( " -A" ); + command.append( " ; " ); + continue; + } + else + { + continue; + } + } + + // Get rid of the last 3 characters (" ; "): + command.truncate( command.length() - 3 ); + + *m_proc << command; + + startProcess( IPScan ); + + break; + } + default: + { + break; + } + } +} + + +/**************************************************************************** + Scans for workgroup members. (private part) +****************************************************************************/ + +void Smb4KScanner::scanForWorkgroupMembers( const QString &workgroup, const QString &master, const QString &ip ) +{ + m_priv->setWorkgroup( workgroup ); + m_priv->setHost( master ); + m_priv->setIP( ip ); + + QString command; + + if ( !ip.isEmpty() ) + { + command.append( "net "+optionsHandler()->netOptions( Smb4KSambaOptionsHandler::ServerDomain, QString::null ) ); + command.append( " -I "+ip ); + command.append( " -w "+KProcess::quote( workgroup ) ); + command.append( " -S "+KProcess::quote( master ) ); + + Smb4KAuthInfo authInfo( workgroup, master, QString::null ); + (void) passwordHandler()->readAuth( &authInfo ); + + if ( !authInfo.user().isEmpty() ) + { + command.append( QString( " -U %1" ).arg( KProcess::quote( authInfo.user() ) ) ); + + if ( !authInfo.password().isEmpty() ) + { + m_proc->setEnvironment( "PASSWD", authInfo.password() ); + } + } + else + { + command.append( " -U %" ); + } + } + else + { + command.append( "net "+optionsHandler()->netOptions( Smb4KSambaOptionsHandler::LookupHost, KProcess::quote( master ) ) ); + command.append( " -S "+KProcess::quote( master )+" -w "+KProcess::quote( workgroup )+" -U % " ); + // FIXME: Maybe we need to know the shell if the user does not use a + // sh-compatible one...? + command.append( "| xargs -IIPADDR " ); + command.append( getenv( "SHELL" ) ); + command.append( " -c 'echo \"*** "+master+": IPADDR ***\" && " ); + command.append( "net "+optionsHandler()->netOptions( Smb4KSambaOptionsHandler::ServerDomain, QString::null ) ); + command.append( " -I IPADDR" ); + command.append( " -w "+KProcess::quote( workgroup ) ); + command.append( " -S "+KProcess::quote( master ) ); + + Smb4KAuthInfo authInfo( workgroup, master, QString::null ); + (void) passwordHandler()->readAuth( &authInfo ); + + if ( !authInfo.user().isEmpty() ) + { + command.append( QString( " -U %1'" ).arg( KProcess::quote( authInfo.user() ) ) ); + + if ( !authInfo.password().isEmpty() ) + { + m_proc->setEnvironment( "PASSWD", authInfo.password() ); + } + } + else + { + command.append( " -U %'" ); + } + } + + *m_proc << command; + + startProcess( Hosts ); +} + + +/**************************************************************************** + Scans for shares on a selected host. (private part) +****************************************************************************/ + +void Smb4KScanner::scanForShares( const QString &workgroup, const QString &host, const QString &ip, const QString &protocol ) +{ + m_priv->setWorkgroup( workgroup ); + m_priv->setHost( host ); + m_priv->setIP( ip ); + + Smb4KAuthInfo *auth = passwordHandler()->readAuth( new Smb4KAuthInfo( workgroup, host, QString::null ) ); + + QString command; + + command = QString( "net %1 -w %2 -S %3" ).arg( optionsHandler()->netOptions( Smb4KSambaOptionsHandler::Share, host, protocol ) ).arg( KProcess::quote( workgroup ), KProcess::quote( host ) ); + + if ( !ip.isEmpty() ) + { + command.append( QString( " -I %1" ).arg( KProcess::quote( ip ) ) ); + } + + if ( !auth->user().isEmpty() ) + { + command.append( QString( " -U %1" ).arg( KProcess::quote( auth->user() ) ) ); + + if ( !auth->password().isEmpty() ) + { + m_proc->setEnvironment( "PASSWD", auth->password() ); + } + } + else + { + command.append( " -U guest%" ); + } + + delete auth; + + *m_proc << command; + + startProcess( Shares ); +} + + +/**************************************************************************** + Gets more info on a selected host. (private part) +****************************************************************************/ + +void Smb4KScanner::scanForInfo( const QString &workgroup, const QString &host, const QString &ip ) +{ + m_priv->setWorkgroup( workgroup ); + m_priv->setHost( host ); + m_priv->setIP( ip ); + + QString smbclient_options = optionsHandler()->smbclientOptions(); + + QString command = QString( "smbclient -d1 -U guest% -W %1 -L %2" ).arg( KProcess::quote( workgroup ) ).arg( KProcess::quote( host ) ); + + if ( !ip.isEmpty() ) + { + command.append( QString( " -I %1" ).arg( KProcess::quote( ip ) ) ); + } + + if ( !smbclient_options.stripWhiteSpace().isEmpty() ) + { + command.append( smbclient_options ); + } + + *m_proc << command; + + startProcess( Info ); +} + + +/**************************************************************************** + Searches for a host. (private part) +****************************************************************************/ + +void Smb4KScanner::searchForHost( const QString &host ) +{ + // We need this because smbclient won't return the host name. + KNetwork::KIpAddress ip_address = KNetwork::KIpAddress( host ); + + if ( Smb4KSettings::searchMethod() == Smb4KSettings::EnumSearchMethod::Smbclient && + (ip_address.isIPv4Addr() || ip_address.isIPv6Addr()) ) + { + Smb4KError::error( ERROR_IP_CANNOT_BE_USED ); + m_working = false; + emit state( SCANNER_STOP ); + return; + } + + m_priv->setHost( host ); + + QString wins = optionsHandler()->winsServer(); + QString nmblookup_options = optionsHandler()->nmblookupOptions(); + QString smbclient_options = optionsHandler()->smbclientOptions(); + + QString command; + + switch ( Smb4KSettings::searchMethod() ) + { + case Smb4KSettings::EnumSearchMethod::Nmblookup: + { + command = QString( "nmblookup" ); + + if ( !nmblookup_options.stripWhiteSpace().isEmpty() ) + { + command.append( nmblookup_options ); + } + + if ( host.contains( '.', true ) != 3 ) + { + if ( !wins.isEmpty() ) + { + command.append( QString( " -R -U %1 %2 -S | grep '<00>' | sed -e 's/<00>.*//'" ).arg( wins ).arg( m_priv->host() ) ); + } + else + { + command.append( QString( " %1 -S | grep '<00>' | sed -e 's/<00>.*//'" ).arg( m_priv->host() ) ); + } + } + else + { + if ( !wins.isEmpty() ) + { + command.append( QString( " -R -U %1 %2 -A | grep '<00>' | sed -e 's/<00>.*//'" ).arg( wins ).arg( m_priv->host() ) ); + } + else + { + command.append( QString( " %1 -A | grep '<00>' | sed -e 's/<00>.*//'" ).arg( m_priv->host() ) ); + } + } + + break; + } + case Smb4KSettings::EnumSearchMethod::Smbclient: + { + command = QString( "smbclient -d2 -U % -L %1" ).arg( m_priv->host() ); + + if ( !smbclient_options.stripWhiteSpace().isEmpty() ) + { + command.append( smbclient_options ); + } + + break; + } + default: + { + // Something went wrong. Stop here. + return; + } + } + + *m_proc << command; + + startProcess( Search ); +} + + +/**************************************************************************** + Starts the process of the scanner. +****************************************************************************/ + +void Smb4KScanner::startProcess( int state ) +{ + m_state = state; + m_buffer = QString::null; + + if ( state != Info ) + { + QApplication::setOverrideCursor( waitCursor ); + } + + m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput ); +} + + +/**************************************************************************** + End the process and tell, what to do with the data. +****************************************************************************/ + +void Smb4KScanner::endProcess() +{ + switch ( m_state ) + { + case Workgroups: + case QueryHost: + processWorkgroups(); + break; + case IPScan: + processIPScan(); + break; + case Hosts: + processWorkgroupMembers(); + break; + case Shares: + processShares(); + break; + case Info: + processInfo(); + break; + case Search: + processSearch(); + break; + default: + break; + } + + m_state = Idle; + + m_priv->clearData(); + + QApplication::restoreOverrideCursor(); + + m_proc->clearArguments(); + + m_working = false; + + emit state( SCANNER_STOP ); +} + + +/**************************************************************************** + Process the list of workgroups. +****************************************************************************/ + +void Smb4KScanner::processWorkgroups() +{ + QStringList list = QStringList::split( '\n', m_buffer, false ); + + for ( QValueList::Iterator it = m_workgroups_list->begin(); it != m_workgroups_list->end(); ++it ) + { + delete *it; + } + + for ( QValueList::Iterator it = m_hosts_list->begin(); it != m_hosts_list->end(); ++it ) + { + delete *it; + } + + m_workgroups_list->clear(); + m_hosts_list->clear(); + + if ( m_state == Workgroups ) + { + QString workgroup, master, ip; + + for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + { + if ( (*it).stripWhiteSpace().startsWith( "Looking" ) ) + { + ip = (*it).section( "of", 1, 1 ).stripWhiteSpace(); + + continue; + } + else if ( (*it).contains( "<00>" ) != 0 && (*it).contains( "" ) == 0 ) + { + if ( workgroup.isEmpty() && master.isEmpty() && !ip.isEmpty() ) + { + master = (*it).section( "<00>", 0, 0 ).stripWhiteSpace(); + } + + continue; + } + else if ( (*it).contains( "<00>" ) != 0 && (*it).contains( "" ) != 0 ) + { + if ( workgroup.isEmpty() && !master.isEmpty() && !ip.isEmpty() ) + { + workgroup = (*it).left( (*it).find( "<00>" ) ).stripWhiteSpace(); + + m_workgroups_list->append( new Smb4KWorkgroupItem( workgroup, master, ip ) ); + + Smb4KHostItem *master_item = new Smb4KHostItem( workgroup, master, QString::null, ip ); + master_item->setMaster( true ); + + m_hosts_list->append( master_item ); + + workgroup = QString::null; + master = QString::null; + ip = QString::null; + } + + continue; + } + } + } + else if ( m_state == QueryHost ) + { + bool process = false; + + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + QString line = (*it).stripWhiteSpace(); + + if ( line.startsWith( "-------------" ) ) + { + process = true; + + continue; + } + + if ( process && !line.isEmpty() ) + { + QString workgroup = line.section( " ", 0, 0 ).stripWhiteSpace(); + QString master = line.section( " ", 1, -1 ).stripWhiteSpace(); + + m_workgroups_list->append( new Smb4KWorkgroupItem( workgroup, master, QString::null ) ); + + Smb4KHostItem *master_item = new Smb4KHostItem( workgroup, master ); + master_item->setMaster( true ); + + m_hosts_list->append( master_item ); + + continue; + } + else + { + continue; + } + } + } + + lookupIPAddresses(); + + emit workgroups( *m_workgroups_list ); + emit hostListChanged(); +} + + +/**************************************************************************** + Process the data from the IP range scan +****************************************************************************/ + +void Smb4KScanner::processIPScan() +{ + QStringList list = QStringList::split( '\n', m_buffer, true ); + + for ( QValueList::Iterator it = m_workgroups_list->begin(); it != m_workgroups_list->end(); ++it ) + { + delete *it; + } + + for ( QValueList::Iterator it = m_hosts_list->begin(); it != m_hosts_list->end(); ++it ) + { + delete *it; + } + + m_workgroups_list->clear(); + m_hosts_list->clear(); + + // Process the data: + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( (*it).startsWith( "Looking up status of" ) ) + { + QString workgroup, host, ip; + bool master = false; + + // Get the IP address of this host. + ip = (*it).section( "of", 1, 1 ).stripWhiteSpace(); + + // Loop through the data: + for ( QStringList::ConstIterator i = it; i != list.end(); ++i ) + { + if ( (*i).contains( " <00> " ) != 0 ) + { + if ( (*i).contains( " " ) != 0 ) + { + workgroup = (*i).section( "<00>", 0, 0 ).stripWhiteSpace(); + } + else + { + host = (*i).section( "<00>", 0, 0 ).stripWhiteSpace(); + } + + continue; + } + else if ( (*i).contains( "__MSBROWSE__" ) != 0 && (*i).contains( " <01> " ) != 0 ) + { + master = true; + + continue; + } + else if ( (*i).contains( "MAC Address" ) != 0 || (*i).stripWhiteSpace().isEmpty() ) + { + it = i; + + break; + } + else + { + continue; + } + } + + if ( !workgroup.isEmpty() ) + { + Smb4KWorkgroupItem *workgroup_item = getWorkgroup( workgroup ); + + if ( workgroup_item ) + { + if ( master ) + { + workgroup_item->setMaster( host, ip ); + } + else + { + // Do nothing + } + } + else + { + if ( master ) + { + m_workgroups_list->append( new Smb4KWorkgroupItem( workgroup, host, ip ) ); + } + else + { + m_workgroups_list->append( new Smb4KWorkgroupItem( workgroup, QString::null, QString::null ) ); + } + } + + Smb4KHostItem *host_item = new Smb4KHostItem( workgroup, host, QString::null, ip ); + host_item->setMaster( master ); + + m_hosts_list->append( host_item ); + } + else + { + // Do nothing + } + } + else + { + continue; + } + } + + // No extra lookup of IP addresses is needed since + // we searched for IP addresses. :) + + emit workgroups( *m_workgroups_list ); + emit members( m_priv->workgroup(), *m_hosts_list ); + emit hostListChanged(); +} + + +/**************************************************************************** + Process the member list of a workgroup. +****************************************************************************/ + +void Smb4KScanner::processWorkgroupMembers() +{ + QStringList list = QStringList::split( '\n', m_buffer, false ); + + switch ( Smb4KSettings::browseList() ) + { + case Smb4KSettings::EnumBrowseList::LookupDomains: + case Smb4KSettings::EnumBrowseList::QueryCurrentMaster: + case Smb4KSettings::EnumBrowseList::QueryCustomMaster: + { + if ( m_buffer.contains( "NT_STATUS_ACCESS_DENIED" ) != 0 || + m_buffer.contains( "NT_STATUS_LOGON_FAILURE" ) != 0 || + m_buffer.contains( "The username or password was not correct" ) != 0 ) + { + // Authentication failed: + emit failed(); + + if ( passwordHandler()->askpass( m_priv->workgroup(), m_priv->host(), + QString::null, Smb4KPasswordHandler::AccessDenied, + kapp->mainWidget() ? kapp->mainWidget() : 0, "AskPass" ) ) + { + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4" ).arg( Hosts ).arg( m_priv->workgroup(), m_priv->host(), m_priv->ip() ) ) ); + } + + return; + } + else if ( m_buffer.contains( "Could not connect to server" ) != 0 || + m_buffer.contains( "Unable to find a suitable server" ) != 0 || + m_buffer.contains( "Invalid ip address specified" ) != 0 ) + { + // If the IP address is empty, the shell output contains + // the IP address. Remove it, because it will confuse + // the user: + if ( m_priv->ip().isEmpty() ) + { + list.remove( list.first() ); + } + + // Notify the rest of the program, that something went wrong. + emit failed(); + + // Notify the user: + Smb4KError::error( ERROR_GETTING_MEMBERS, QString::null, list.join( "\n" ) ); + + return; + } + else + { + // Do nothing + } + + QValueList hosts; + + bool process = false; + + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + QString line = (*it).stripWhiteSpace(); + + if ( !process ) + { + // Find the IP address in case we did not know it at the beginning + // of the scan process and put it into m_priv.ip(): + if ( m_priv->ip().isEmpty() && line.startsWith( "***" ) && line.endsWith( "***" ) ) + { + m_priv->setIP( line.section( ":", 1, 1 ).section( "***", 0, 0 ).stripWhiteSpace() ); + + continue; + } + + // Find the line after that we will have to process the output + // to get the servers belonging to this workgroup: + if ( line.startsWith( "-------------" ) ) + { + process = true; + + continue; + } + + continue; + } + else + { + if ( !line.isEmpty() ) + { + QString host, comment; + + if ( line.contains( " " ) == 0 ) + { + host = line; + } + else + { + host = line.section( " ", 0, 0 ).stripWhiteSpace(); + comment = line.section( " ", 1, -1 ).stripWhiteSpace(); + } + + Smb4KHostItem *item = new Smb4KHostItem( m_priv->workgroup(), host, comment ); + + if ( QString::compare( item->name(), m_priv->host() ) == 0 ) + { + // The item is identical to the master browser! Give the + // respective workgroup item the IP address of the master + // if it is not already present. + Smb4KWorkgroupItem *workgroupItem = getWorkgroup( m_priv->workgroup() ); + + if ( workgroupItem && workgroupItem->masterIP().isEmpty() ) + { + workgroupItem->setMasterIP( m_priv->ip() ); + } + + // Set the IP address for new item (we only know it at this point, + // because this is the workgroup master): + item->setIPAddress( m_priv->ip() ); + // Set it to be the master: + item->setMaster( true ); + } + + hosts.append( item ); + + continue; + } + else + { + continue; + } + } + } + + // If the list is empty, put the master in. + if ( hosts.isEmpty() ) + { + Smb4KHostItem *item = new Smb4KHostItem( m_priv->workgroup(), m_priv->host() ); + item->setMaster( true ); + + hosts.append( item ); + } + + emit members( m_priv->workgroup(), hosts ); + + // Now put the hosts in m_hosts_list: + for ( QValueList::Iterator it = m_hosts_list->begin(); it != m_hosts_list->end(); ++it ) + { + if ( QString::compare( (*it)->workgroup(), m_priv->workgroup() ) == 0 ) + { + bool found = false; + + for ( QValueList::Iterator i = hosts.begin(); i != hosts.end(); ++i ) + { + if ( *i && QString::compare( (*i)->name(), (*it)->name() ) == 0 ) + { + found = true; + + // The only thing that might be missing is the comment. + (*it)->setComment( (*i)->comment() ); + + delete *i; + *i = NULL; + + break; + } + else + { + continue; + } + } + + if ( !found ) + { + delete *it; + *it = NULL; + } + } + else + { + continue; + } + } + + m_hosts_list->remove( NULL ); + hosts.remove( NULL ); + + // Append the list: + *m_hosts_list += hosts; + + // Lookup IP addresses. + lookupIPAddresses(); + + break; + } + case Smb4KSettings::EnumBrowseList::ScanBroadcastAreas: + { + if ( m_buffer.contains( "NT_STATUS_ACCESS_DENIED" ) != 0 || + m_buffer.contains( "NT_STATUS_LOGON_FAILURE" ) != 0 || + m_buffer.contains( "The username or password was not correct" ) != 0 ) + { + // Authentication failed: + emit failed(); + + if ( passwordHandler()->askpass( m_priv->workgroup(), m_priv->host(), + QString::null, Smb4KPasswordHandler::AccessDenied, + kapp->mainWidget() ? kapp->mainWidget() : 0, "AskPass" ) ) + { + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4" ).arg( Hosts ).arg( m_priv->workgroup(), m_priv->host(), m_priv->ip() ) ) ); + } + + return; + } + else if ( m_buffer.contains( "Could not connect to server" ) != 0 || + m_buffer.contains( "Unable to find a suitable server" ) != 0 || + m_buffer.contains( "Invalid ip address specified" ) != 0 ) + { + // We are in IP scan mode, so we can ignore the error and emit + // what we already have: + emit members( m_priv->workgroup(), *m_hosts_list ); + emit hostListChanged(); + + return; + } + + // We will not remove any host from the list in IP scan mode, + // but we will add additional infomation, if available. + + bool process = false; + + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( (*it).stripWhiteSpace().startsWith( "-------------" ) ) + { + process = true; + + continue; + } + + if ( process && !(*it).stripWhiteSpace().isEmpty() ) + { + QString line = (*it).stripWhiteSpace(); + + // Extract host name and comment: + QString host, comment; + + if ( line.contains( " " ) == 0 ) + { + host = line; + } + else + { + host = line.section( " ", 0, 0 ).stripWhiteSpace(); + comment = line.section( " ", 1, -1 ).stripWhiteSpace(); + } + + // Now add the comment to the host item or do nothing if + // no comment was found: + if ( !comment.isEmpty() ) + { + Smb4KHostItem *item = getHost( host, m_priv->workgroup() ); + + if ( item ) + { + item->setComment( comment ); + } + + continue; + } + else + { + continue; + } + } + } + + emit members( m_priv->workgroup(), *m_hosts_list ); + + break; + } + default: + { + break; + } + } + + emit hostListChanged(); +} + + +/**************************************************************************** + Process the share list of a host. +****************************************************************************/ + +void Smb4KScanner::processShares() +{ + // Error handling + if ( m_buffer.contains( "The username or password was not correct.", true ) != 0 || + m_buffer.contains( "NT_STATUS_ACCOUNT_DISABLED" ) != 0 /* Active Directory error */ ) + { + // Authentication failed: + emit failed(); + + if ( passwordHandler()->askpass( m_priv->workgroup(), m_priv->host(), QString::null, Smb4KPasswordHandler::AccessDenied, kapp->mainWidget() ? kapp->mainWidget() : 0, "AskPass" ) ) + { + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4:%5" ).arg( Shares ).arg( m_priv->workgroup(), m_priv->host(), m_priv->ip(), QString::null ) ) ); + } + + return; + } + else if ( m_buffer.contains( "could not obtain sid for domain", true ) != 0 ) + { + // FIXME: Does this error only occur when we scan a server that is + // only capable of the RAP protocol or also under other conditions? + m_queue.enqueue( new QString( QString( "%1:%2:%3:%4:%5" ).arg( Shares ).arg( m_priv->workgroup(), m_priv->host(), m_priv->ip(), "rap" ) ) ); + + m_priv->retry = true; + + return; + } + else if ( (m_buffer.contains( "Could not connect to server", true ) != 0 && + m_buffer.contains( "The username or password was not correct.", true ) == 0) || + m_buffer.contains( "Unable to find a suitable server" ) != 0 ) + { + // We could not get the list of shares: + emit failed(); + + // Notify the user: + Smb4KError::error( ERROR_GETTING_SHARES, QString::null, m_buffer ); + + return; + } + + QStringList list = QStringList::split( '\n', m_buffer, false ); + + QValueList share_list; + + bool process = false; + + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( (*it).startsWith( "---" ) ) + { + process = true; + } + + if ( process ) + { + QString name, type, comment; + + if ( (*it).contains( " Disk ", true ) != 0 ) + { + name = (*it).section( " Disk ", 0, 0 ).stripWhiteSpace(); + type = "Disk"; + comment = (*it).section( " Disk ", 1, 1 ).stripWhiteSpace(); + } + else if ( (*it).contains( " Print ", true ) != 0 ) + { + name = (*it).section( " Print ", 0, 0 ).stripWhiteSpace(); + type = "Printer"; + comment = (*it).section( " Print ", 1, 1 ).stripWhiteSpace(); + } + else if ( (*it).contains( " IPC ", true ) != 0 ) + { + name = (*it).section( " IPC ", 0, 0 ).stripWhiteSpace(); + type = "IPC"; + comment = (*it).section( " IPC ", 1, 1 ).stripWhiteSpace(); + } + else + { + continue; + } + + share_list.append( new Smb4KShareItem( m_priv->workgroup(), m_priv->host(), name, type, comment ) ); + } + else + { + continue; + } + } + + emit shares( m_priv->host(), share_list ); +} + + +/**************************************************************************** + Process the search data. +****************************************************************************/ + +void Smb4KScanner::processSearch() +{ + // NOTE: We do not emit Smb4KScanner::failed() here, because + // errors are handled in a different way by the search dialog. + + // Stop right here if the user searched for illegal + // strings like #, ', () etc. + if ( m_buffer.contains( "Usage:", true ) != 0 || + m_buffer.contains( "/bin/sh:", true ) != 0 ) + { + emit searchResult( new Smb4KHostItem() ); + + return; + } + + QStringList data = QStringList::split( '\n', m_buffer.stripWhiteSpace(), false ); + + switch ( Smb4KSettings::searchMethod() ) + { + case Smb4KSettings::EnumSearchMethod::Nmblookup: + { + if ( !data.isEmpty() ) + { + // The last entry in the list is the workgroup: + QString workgroup = data.last().stripWhiteSpace(); + QString host, ip; + + if ( m_priv->host().contains( ".", true ) != 3 ) + { + // The IP address is in the first entry: + ip = data.first().stripWhiteSpace().section( " ", 0, 0 ); + // The host. + host = m_priv->host().upper(); + } + else + { + ip = m_priv->host(); + host = data[0].stripWhiteSpace(); + } + + emit searchResult( new Smb4KHostItem( workgroup, host, QString::null, ip ) ); + } + else + { + emit searchResult( new Smb4KHostItem() ); + } + + break; + } + case Smb4KSettings::EnumSearchMethod::Smbclient: + { + if ( data.count() > 1 && !data[1].isEmpty() ) + { + if ( m_buffer.contains( QString( "Connection to %1 failed" ).arg( m_priv->host() ) ) != 0 ) + { + emit searchResult( new Smb4KHostItem() ); + } + else + { + QString workgroup = data.grep( "Domain" ).first().section( "Domain=[", 1, 1 ).section( "]", 0, 0 ); + QString ip = data.grep( "Got a positive name query" ).first().section( "(", 1, 1 ).section( ")", 0, 0 ).stripWhiteSpace(); + + emit searchResult( new Smb4KHostItem( workgroup, m_priv->host().upper(), QString::null, ip ) ); + } + } + else + { + emit searchResult( new Smb4KHostItem() ); + } + + break; + } + default: + { + break; + } + } +} + + +/**************************************************************************** + Process the information about a host. +****************************************************************************/ + +void Smb4KScanner::processInfo() +{ + if ( m_proc->normalExit() ) + { + QStringList list = QStringList::split( '\n', m_buffer, false ); + + Smb4KHostItem *host = getHost( m_priv->host(), m_priv->workgroup() ); + + if ( host ) + { + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( (*it).stripWhiteSpace().startsWith( "Domain" ) || (*it).stripWhiteSpace().startsWith( "OS" ) ) + { + // The OS string. + host->setOSString( (*it).section( "OS=[", 1, 1 ).section( "]", 0, 0 ).stripWhiteSpace() ); + + // The Server string. + host->setServerString( (*it).section( "Server=[", 1, 1 ).section( "]", 0, 0 ).stripWhiteSpace() ); + + break; + } + else if ( (*it).contains( "Connection to", true ) != 0 ) + { + // The lookup of the info failed: + emit failed(); + + break; + } + } + + emit info( host ); + } + } + else + { + // In case the process was aborted, we need to enable checking + // again: + Smb4KHostItem *host = getHost( m_priv->host(), m_priv->workgroup() ); + + if ( host ) + { + host->setInfoChecked( false ); + } + } +} + + +/**************************************************************************** + Get a workgroup item out of the workgroup list. +****************************************************************************/ + +Smb4KWorkgroupItem *Smb4KScanner::getWorkgroup( const QString &workgroup ) +{ + QValueListIterator it; + + for ( it = m_workgroups_list->begin(); it != m_workgroups_list->end(); ++it ) + { + if ( QString::compare( (*it)->name(), workgroup ) == 0 ) + { + break; + } + else + { + continue; + } + } + + return it == m_workgroups_list->end() ? NULL : *it; +} + + +/**************************************************************************** + Get a workgroup item out of the workgroup list. +****************************************************************************/ + +Smb4KHostItem *Smb4KScanner::getHost( const QString &name, const QString &workgroup ) +{ + QValueListIterator it; + + for ( it = m_hosts_list->begin(); it != m_hosts_list->end(); ++it ) + { + if ( !workgroup.stripWhiteSpace().isEmpty() && + QString::compare( (*it)->workgroup().upper(), workgroup.upper() ) != 0 ) + { + continue; + } + + if ( QString::compare( (*it)->name().upper(), name.upper() ) == 0 ) + { + break; + } + else + { + continue; + } + } + + return it == m_hosts_list->end() ? NULL : *it; +} + + +/**************************************************************************** + Add a host to the host list +****************************************************************************/ + +void Smb4KScanner::insertHost( Smb4KHostItem *host ) +{ + if ( host && !getHost( host->name(), host->workgroup() ) ) + { + // Use the copy constructor here, so that we do not run into + // trouble when/if host is deleted. + Smb4KHostItem *host_item = new Smb4KHostItem( *host ); + + m_hosts_list->append( host_item ); + + // Check if the workgroup is already known. If not, create a new Smb4KWorkgroupItem, + // declare the host a pseudo master and add the workgroup to the list. + if ( !getWorkgroup( host_item->workgroup() ) ) + { + Smb4KWorkgroupItem *workgroup_item = new Smb4KWorkgroupItem( host_item->workgroup(), + host_item->name(), host_item->ip() ); + workgroup_item->setPseudoMaster(); + host_item->setMaster( true ); // pseudo master + + appendWorkgroup( workgroup_item ); + } + + // Lookup at least the IP address of this host, if necessary: + if ( host_item->ip().isEmpty() ) + { + lookupIPAddresses(); + } + + emit hostAdded( host_item ); + + emit hostListChanged(); + } +} + + +/**************************************************************************** + Appends an item to the list of workgroups. +****************************************************************************/ + +void Smb4KScanner::appendWorkgroup( Smb4KWorkgroupItem *item ) +{ + if ( !getWorkgroup( item->name() ) ) + { + m_workgroups_list->append( item ); + + emit workgroups( *m_workgroups_list ); + } +} + + +void Smb4KScanner::timerEvent( QTimerEvent * ) +{ + // Look for the thing to do (next). + // At this point, the topmost item will not be + // dequeued. This will be done below. + int todo = Idle; + QString *head = NULL; + + if ( (head = m_queue.head()) != 0 ) + { + todo = head->section( ":", 0, 0 ).toInt(); + } + + if ( !m_working && !m_queue.isEmpty() ) + { + // Start processing with dequeueing the item: + QString *item = m_queue.dequeue(); + + // Tell the program, that the scanner is running. + m_working = true; + + switch ( todo ) + { + case Init: + { + emit state( SCANNER_INIT ); + scanNetwork(); + break; + } + case Hosts: + { + emit state( SCANNER_OPENING_WORKGROUP ); + scanForWorkgroupMembers( item->section( ":", 1, 1 ), item->section( ":", 2, 2 ), item->section( ":", 3, 3 ) ); + break; + } + case Shares: + { + if ( !m_priv->retry ) + { + emit state( SCANNER_OPENING_HOST ); + } + else + { + emit state( SCANNER_RETRYING_OPENING_HOST ); + m_priv->retry = false; + } + scanForShares( item->section( ":", 1, 1 ), item->section( ":", 2, 2 ), item->section( ":", 3, 3 ), item->section( ":", 4, 4 ) ); + break; + } + case Info: + { + emit state( SCANNER_RETRIEVING_INFO ); + scanForInfo( item->section( ":", 1, 1 ), item->section( ":", 2, 2 ), item->section( ":", 3, 3 ) ); + break; + } + case Search: + { + emit state( SCANNER_SEARCHING ); + searchForHost( item->section( ":", 1, 1 ) ); + break; + } + default: + break; + } + + delete item; + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + + +/**************************************************************************** + Internal slots. +****************************************************************************/ + +void Smb4KScanner::slotReceivedStdout( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + +void Smb4KScanner::slotProcessExited( KProcess * ) +{ + endProcess(); +} + + +void Smb4KScanner::slotReceivedStderr( KProcess *, char *buf, int len ) +{ + m_buffer.append( QString::fromLocal8Bit( buf, len ) ); +} + + + +/*************************************************************************** + * * + * Lookup for IP addresses * + * * + ***************************************************************************/ + +/**************************************************************************** + Start the scanning for IP addresses +****************************************************************************/ + +void Smb4KScanner::lookupIPAddresses() +{ + bool start = false; + QString command = QString::null; + + for ( QValueList::ConstIterator it = m_hosts_list->begin(); it != m_hosts_list->end(); ++it ) + { + if ( (*it)->ip().stripWhiteSpace().isEmpty() && !(*it)->ipAddressChecked() ) + { + if ( !start ) + { + start = true; + } + + (*it)->setIPAddressChecked( true ); + + command.append( "nmblookup" ); + command.append( optionsHandler()->nmblookupOptions() ); + command.append( optionsHandler()->winsServer().isEmpty() ? "" : " -R -U "+KProcess::quote( optionsHandler()->winsServer() ) ); + command.append( " -- "+KProcess::quote( (*it)->name() )+" | grep '<00>'" ); + command.append( " ; " ); + + continue; + } + else + { + continue; + } + } + + command.truncate( command.length() - 3 ); + + if ( start ) + { + KProcess *proc = new KProcess( this ); + proc->setUseShell( true ); + + connect( proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedIPAddresses( KProcess *, char *, int ) ) ); + connect( proc, SIGNAL( processExited( KProcess * ) ), + this, SLOT( slotIPAddressProcessExited( KProcess * ) ) ); + + *proc << command; + proc->start( KProcess::NotifyOnExit, KProcess::Stdout ); + } +} + + +/**************************************************************************** + Processes IP addresses if data occurrs on stdout. +****************************************************************************/ + +void Smb4KScanner::slotReceivedIPAddresses( KProcess *, char *buf, int len ) +{ + // WARNING: Do not implement error handling here!!! + + QString buffer = QString::fromLocal8Bit( buf, len ); + + if ( !buffer.stripWhiteSpace().isEmpty() ) + { + QString ip = buffer.stripWhiteSpace().section( " ", 0, 0 ).stripWhiteSpace(); + QString host = buffer.stripWhiteSpace().section( " ", 1, 1 ).section( "<00>", 0, 0 ).stripWhiteSpace(); + + if ( !host.isEmpty() && !ip.isEmpty() ) + { + Smb4KHostItem *item = getHost( host ); + + if ( item ) + { + item->setIPAddress( ip ); + + if ( item->isMaster() ) + { + Smb4KWorkgroupItem *workgroup = getWorkgroup( item->workgroup() ); + + if ( workgroup ) + { + workgroup->setMasterIP( ip ); + } + } + + emit ipAddress( item ); + } + } + } +} + + +/**************************************************************************** + End IP address scan. +****************************************************************************/ + +void Smb4KScanner::slotIPAddressProcessExited( KProcess *p ) +{ + delete p; +} + + +#include "smb4kscanner.moc" diff --git a/smb4k/core/smb4kscanner.h b/smb4k/core/smb4kscanner.h new file mode 100644 index 0000000..3930d5e --- /dev/null +++ b/smb4k/core/smb4kscanner.h @@ -0,0 +1,485 @@ +/*************************************************************************** + smb4kscanner.h - The network scan core class of Smb4K. + ------------------- + begin : Sam Mai 31 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSCANNER_H +#define SMB4KSCANNER_H + +#ifndef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// KDE includes +#include + +// application specific includes +#include "smb4kdefs.h" + +// forward declarations +class Smb4KScannerPrivate; +class Smb4KWorkgroupItem; +class Smb4KHostItem; +class Smb4KShareItem; + + +/** + * This is the core class, that communicates with the network. All look-up + * stuff is done here. + * + * @author Alexander Reinholdt + */ + +class Smb4KScanner : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param workgroups A list of Smb4KWorkgroupItem items which will be filled by the scanner + * with the list of available workgroups. If a NULL pointer is passed, a + * private list will be created which cannot be accessed from outside. + * + * @param hosts A list of Smb4KHostItem items which will be filled by the scanner. + * with the list of available hosts. If a NULL pointer is passed, a + * private list will be created which cannot be accessed from outside. + * + * @param parent The parent of this class. + * + * @param name The name of this class. + */ + Smb4KScanner( QValueList *workgroups = 0, + QValueList *hosts = 0, + QObject *parent = 0, + const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KScanner(); + + /** + * Initiates a network scan. + * + * Please not that after having invoked this function, the list of workgroups + * as well as the list of known hosts will be cleared and refilled. Thus, all + * known hosts except the current workgroup master browsers will have been + * vanished. + */ + void rescan(); + + /** + * Aborts the network scan. + */ + void abort(); + + /** + * Reads the options. + */ + void readOptions(); + + /** + * Scan for the shares on a selected host. + * + * @param workgroup The workgroup of the host you want to scan. + * + * @param host The host you want to scan. + * + * @param ip The IP address of the host. + * + * @param protocol With this argument you can force a special protocol + * the net command has to use. Normally, you do not have + * to set here anything. + */ + void getShares( const QString &workgroup, + const QString &host, + const QString &ip, + const QString &protocol = QString::null ); + + /** + * Scans for workgroup members. + * + * @param workgroup The workgroup of the master browser that should be scanned. + * + * @param master The name of the master browser. + * + * @param ip The IP address of the master browser. + */ + void getWorkgroupMembers( const QString &workgroup, + const QString &master, + const QString &ip ); + + /** + * Get more info about a share (i.e. server and OS string, etc.). + * + * @param workgroup The workgroup of the host + * + * @param host The host's name + * + * @param ip The host's IP address + */ + void getInfo( const QString &workgroup, + const QString &host, + const QString &ip ); + + /** + * Starts the search for a host that matches @p string. If the host is already + * in the list of known hosts, this function immediately emits the searchResult() + * signal with the Smb4KHostItem representing the host. If this is not the case, + * a search process is started. + * + * @param string The user supplied search string. + */ + void search( const QString &string ); + + /** + * This function returns an Smb4KWorkgroupItem, if the the workgroup + * exists in the list, or NULL, if it does not. + * + * @param workgroup The name of the workgroup + */ + Smb4KWorkgroupItem *getWorkgroup( const QString &workgroup ); + + /** + * This function reports if the scanner is running or not. + * + * @returns TRUE if the scanner is running and FALSE otherwise. + */ + bool isRunning() { return m_working; } + + /** + * This function returns the specified host item, or NULL, if this host was not found. + * The name of the host is mandatory. The workgroup may be empty, but should be given, + * because this will speed up the search process. + * + * @param name The name of the host + * + * @param workgroup The workgroup of the host item + * + * @returns A host item + */ + Smb4KHostItem *getHost( const QString &name, + const QString &workgroup = QString::null ); + + /** + * This function inserts a @p host into the list of known servers. If it belongs to + * a workgroup that was not known until now, a new Smb4KWorkgroupItem item is also + * created and added to the list of known workgroups. @p host is then marked as + * pseudo master browser. On success, the this function emits the hostAdded() and + * hostListChanged() signals. If the host is already in the known, nothing is done. + * + * @param host The host that should be inserted + */ + void insertHost( Smb4KHostItem *host ); + + /** + * This function initializes the network scan It just executes the rescan() function, + * so you can also use that instead. + */ + void init(); + + signals: + /** + * This signal emits the run state. + * + * @param state The so-called run state. There are several defined + * in the smb4kdefs.h header file. + */ + void state( int state ); + + /** + * This signal is emitted, when the workgroup list has been updated. + * + * @param list The list of workgroups in the network neighborhood. + */ + void workgroups( const QValueList &list ); + + /** + * Emits the list of workgroup members. + * + * @param workgroup The workgroup in which the members are located + * + * @param list The list of workgroup members. + */ + void members( const QString &workgroup, const QValueList &list ); + + /** + * Emits the list of shares. + * + * @param host The host that carries the shares + * + * @param list The list of shares + */ + void shares( const QString &host, const QValueList &list ); + + /** + * This signal provides info about a certain host. It passes the server + * and the OS string. + */ + void info( Smb4KHostItem *host ); + + /** + * Is emitted, when the results of a network search are to be passed. + */ + void searchResult( Smb4KHostItem *host ); + + /** + * This signal emits the host item for which an IP address has + * been found. + * + * @param host The host item with the new IP address + */ + void ipAddress( Smb4KHostItem *host ); + + /** + * This signal is emitted when the list of hosts is changed. + */ + void hostListChanged(); + + /** + * This signal is emitted if a request could not be processed + * successfully. + */ + void failed(); + + /** + * This signal is emitted when a host has been added to the list of known + * hosts via the addHost() function. + * + * @param host The Smb4KHostItem that represents the host that + * was added. + */ + void hostAdded( Smb4KHostItem *host ); + + protected: + /** + * Starts the process. + * + * @param state The state + */ + void startProcess( int state ); + + /** + * Is called, when the main process ends. + */ + void endProcess(); + + /** + * Processes the output of the network group scan. + */ + void processWorkgroups(); + + /** + * Processes the list of workgroup members retrieved by + * scanning the workgroup master browser. + */ + void processWorkgroupMembers(); + + /** + * Processes the output of the host scan. + */ + void processShares(); + + /** + * Processes the output of the scan for the OS and Server + * string. + */ + void processInfo(); + + /** + * Processes the output of a search request. + */ + void processSearch(); + + /** + * Process the data from the IP range scan. + */ + void processIPScan(); + + /** + * Reimplemented from QObject + */ + void timerEvent( QTimerEvent *e ); + + protected slots: + /** + * Is called, if something is received on stdout from the main process. + * + * @param proc The process + * + * @param buf The buffer + * + * @param len The length of the buffer + */ + void slotReceivedStdout( KProcess *proc, + char *buf, + int len ); + + /** + * Is called, when the KProcess exited. + * + * @param proc The process that exited + */ + void slotProcessExited( KProcess *proc ); + + /** + * Is called, if something is received on stderr from the main process. + * + * @param proc The process + * + * @param buf The buffer + * + * @param len The length of the buffer + */ + void slotReceivedStderr( KProcess *proc, + char *buf, + int len ); + + /** + * Is called when the scan for IP addresses produced output on stdout. + * + * @param proc The process + * + * @param buf The buffer + * + * @param len The length of the buffer + */ + void slotReceivedIPAddresses( KProcess *proc, + char *buf, + int len ); + + /** + * Is called, when the KProcess exited. + * + * @param proc The process that exited + */ + void slotIPAddressProcessExited( KProcess *proc ); + + + private: + /** + * Initiates the (re-)scan of the network to retrieve the initial + * browse list. + */ + void scanNetwork(); + + /** + * Scans the group master for the group members. + */ + void scanForWorkgroupMembers( const QString &workgroup, + const QString &master, + const QString &ip ); + + /** + * Scans the chosen host for its shares. This is the private part + * of @see Smb4KScanner::getShares(). + */ + void scanForShares( const QString &workgroup, + const QString &host, + const QString &ip, + const QString &protocol ); + + /** + * Scans a given host for its OS and Server string. + */ + void scanForInfo( const QString &workgroup, + const QString &host, + const QString &ip ); + + /** + * Searches for a given host. + */ + void searchForHost( const QString &host ); + + /** + * This function initializes the lookup of IP addresses. + */ + void lookupIPAddresses(); + + /** + * This function takes an Smb4KWorkgroupItem and appends it to the list, + * if the represented workgroup isn't already in it. + */ + void appendWorkgroup( Smb4KWorkgroupItem *item ); + + /** + * Internal enumeration. + */ + enum TODO{ Workgroups, QueryHost, IPScan, Hosts, Shares, Info, Search, Init, Idle }; + + /** + * The main KProcess object. + */ + KProcess *m_proc; + + /** + * The buffer for the main process. + */ + QString m_buffer; + + /** + * This queue stores the incoming requests until they are processed. + */ + QPtrQueue m_queue; + + /** + * Is set to true, if the scanner is running. + */ + bool m_working; + + /** + * The list of workgroups including the master browser and their + * IP addresses. + */ + QValueList *m_workgroups_list; + + /** + * This list contains all hosts, that are found by the scanner and + * that are currently active. + */ + QValueList *m_hosts_list; + + /** + * The internal state of the main process. Do not mix this up with + * the state that's emitted to notify the application about changes. + */ + int m_state; + + /** + * This is the pointer to the private helper class. + */ + Smb4KScannerPrivate *m_priv; + + /** + * The timer id + */ + int m_timer_id; +}; +#endif diff --git a/smb4k/core/smb4kscanner_p.cpp b/smb4k/core/smb4kscanner_p.cpp new file mode 100644 index 0000000..a4e03c3 --- /dev/null +++ b/smb4k/core/smb4kscanner_p.cpp @@ -0,0 +1,96 @@ +/*************************************************************************** + smb4kscanner_p - This is a private helper class for Smb4KScanner. + ------------------- + begin : Do Jul 19 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// application specific includes +#include "smb4kscanner_p.h" + + +Smb4KScannerPrivate::Smb4KScannerPrivate() +{ + retry = false; + clearData(); +} + + +Smb4KScannerPrivate::~Smb4KScannerPrivate() +{ +} + + +void Smb4KScannerPrivate::clearData() +{ + m_workgroup = QString::null; + m_host = QString::null; + m_ip = QString::null; + m_share = QString::null; +} + + +void Smb4KScannerPrivate::setWorkgroup( const QString &w ) +{ + m_workgroup = w; +} + + +void Smb4KScannerPrivate::setHost( const QString &h ) +{ + m_host = h; +} + + +void Smb4KScannerPrivate::setIP( const QString &i ) +{ + m_ip = i; +} + + +void Smb4KScannerPrivate::setShare( const QString &s ) +{ + m_share = s; +} + + +const QString &Smb4KScannerPrivate::workgroup() +{ + return m_workgroup; +} + + +const QString &Smb4KScannerPrivate::host() +{ + return m_host; +} + + +const QString &Smb4KScannerPrivate::ip() +{ + return m_ip; +} + + +const QString &Smb4KScannerPrivate::share() +{ + return m_share; +} diff --git a/smb4k/core/smb4kscanner_p.h b/smb4k/core/smb4kscanner_p.h new file mode 100644 index 0000000..be0a364 --- /dev/null +++ b/smb4k/core/smb4kscanner_p.h @@ -0,0 +1,59 @@ +/*************************************************************************** + smb4kscanner_p - This is a private helper class for Smb4KScanner. + ------------------- + begin : Do Jul 19 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSCANNER_P_H +#define SMB4KSCANNER_P_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +class Smb4KScannerPrivate +{ + public: + Smb4KScannerPrivate(); + ~Smb4KScannerPrivate(); + bool retry; + void clearData(); + void setWorkgroup( const QString &w ); + void setHost( const QString &h ); + void setIP( const QString &i ); + void setShare( const QString &s ); + const QString &workgroup(); + const QString &host(); + const QString &ip(); + const QString &share(); + + private: + QString m_workgroup; + QString m_host; + QString m_ip; + QString m_share; +}; + +#endif diff --git a/smb4k/core/smb4ksettings.cpp b/smb4k/core/smb4ksettings.cpp new file mode 100644 index 0000000..3a88f66 --- /dev/null +++ b/smb4k/core/smb4ksettings.cpp @@ -0,0 +1,1092 @@ +// This file is generated by kconfig_compiler from smb4k.kcfg. +// All changes you do to this file will be lost. + +#include "smb4ksettings.h" + +#include + +#include + +Smb4KSettings *Smb4KSettings::mSelf = 0; +static KStaticDeleter staticSmb4KSettingsDeleter; + +Smb4KSettings *Smb4KSettings::self() +{ + if ( !mSelf ) { + staticSmb4KSettingsDeleter.setObject( mSelf, new Smb4KSettings() ); + mSelf->readConfig(); + } + + return mSelf; +} + +Smb4KSettings::Smb4KSettings( ) + : KConfigSkeleton( QString::fromLatin1( "smb4krc" ) ) +{ + mSelf = this; + setCurrentGroup( QString::fromLatin1( "Programs" ) ); + + mGrepItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "grep" ), mGrep ); + mGrepItem->setLabel( i18n("The path to the program \"grep\"") ); + addItem( mGrepItem, QString::fromLatin1( "grep" ) ); + mAwkItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "awk" ), mAwk ); + mAwkItem->setLabel( i18n("The path to the program \"awk\"") ); + addItem( mAwkItem, QString::fromLatin1( "awk" ) ); + mSedItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "sed" ), mSed ); + mSedItem->setLabel( i18n("The path to the program \"sed\"") ); + addItem( mSedItem, QString::fromLatin1( "sed" ) ); + mXargsItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "xargs" ), mXargs ); + mXargsItem->setLabel( i18n("The path to the program \"xargs\"") ); + addItem( mXargsItem, QString::fromLatin1( "xargs" ) ); + mRmdirItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "rmdir" ), mRmdir ); + mRmdirItem->setLabel( i18n("The path to the program \"rmdir\"") ); + addItem( mRmdirItem, QString::fromLatin1( "rmdir" ) ); + mNmblookupItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "nmblookup" ), mNmblookup ); + mNmblookupItem->setLabel( i18n("The path to the program \"nmblookup\"") ); + addItem( mNmblookupItem, QString::fromLatin1( "nmblookup" ) ); + mSmbclientItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smbclient" ), mSmbclient ); + mSmbclientItem->setLabel( i18n("The path to the program \"smbclient\"") ); + addItem( mSmbclientItem, QString::fromLatin1( "smbclient" ) ); + mSmbspoolItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smbspool" ), mSmbspool ); + mSmbspoolItem->setLabel( i18n("The path to the program \"smbspool\"") ); + addItem( mSmbspoolItem, QString::fromLatin1( "smbspool" ) ); + mNetItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "net" ), mNet ); + mNetItem->setLabel( i18n("The path to the program \"net\"") ); + addItem( mNetItem, QString::fromLatin1( "net" ) ); + mMount_cifsItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "mount_cifs" ), mMount_cifs ); + mMount_cifsItem->setLabel( i18n("The path to the program \"mount.cifs\"") ); + addItem( mMount_cifsItem, QString::fromLatin1( "mount_cifs" ) ); + mUmount_cifsItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "umount_cifs" ), mUmount_cifs ); + mUmount_cifsItem->setLabel( i18n("The path to the program \"umount.cifs\"") ); + addItem( mUmount_cifsItem, QString::fromLatin1( "umount_cifs" ) ); + mSmbmountItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smbmount" ), mSmbmount ); + mSmbmountItem->setLabel( i18n("The path to the program \"smbmount\"") ); + addItem( mSmbmountItem, QString::fromLatin1( "smbmount" ) ); + mSmbumountItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smbumount" ), mSmbumount ); + mSmbumountItem->setLabel( i18n("The path to the program \"smbumount\"") ); + addItem( mSmbumountItem, QString::fromLatin1( "smbumount" ) ); + mMountItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "mount" ), mMount ); + mMountItem->setLabel( i18n("The path to the program \"mount\"") ); + addItem( mMountItem, QString::fromLatin1( "mount" ) ); + mMount_smbfsItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "mount_smbfs" ), mMount_smbfs ); + mMount_smbfsItem->setLabel( i18n("The path to the program \"mount_smbfs\" (FreeBSD only)") ); + addItem( mMount_smbfsItem, QString::fromLatin1( "mount_smbfs" ) ); + mSmbutilItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smbutil" ), mSmbutil ); + mSmbutilItem->setLabel( i18n("The path to the program \"smbutil\" (FreeBSD only)") ); + addItem( mSmbutilItem, QString::fromLatin1( "smbutil" ) ); + mUmountItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "umount" ), mUmount ); + mUmountItem->setLabel( i18n("The path to the program \"umount\"") ); + addItem( mUmountItem, QString::fromLatin1( "umount" ) ); + mSmb4k_mountItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smb4k_mount" ), mSmb4k_mount ); + mSmb4k_mountItem->setLabel( i18n("The path to the program \"smb4k_mount\"") ); + addItem( mSmb4k_mountItem, QString::fromLatin1( "smb4k_mount" ) ); + mSmb4k_umountItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smb4k_umount" ), mSmb4k_umount ); + mSmb4k_umountItem->setLabel( i18n("The path to the program \"smb4k_umount\"") ); + addItem( mSmb4k_umountItem, QString::fromLatin1( "smb4k_umount" ) ); + mSmb4k_killItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smb4k_kill" ), mSmb4k_kill ); + mSmb4k_killItem->setLabel( i18n("The path to the program \"smb4k_kill\"") ); + addItem( mSmb4k_killItem, QString::fromLatin1( "smb4k_kill" ) ); + mSmb4k_catItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smb4k_cat" ), mSmb4k_cat ); + mSmb4k_catItem->setLabel( i18n("The path to the program \"smb4k_cat\"") ); + addItem( mSmb4k_catItem, QString::fromLatin1( "smb4k_cat" ) ); + mSmb4k_mvItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "smb4k_mv" ), mSmb4k_mv ); + mSmb4k_mvItem->setLabel( i18n("The path to the program \"smb4k_mv\"") ); + addItem( mSmb4k_mvItem, QString::fromLatin1( "smb4k_mv" ) ); + mSuperItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "super" ), mSuper ); + mSuperItem->setLabel( i18n("The path to the program \"super\" (optional)") ); + addItem( mSuperItem, QString::fromLatin1( "super" ) ); + mSudoItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "sudo" ), mSudo ); + mSudoItem->setLabel( i18n("The path to the program \"sudo\" (optional)") ); + addItem( mSudoItem, QString::fromLatin1( "sudo" ) ); + mDvipsItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "dvips" ), mDvips ); + mDvipsItem->setLabel( i18n("The path to the program \"dvips\" (optional)") ); + addItem( mDvipsItem, QString::fromLatin1( "dvips" ) ); + mEnscriptItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "enscript" ), mEnscript ); + mEnscriptItem->setLabel( i18n("The path to the program \"enscript\" (optional)") ); + addItem( mEnscriptItem, QString::fromLatin1( "enscript" ) ); + mRsyncItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "rsync" ), mRsync ); + mRsyncItem->setLabel( i18n("The path to the program \"rsync\" (optional)") ); + addItem( mRsyncItem, QString::fromLatin1( "rsync" ) ); + mKonsoleItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "konsole" ), mKonsole ); + mKonsoleItem->setLabel( i18n("The path to the program \"konsole\" (optional)") ); + addItem( mKonsoleItem, QString::fromLatin1( "konsole" ) ); + + setCurrentGroup( QString::fromLatin1( "UserInterface" ) ); + + mShowCustomBookmarkLabelItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowCustomBookmarkLabel" ), mShowCustomBookmarkLabel, true ); + mShowCustomBookmarkLabelItem->setLabel( i18n("Show custom bookmark label if available") ); + mShowCustomBookmarkLabelItem->setWhatsThis( i18n("Do not show the name of the share that is represented by the bookmark but the custom label that was defined in the bookmark editor.") ); + addItem( mShowCustomBookmarkLabelItem, QString::fromLatin1( "ShowCustomBookmarkLabel" ) ); + mEmbedIntoSystemTrayItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "EmbedIntoSystemTray" ), mEmbedIntoSystemTray, true ); + mEmbedIntoSystemTrayItem->setLabel( i18n("Embed application into system tray") ); + mEmbedIntoSystemTrayItem->setWhatsThis( i18n("Embed the application into the system tray. The system tray widget provides a popup menu with several commonly used tasks so that you do not need to bring up the main window everytime. If this setting is chosen you have to use \"Quit\" from the \"File\" menu or the system tray widget to exit the application.") ); + addItem( mEmbedIntoSystemTrayItem, QString::fromLatin1( "EmbedIntoSystemTray" ) ); + mStartMainWindowDockedItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "StartMainWindowDocked" ), mStartMainWindowDocked, false ); + mStartMainWindowDockedItem->setLabel( i18n("Start docked") ); + mStartMainWindowDockedItem->setWhatsThis( i18n("Start the application docked to the system tray, i.e. only the system tray widget is shown and the main window is hidden. You can bring the main window up by clicking on the system tray widget or by choosing \"Restore\" from its popup menu.") ); + addItem( mStartMainWindowDockedItem, QString::fromLatin1( "StartMainWindowDocked" ) ); + QValueList valuesSharesView; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "IconView" ); + valuesSharesView.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "ListView" ); + valuesSharesView.append( choice ); + } + mSharesViewItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "SharesView" ), mSharesView, valuesSharesView, EnumSharesView::IconView ); + mSharesViewItem->setLabel( i18n("How the shares should be displayed") ); + mSharesViewItem->setWhatsThis( i18n("Choose the kind of view you prefer for displaying the mounted shares. There is an icon view or a list view available.") ); + addItem( mSharesViewItem, QString::fromLatin1( "SharesView" ) ); + mShowPrinterSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowPrinterShares" ), mShowPrinterShares, true ); + mShowPrinterSharesItem->setLabel( i18n("Show printer shares") ); + mShowPrinterSharesItem->setWhatsThis( i18n("Printer shares will be displayed in the network browser.") ); + addItem( mShowPrinterSharesItem, QString::fromLatin1( "ShowPrinterShares" ) ); + mShowHiddenSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowHiddenShares" ), mShowHiddenShares, true ); + mShowHiddenSharesItem->setLabel( i18n("Show hidden shares") ); + mShowHiddenSharesItem->setWhatsThis( i18n("Hidden shares will be displayed in the network browser. Hidden shares are ending with a $ sign, e.g. Musik$ or IPC$.") ); + addItem( mShowHiddenSharesItem, QString::fromLatin1( "ShowHiddenShares" ) ); + mShowHiddenIPCSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowHiddenIPCShares" ), mShowHiddenIPCShares, true ); + mShowHiddenIPCSharesItem->setLabel( i18n("Show hidden IPC$ shares") ); + mShowHiddenIPCSharesItem->setWhatsThis( i18n("Hidden IPC$ shares will be displayed in the network browser.") ); + addItem( mShowHiddenIPCSharesItem, QString::fromLatin1( "ShowHiddenIPCShares" ) ); + mShowHiddenADMINSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowHiddenADMINShares" ), mShowHiddenADMINShares, true ); + mShowHiddenADMINSharesItem->setLabel( i18n("Show hidden ADMIN$ shares") ); + mShowHiddenADMINSharesItem->setWhatsThis( i18n("Hidden ADMIN$ shares will be displayed in the network browser.") ); + addItem( mShowHiddenADMINSharesItem, QString::fromLatin1( "ShowHiddenADMINShares" ) ); + mShowTypeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowType" ), mShowType, true ); + mShowTypeItem->setLabel( i18n("Show the type of a share") ); + mShowTypeItem->setWhatsThis( i18n("The type of a share will be displayed in a separate column in the network browser. It can either be Disk, Print or IPC.") ); + addItem( mShowTypeItem, QString::fromLatin1( "ShowType" ) ); + mShowIPAddressItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowIPAddress" ), mShowIPAddress, true ); + mShowIPAddressItem->setLabel( i18n("Show the IP address of a server") ); + mShowIPAddressItem->setWhatsThis( i18n("The IP address of the server will be displayed in a separate column in the network browser.") ); + addItem( mShowIPAddressItem, QString::fromLatin1( "ShowIPAddress" ) ); + mShowCommentItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowComment" ), mShowComment, true ); + mShowCommentItem->setLabel( i18n("Show the comment of a share") ); + mShowCommentItem->setWhatsThis( i18n("The comment describing the server or share will be displayed in a separate column in the network browser.") ); + addItem( mShowCommentItem, QString::fromLatin1( "ShowComment" ) ); + mShowNetworkItemToolTipItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowNetworkItemToolTip" ), mShowNetworkItemToolTip, true ); + mShowNetworkItemToolTipItem->setLabel( i18n("Show a tooltip with information about the network item") ); + mShowNetworkItemToolTipItem->setWhatsThis( i18n("The tooltip shows various information about the current network item.") ); + addItem( mShowNetworkItemToolTipItem, QString::fromLatin1( "ShowNetworkItemToolTip" ) ); + mShowMountPointItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowMountPoint" ), mShowMountPoint, false ); + mShowMountPointItem->setLabel( i18n("Show the mount point of a share instead of its name") ); + mShowMountPointItem->setWhatsThis( i18n("A share is normally displayed with its name in the shares view. Choosing this feature will cause the exchange of the share name by the mount point.") ); + addItem( mShowMountPointItem, QString::fromLatin1( "ShowMountPoint" ) ); + mShowAllSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowAllShares" ), mShowAllShares, false ); + mShowAllSharesItem->setLabel( i18n("Show all shares that are mounted on the system") ); + mShowAllSharesItem->setWhatsThis( i18n("You will not only see the shares that were mounted and are owned by you, but also all other mounts using the SMBFS and CIFS file system that are present on the system.") ); + addItem( mShowAllSharesItem, QString::fromLatin1( "ShowAllShares" ) ); + mEnableDropSupportItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "EnableDropSupport" ), mEnableDropSupport, false ); + mEnableDropSupportItem->setLabel( i18n("Allow the dropping of files and directories onto share icons") ); + mEnableDropSupportItem->setWhatsThis( i18n("This setting allows you to drop files or whole directories onto the share icons, which will cause them to be copied.") ); + addItem( mEnableDropSupportItem, QString::fromLatin1( "EnableDropSupport" ) ); + mEnableDragSupportItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "EnableDragSupport" ), mEnableDragSupport, false ); + mEnableDragSupportItem->setLabel( i18n("Allow the dragging of share icons") ); + mEnableDragSupportItem->setWhatsThis( i18n("This setting allows you to drag a share item out of Smb4K and onto the desktop or into a file manager. Only enable it if you think you absolutely need it and read the handbook before you mark this checkbox.") ); + addItem( mEnableDragSupportItem, QString::fromLatin1( "EnableDragSupport" ) ); + mShowShareToolTipItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowShareToolTip" ), mShowShareToolTip, true ); + mShowShareToolTipItem->setLabel( i18n("Show a tooltip with information about the share") ); + mShowShareToolTipItem->setWhatsThis( i18n("The tooltip shows various information about the current share.") ); + addItem( mShowShareToolTipItem, QString::fromLatin1( "ShowShareToolTip" ) ); + mPreviewHiddenItemsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreviewHiddenItems" ), mPreviewHiddenItems, false ); + mPreviewHiddenItemsItem->setLabel( i18n("Show hidden files and directories when previewing a share") ); + mPreviewHiddenItemsItem->setWhatsThis( i18n("Display hidden files and directories in the preview dialog. The names of hidden files and directories are beginning with a period and are usually needed for very specific purposes (configuration file of an application, etc.). Since they are not of any importance for your regular work, you normally do not need to enable this feature.") ); + addItem( mPreviewHiddenItemsItem, QString::fromLatin1( "PreviewHiddenItems" ) ); + mShowOwnerItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowOwner" ), mShowOwner, false ); + mShowOwnerItem->setLabel( i18n("Show owner and group (SMBFS only)") ); + mShowOwnerItem->setWhatsThis( i18n("Show the UID and GID that own all files on the mounted file system. At the moment the column will only contain an entry if the share was mounted with the SMBFS file system.") ); + addItem( mShowOwnerItem, QString::fromLatin1( "ShowOwner" ) ); + mShowLoginItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowLogin" ), mShowLogin, false ); + mShowLoginItem->setLabel( i18n("Show login (CIFS only)") ); + mShowLoginItem->setWhatsThis( i18n("Show the login that was used to authenticate to the server. The column will only contain an entry if the share was mounted with the CIFS file system.") ); + addItem( mShowLoginItem, QString::fromLatin1( "ShowLogin" ) ); + mShowFileSystemItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowFileSystem" ), mShowFileSystem, true ); + mShowFileSystemItem->setLabel( i18n("Show file system") ); + mShowFileSystemItem->setWhatsThis( i18n("Show the file system that was used for mounting the share.") ); + addItem( mShowFileSystemItem, QString::fromLatin1( "ShowFileSystem" ) ); + mShowFreeDiskSpaceItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowFreeDiskSpace" ), mShowFreeDiskSpace, false ); + mShowFreeDiskSpaceItem->setLabel( i18n("Show free disk space") ); + mShowFreeDiskSpaceItem->setWhatsThis( i18n("Show the free disk space that is left on the share.") ); + addItem( mShowFreeDiskSpaceItem, QString::fromLatin1( "ShowFreeDiskSpace" ) ); + mShowUsedDiskSpaceItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowUsedDiskSpace" ), mShowUsedDiskSpace, false ); + mShowUsedDiskSpaceItem->setLabel( i18n("Show used disk space") ); + mShowUsedDiskSpaceItem->setWhatsThis( i18n("Show the disk space that is already used on the share.") ); + addItem( mShowUsedDiskSpaceItem, QString::fromLatin1( "ShowUsedDiskSpace" ) ); + mShowTotalDiskSpaceItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowTotalDiskSpace" ), mShowTotalDiskSpace, false ); + mShowTotalDiskSpaceItem->setLabel( i18n("Show total disk space") ); + mShowTotalDiskSpaceItem->setWhatsThis( i18n("Show the total disk space of the share.") ); + addItem( mShowTotalDiskSpaceItem, QString::fromLatin1( "ShowTotalDiskSpace" ) ); + mShowDiskUsageItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ShowDiskUsage" ), mShowDiskUsage, true ); + mShowDiskUsageItem->setLabel( i18n("Show disk usage") ); + mShowDiskUsageItem->setWhatsThis( i18n("Show the space that is used on the share in percent.") ); + addItem( mShowDiskUsageItem, QString::fromLatin1( "ShowDiskUsage" ) ); + + setCurrentGroup( QString::fromLatin1( "Network" ) ); + + QValueList valuesBrowseList; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "LookupDomains" ); + valuesBrowseList.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "QueryCurrentMaster" ); + valuesBrowseList.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "QueryCustomMaster" ); + valuesBrowseList.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "ScanBroadcastAreas" ); + valuesBrowseList.append( choice ); + } + mBrowseListItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "BrowseList" ), mBrowseList, valuesBrowseList, EnumBrowseList::LookupDomains ); + mBrowseListItem->setLabel( i18n("Method how to retrieve the browse list") ); + mBrowseListItem->setWhatsThis( i18n("Choose the method how to compile the initial browse list. There are four options available: The first one is the default one and employs \"nmblookup -M -- -\" to discover all workgroups, domains, and their master browsers on your network neighborhood. The second one instructs Smb4K to query the current master browser of your workgroup or domain to retrieve the browse list. The third is similar to the second one except that you can define the master browser that should be queried. If you choose the last option, the provided list of broadcast areas will be scanned using \"nmblookup -B x.x.x.x -- '*'\".") ); + addItem( mBrowseListItem, QString::fromLatin1( "BrowseList" ) ); + mCustomMasterBrowserItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "CustomMasterBrowser" ), mCustomMasterBrowser ); + mCustomMasterBrowserItem->setLabel( i18n("A custom master browser that is to be queried") ); + mCustomMasterBrowserItem->setWhatsThis( i18n("Enter the name or IP address of a master browser here that should be queried to compile the initial browse list.") ); + addItem( mCustomMasterBrowserItem, QString::fromLatin1( "CustomMasterBrowser" ) ); + mBroadcastAreasItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "BroadcastAreas" ), mBroadcastAreas ); + mBroadcastAreasItem->setLabel( i18n("A custom list of broadcast addresses") ); + mBroadcastAreasItem->setWhatsThis( i18n("Enter a comma-separated list of broadcast addresses here (e.g. 192.168.0.255, 192.168.1.255). It is used to scan for all known hosts in the respective broadcast areas.") ); + addItem( mBroadcastAreasItem, QString::fromLatin1( "BroadcastAreas" ) ); + QValueList valuesSearchMethod; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Nmblookup" ); + valuesSearchMethod.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Smbclient" ); + valuesSearchMethod.append( choice ); + } + mSearchMethodItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "SearchMethod" ), mSearchMethod, valuesSearchMethod, EnumSearchMethod::Nmblookup ); + mSearchMethodItem->setLabel( i18n("Method for searching for remote hosts") ); + mSearchMethodItem->setWhatsThis( i18n("Smb4K is able to search for remote hosts either using nmblookup or smbclient. The nmblookup method is very reliable and works well. However, if your network is configured uncommonly and you experience problems when searching, you should try the smbclient method. But please note that you lose the ability to search for IP addresses in that case.") ); + addItem( mSearchMethodItem, QString::fromLatin1( "SearchMethod" ) ); + + setCurrentGroup( QString::fromLatin1( "Shares" ) ); + + mMountPrefixItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "MountPrefix" ), mMountPrefix, QString::fromLatin1( "${HOME}/smb4k/" ) ); + mMountPrefixItem->setLabel( i18n("The mount prefix") ); + mMountPrefixItem->setWhatsThis( i18n("This is the prefix where Smb4K will create the mount points and mount the remote shares.") ); + addItem( mMountPrefixItem, QString::fromLatin1( "MountPrefix" ) ); + mForceLowerCaseSubdirsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ForceLowerCaseSubdirs" ), mForceLowerCaseSubdirs, false ); + mForceLowerCaseSubdirsItem->setLabel( i18n("Force the subdirectories created by Smb4K to be lowercase") ); + mForceLowerCaseSubdirsItem->setWhatsThis( i18n("All names of the subdirectories created by Smb4K below the mount prefix will be lowercase.") ); + addItem( mForceLowerCaseSubdirsItem, QString::fromLatin1( "ForceLowerCaseSubdirs" ) ); + mUnmountSharesOnExitItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UnmountSharesOnExit" ), mUnmountSharesOnExit, false ); + mUnmountSharesOnExitItem->setLabel( i18n("Unmount the shares owned by the user on exit") ); + mUnmountSharesOnExitItem->setWhatsThis( i18n("Unmount all shares that belong to you when the program exits.") ); + addItem( mUnmountSharesOnExitItem, QString::fromLatin1( "UnmountSharesOnExit" ) ); + mRemountSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "RemountShares" ), mRemountShares, false ); + mRemountSharesItem->setLabel( i18n("Remount shares") ); + mRemountSharesItem->setWhatsThis( i18n("Remount all your shares that were still mounted when you exited the program. Shares that were mounted by other users are ignored.") ); + addItem( mRemountSharesItem, QString::fromLatin1( "RemountShares" ) ); + mUnmountForeignSharesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UnmountForeignShares" ), mUnmountForeignShares, false ); + mUnmountForeignSharesItem->setLabel( i18n("Allow the unmounting of shares owned by other users") ); + mUnmountForeignSharesItem->setWhatsThis( i18n("Allow the unmounting of shares that were mounted by other users. In most cases you need super user privileges for this. Please think before you enable this option!") ); + addItem( mUnmountForeignSharesItem, QString::fromLatin1( "UnmountForeignShares" ) ); + mCheckIntervalItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "CheckInterval" ), mCheckInterval, 2500 ); + mCheckIntervalItem->setMinValue(500); + mCheckIntervalItem->setMaxValue(300000); + mCheckIntervalItem->setLabel( i18n("Interval between checks for new and inaccessible shares") ); + mCheckIntervalItem->setWhatsThis( i18n("This is the time that elapses until Smb4K checks again for new mounts and unmounts. The lower limit is 500 ms, the upper one 300000 ms. Please note that the smaller the interval gets the higher is your system load.") ); + addItem( mCheckIntervalItem, QString::fromLatin1( "CheckInterval" ) ); + + setCurrentGroup( QString::fromLatin1( "Authentication" ) ); + + mUseWalletItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseWallet" ), mUseWallet, true ); + mUseWalletItem->setLabel( i18n("Use a wallet to store authentication data") ); + mUseWalletItem->setWhatsThis( i18n("Use a wallet to store the authentication data. The login name and the password name are stored encrypted on your hard drive. If this setting is disabled, the authentication data is not stored permanently but only temporarily.") ); + addItem( mUseWalletItem, QString::fromLatin1( "UseWallet" ) ); + mRememberPasswordsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "RememberPasswords" ), mRememberPasswords, true ); + mRememberPasswordsItem->setLabel( i18n("Remember passwords if no wallet is used") ); + mRememberPasswordsItem->setWhatsThis( i18n("If you decided to store the login names and passwords only temporarily, Smb4K will remember them until the program exits. If you disable this setting, you will have to provide the authentication data everytime it is needed.") ); + addItem( mRememberPasswordsItem, QString::fromLatin1( "RememberPasswords" ) ); + mUseDefaultLoginItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseDefaultLogin" ), mUseDefaultLogin, false ); + mUseDefaultLoginItem->setLabel( i18n("Use a default login") ); + mUseDefaultLoginItem->setWhatsThis( i18n("Enable the usage of a default login name and password. The authentication data provided below is then used by default to authenticate to a remote server. This is very useful e.g. if you are working in an Active Directory environment or an NT domain.") ); + addItem( mUseDefaultLoginItem, QString::fromLatin1( "UseDefaultLogin" ) ); + + setCurrentGroup( QString::fromLatin1( "Samba" ) ); + + mNetBIOSNameItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "NetBIOSName" ), mNetBIOSName ); + mNetBIOSNameItem->setLabel( i18n("The NetBIOS name of this computer") ); + mNetBIOSNameItem->setWhatsThis( i18n("This is the NetBIOS name of this computer that is used by Smb4K. By default, it is either the NetBIOS name that is defined in the smb.conf file or the host name.") ); + addItem( mNetBIOSNameItem, QString::fromLatin1( "NetBIOSName" ) ); + mDomainNameItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "DomainName" ), mDomainName ); + mDomainNameItem->setLabel( i18n("The name of the workgroup/domain this computer is in") ); + mDomainNameItem->setWhatsThis( i18n("This is the workgroup or domain this computer is or should be in. By default, it is the workgroup that is defined in the smb.conf file.") ); + addItem( mDomainNameItem, QString::fromLatin1( "DomainName" ) ); + mSocketOptionsItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "SocketOptions" ), mSocketOptions ); + mSocketOptionsItem->setLabel( i18n("The socket options") ); + mSocketOptionsItem->setWhatsThis( i18n("These are the TCP socket options that are used by nmblookup, smbmount and smbclient. Socket options are controls on the networking layer of the operating systems which allow the connection to be tuned. See the manual page of smb.conf for more information.") ); + addItem( mSocketOptionsItem, QString::fromLatin1( "SocketOptions" ) ); + mNetBIOSScopeItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "NetBIOSScope" ), mNetBIOSScope ); + mNetBIOSScopeItem->setLabel( i18n("The NetBIOS scope") ); + mNetBIOSScopeItem->setWhatsThis( i18n("This sets the NetBIOS scope that nmblookup, smbmount and smbclient will operate under. It should not be set unless every machine on your network neighborhood sets this value.") ); + addItem( mNetBIOSScopeItem, QString::fromLatin1( "NetBIOSScope" ) ); + mRemotePortItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "RemotePort" ), mRemotePort, 139 ); + mRemotePortItem->setMinValue(1); + mRemotePortItem->setMaxValue(65535); + mRemotePortItem->setLabel( i18n("The remote SMB port") ); + mRemotePortItem->setWhatsThis( i18n("This is the port that is to be used for connecting to remote servers. Please note that this is independent of the settings in the smb.conf file.") ); + addItem( mRemotePortItem, QString::fromLatin1( "RemotePort" ) ); + mUseKerberosItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseKerberos" ), mUseKerberos, false ); + mUseKerberosItem->setLabel( i18n("Use Kerberos for authentication") ); + mUseKerberosItem->setWhatsThis( i18n("Try to authenticate with Kerberos. This is only useful in an Active Directory environment. The setting affects the smbmount and smbclient command.") ); + addItem( mUseKerberosItem, QString::fromLatin1( "UseKerberos" ) ); + mMachineAccountItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "MachineAccount" ), mMachineAccount, false ); + mMachineAccountItem->setLabel( i18n("Use machine account for login") ); + mMachineAccountItem->setWhatsThis( i18n("Make queries to the remote server using the machine account of the local server. The setting affects the net and the smbclient command.") ); + addItem( mMachineAccountItem, QString::fromLatin1( "MachineAccount" ) ); + QValueList valuesFilesystem; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "CIFS" ); + valuesFilesystem.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "SMBFS" ); + valuesFilesystem.append( choice ); + } + mFilesystemItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "Filesystem" ), mFilesystem, valuesFilesystem, EnumFilesystem::CIFS ); + mFilesystemItem->setLabel( i18n("The file system that is used for mounting remote shares") ); + mFilesystemItem->setWhatsThis( i18n("This is the file system that will be used to mount the remote shares. The Common Internet File System (CIFS) is supported by Windows 2000 and above as well as by Samba. It offers many improvements and advancements compared to the Server Message Block File System (SMBFS) which is used by Windows 9x and below.") ); + addItem( mFilesystemItem, QString::fromLatin1( "Filesystem" ) ); + QValueList valuesClientCharset; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "default_charset" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_1" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_2" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_3" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_4" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_5" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_6" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_7" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_8" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_9" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_13" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_14" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "iso8859_15" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "utf8" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "koi8_r" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "koi8_u" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "koi8_ru" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1251" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "gb2312" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "big5" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "euc_jp" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "euc_kr" ); + valuesClientCharset.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "tis_620" ); + valuesClientCharset.append( choice ); + } + mClientCharsetItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "ClientCharset" ), mClientCharset, valuesClientCharset, EnumClientCharset::default_charset ); + mClientCharsetItem->setLabel( i18n("The charset used by the client") ); + mClientCharsetItem->setWhatsThis( i18n("This is the charset that is used by the client side (i.e. your side) either to convert local path names to and from Unicode in case of the CIFS file system or for codepage to charset translations (NLS) in case of the SMBFS file system. If you keep the default setting, Smb4K will try to automatically determine the charset by looking up the \"unix charset\" option in the smb.conf.") ); + addItem( mClientCharsetItem, QString::fromLatin1( "ClientCharset" ) ); + QValueList valuesServerCodepage; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "default_codepage" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp437" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp720" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp737" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp775" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp850" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp852" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp855" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp857" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp858" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp860" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp861" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp862" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp863" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp864" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp865" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp866" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp869" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp874" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp932" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp936" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp949" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp950" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1250" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1251" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1252" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1253" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1254" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1255" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1256" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1257" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "cp1258" ); + valuesServerCodepage.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "unicode" ); + valuesServerCodepage.append( choice ); + } + mServerCodepageItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "ServerCodepage" ), mServerCodepage, valuesServerCodepage, EnumServerCodepage::default_codepage ); + mServerCodepageItem->setLabel( i18n("The codepage used by the server") ); + mServerCodepageItem->setWhatsThis( i18n("This is the codepage that is used by the server. The setting is only available with the SMBFS file system. If you keep the default setting, Smb4K will try to automatically determine the codepage by looking up the \"dos charset\" option in the smb.conf.") ); + addItem( mServerCodepageItem, QString::fromLatin1( "ServerCodepage" ) ); + mUserIDItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "UserID" ), mUserID, QString( "%1" ).arg( (int)getuid() ) ); + mUserIDItem->setLabel( i18n("The user ID that is to be used for mounting") ); + mUserIDItem->setWhatsThis( i18n("Here you can enter the user ID (a number) that the files and directories of the mounted share will have. If you are using the CIFS file system and the remote server supports the CIFS Unix Extentions, this setting will be ignored.") ); + addItem( mUserIDItem, QString::fromLatin1( "UserID" ) ); + mGroupIDItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "GroupID" ), mGroupID, QString( "%1" ).arg( (int)getgid() ) ); + mGroupIDItem->setLabel( i18n("The group ID that is to be used for mounting") ); + mGroupIDItem->setWhatsThis( i18n("Here you can enter the group ID (a number) that the files and directories of the mounted share will have. If you are using the CIFS file system and the remote server supports the CIFS Unix Extentions, this setting will be ignored.") ); + addItem( mGroupIDItem, QString::fromLatin1( "GroupID" ) ); + mFileMaskItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "FileMask" ), mFileMask, QString::fromLatin1( "0755" ) ); + mFileMaskItem->setLabel( i18n("The file mask for a share") ); + mFileMaskItem->setWhatsThis( i18n("This is the mask that will be used for creating files. It must be defined in octal. In case the CIFS file system is used, this setting only takes effect if the server does not support the CIFS Unix Extensions.") ); + addItem( mFileMaskItem, QString::fromLatin1( "FileMask" ) ); + mDirectoryMaskItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "DirectoryMask" ), mDirectoryMask, QString::fromLatin1( "0755" ) ); + mDirectoryMaskItem->setLabel( i18n("The directory mask for a share") ); + mDirectoryMaskItem->setWhatsThis( i18n("This is the mask that will be used for creating directories. It must be defined in octal. In case the CIFS file system is used, this setting only takes effect if the server does not support the CIFS Unix Extensions.") ); + addItem( mDirectoryMaskItem, QString::fromLatin1( "DirectoryMask" ) ); + QValueList valuesWriteAccess; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "ReadWrite" ); + valuesWriteAccess.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "ReadOnly" ); + valuesWriteAccess.append( choice ); + } + mWriteAccessItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "WriteAccess" ), mWriteAccess, valuesWriteAccess, EnumWriteAccess::ReadWrite ); + mWriteAccessItem->setLabel( i18n("The write access granted for the share") ); + mWriteAccessItem->setWhatsThis( i18n("Here you can choose if the shares should be mounted in read and write mode or only read-only.") ); + addItem( mWriteAccessItem, QString::fromLatin1( "WriteAccess" ) ); + mPermissionChecksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PermissionChecks" ), mPermissionChecks, true ); + mPermissionChecksItem->setLabel( i18n("Do permission checks") ); + mPermissionChecksItem->setWhatsThis( i18n("The client side (i.e. your side) will check if you have the right UID/GID to manipulate a file or directory. You might want to switch this feature off if the server(s) support the CIFS Unix Extensions and you are not allowed to access the files and directories. This setting does not affect the normal ACL check.") ); + addItem( mPermissionChecksItem, QString::fromLatin1( "PermissionChecks" ) ); + mClientControlsIDsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ClientControlsIDs" ), mClientControlsIDs, false ); + mClientControlsIDsItem->setLabel( i18n("Set UID and GID") ); + mClientControlsIDsItem->setWhatsThis( i18n("In case the server supports the CIFS Unix Extensions, the client side (i.e. your side) attempts to set the effective UID and GID of the current process on newly created files, directories and devices. If this feature is turned off, the default UID and GID defined for the share will be used. It is recommended that you read the manual page of mount.cifs before you change this setting.") ); + addItem( mClientControlsIDsItem, QString::fromLatin1( "ClientControlsIDs" ) ); + mServerInodeNumbersItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ServerInodeNumbers" ), mServerInodeNumbers, false ); + mServerInodeNumbersItem->setLabel( i18n("Use server inode numbers") ); + mServerInodeNumbersItem->setWhatsThis( i18n("Use inode numbers (unique persistent file identifiers) returned by the server instead of automatically generating temporary inode numbers on the client side.") ); + addItem( mServerInodeNumbersItem, QString::fromLatin1( "ServerInodeNumbers" ) ); + mInodeDataCachingItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "InodeDataCaching" ), mInodeDataCaching, false ); + mInodeDataCachingItem->setLabel( i18n("Do not cache inode data") ); + mInodeDataCachingItem->setWhatsThis( i18n("Directly read from and write to files opened on the share. In some cases this can provide better performance than the default behavior which caches reads and writes.") ); + addItem( mInodeDataCachingItem, QString::fromLatin1( "InodeDataCaching" ) ); + mTranslateReservedCharsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "TranslateReservedChars" ), mTranslateReservedChars, false ); + mTranslateReservedCharsItem->setLabel( i18n("Translate reserved characters") ); + mTranslateReservedCharsItem->setWhatsThis( i18n("Translate six of the seven reserved characters (including the colon, question mark, pipe, asterisk, greater than and less than characters but not the backslash) to remap range (above 0xF000). This allows you to open files that were created with such characters. This has no effect if the server does not support Unicode.") ); + addItem( mTranslateReservedCharsItem, QString::fromLatin1( "TranslateReservedChars" ) ); + mNoLockingItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "NoLocking" ), mNoLocking, false ); + mNoLockingItem->setLabel( i18n("Do not use locking") ); + mNoLockingItem->setWhatsThis( i18n("Do not use locking. Do not start lockd.") ); + addItem( mNoLockingItem, QString::fromLatin1( "NoLocking" ) ); + mCustomCIFSOptionsItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "CustomCIFSOptions" ), mCustomCIFSOptions ); + mCustomCIFSOptionsItem->setLabel( i18n("Advanced custom options for the CIFS file system") ); + mCustomCIFSOptionsItem->setWhatsThis( i18n("Here you can enter advanced options for the CIFS file system in a comma-separated list (refer to the manual page of mount.cifs to learn more). The list will be added AS IS to the \"-o\" argument of mount.cifs. Please do not enter options that have already been defined in the configuration dialog.") ); + addItem( mCustomCIFSOptionsItem, QString::fromLatin1( "CustomCIFSOptions" ) ); + mCachingTimeItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "CachingTime" ), mCachingTime, 1000 ); + mCachingTimeItem->setLabel( i18n("Determines how long directory listings are cached") ); + mCachingTimeItem->setWhatsThis( i18n("This setting determines how long a directory listing is cached in milliseconds. A high value means it takes longer until changes on the server are noticed on the client side (i.e. your side), but it can also give you an increase in performance on large directories, especially on long distances. You need Linux kernel 2.4.2 or later to take advantage of this setting.") ); + addItem( mCachingTimeItem, QString::fromLatin1( "CachingTime" ) ); + mUnicodeSupportItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UnicodeSupport" ), mUnicodeSupport, false ); + mUnicodeSupportItem->setLabel( i18n("Unicode support") ); + mUnicodeSupportItem->setWhatsThis( i18n("Use Unicode when communicating with the server. This will give you better support for non-ASCII character sets with the SMBFS file system.") ); + addItem( mUnicodeSupportItem, QString::fromLatin1( "UnicodeSupport" ) ); + mLargeFileSystemSupportItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "LargeFileSystemSupport" ), mLargeFileSystemSupport, false ); + mLargeFileSystemSupportItem->setLabel( i18n("Long file support") ); + mLargeFileSystemSupportItem->setWhatsThis( i18n("Large file support (LFS) enables you to read and write \n" +"files bigger than 2 GB on shares that were mounted with the SMBFS file system.") ); + addItem( mLargeFileSystemSupportItem, QString::fromLatin1( "LargeFileSystemSupport" ) ); + QValueList valuesProtocolHint; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Automatic" ); + valuesProtocolHint.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "RPC" ); + valuesProtocolHint.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "RAP" ); + valuesProtocolHint.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "ADS" ); + valuesProtocolHint.append( choice ); + } + mProtocolHintItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "ProtocolHint" ), mProtocolHint, valuesProtocolHint, EnumProtocolHint::Automatic ); + mProtocolHintItem->setLabel( i18n("The protocol that is used with the net command") ); + mProtocolHintItem->setWhatsThis( i18n("Here you can choose the protocol that will be used by the net command for the communication with remote servers if appropriate. In most cases the automatic detection will work fine and you should not need to change the default setting. However, if you experience problems, use the RPC protocol for newer operating systems (Windows NT4 and above) and the RAP protocol for older ones (Windows 98/NT3 and below). Functions that need the ADS protocol (for Active Directory environments) have not been implemented yet, so you can ignore that one for now.") ); + addItem( mProtocolHintItem, QString::fromLatin1( "ProtocolHint" ) ); + mNameResolveOrderItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "NameResolveOrder" ), mNameResolveOrder ); + mNameResolveOrderItem->setLabel( i18n("Name resolve order used by smbclient") ); + mNameResolveOrderItem->setWhatsThis( i18n("This option is used to determine what naming services and in what order are used to resolve host names and IP addresses. It takes a space-separated list of up to four different name resolution options. Those are: lmhost, host, wins, bcast. See the manual page of smbclient for further information.") ); + addItem( mNameResolveOrderItem, QString::fromLatin1( "NameResolveOrder" ) ); + mBufferSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "BufferSize" ), mBufferSize, 65520 ); + mBufferSizeItem->setMinValue(0); + mBufferSizeItem->setLabel( i18n("Transmit/send buffer size used by smbclient") ); + mBufferSizeItem->setWhatsThis( i18n("This option changes the transmit/send buffer size when getting or putting a file from/to the server. The default is 65520 bytes. Setting this value smaller has been observed to speed up file transfers to and from Windows 9x servers.") ); + addItem( mBufferSizeItem, QString::fromLatin1( "BufferSize" ) ); + QValueList valuesSigningState; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "None" ); + valuesSigningState.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "On" ); + valuesSigningState.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Off" ); + valuesSigningState.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Required" ); + valuesSigningState.append( choice ); + } + mSigningStateItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "SigningState" ), mSigningState, valuesSigningState, EnumSigningState::None ); + mSigningStateItem->setLabel( i18n("Signing state") ); + mSigningStateItem->setWhatsThis( i18n("Set the signing state for smbclient.") ); + addItem( mSigningStateItem, QString::fromLatin1( "SigningState" ) ); + mBroadcastAddressItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "BroadcastAddress" ), mBroadcastAddress ); + mBroadcastAddressItem->setLabel( i18n("The broadcast address used by nmblookup") ); + mBroadcastAddressItem->setWhatsThis( i18n("Queries performed with nmblookup will be send to the given broadcast address. Without this option the default behavior is to send the queries to the broadcast address of the network interface that was either auto-detected or defined in the \"interfaces\" parameter of the smb.conf file.") ); + addItem( mBroadcastAddressItem, QString::fromLatin1( "BroadcastAddress" ) ); + mUsePort137Item = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UsePort137" ), mUsePort137, false ); + mUsePort137Item->setLabel( i18n("Use UDP port 137 with nmblookup") ); + mUsePort137Item->setWhatsThis( i18n("Try and bind to UDP port 137 to send and receive UDP datagrams. The reason for this option is a bug in Windows 95 where it ignores the source port of the requesting packet and only replies to UDP port 137. Unfortunately, on most Unix systems super user privileges are needed to bind to this port. Please read the manual page of nmblookup for more information.") ); + addItem( mUsePort137Item, QString::fromLatin1( "UsePort137" ) ); + + setCurrentGroup( QString::fromLatin1( "Synchronization" ) ); + + mRsyncPrefixItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "RsyncPrefix" ), mRsyncPrefix, QString::fromLatin1( "$HOME/smb4k_sync/" ) ); + mRsyncPrefixItem->setLabel( i18n("Prefix for synchronization") ); + mRsyncPrefixItem->setWhatsThis( i18n("This is the path where Smb4K will store the files and directories during synchronization. If you plan to synchronize only with one remote share, then you can put the data directly in this directory. If you want to synchronize with several remote shares, then you should create a subdirectory for each share and choose the appropriate one in the synchronization dialog.") ); + addItem( mRsyncPrefixItem, QString::fromLatin1( "RsyncPrefix" ) ); + mArchiveModeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ArchiveMode" ), mArchiveMode, true ); + mArchiveModeItem->setLabel( i18n("Use archive mode") ); + mArchiveModeItem->setWhatsThis( i18n("Use archive mode (-a, --archive). This is a short form of -rlptgoD.") ); + addItem( mArchiveModeItem, QString::fromLatin1( "ArchiveMode" ) ); + mRecurseIntoDirectoriesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "RecurseIntoDirectories" ), mRecurseIntoDirectories, true ); + mRecurseIntoDirectoriesItem->setLabel( i18n("Recurse into subdirectories") ); + mRecurseIntoDirectoriesItem->setWhatsThis( i18n("Recurse into directories (-r, --recursive).") ); + addItem( mRecurseIntoDirectoriesItem, QString::fromLatin1( "RecurseIntoDirectories" ) ); + mUpdateTargetItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UpdateTarget" ), mUpdateTarget, true ); + mUpdateTargetItem->setLabel( i18n("Skip files that are newer in the target directory") ); + mUpdateTargetItem->setWhatsThis( i18n("Update files in the destination directory that are older than in the source directory (-u, --update).") ); + addItem( mUpdateTargetItem, QString::fromLatin1( "UpdateTarget" ) ); + mUpdateInPlaceItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UpdateInPlace" ), mUpdateInPlace, false ); + mUpdateInPlaceItem->setLabel( i18n("Update destination files in place") ); + mUpdateInPlaceItem->setWhatsThis( i18n("Update destination files in-place (--inplace). By default, rsync first creates a new copy of a file and moves it into place after its transfer finished. If you enable this feature, no copy will be created but the destination file will immediately be overwritten instead. An exception to this is if you combine this option with --backup.") ); + addItem( mUpdateInPlaceItem, QString::fromLatin1( "UpdateInPlace" ) ); + mRelativePathNamesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "RelativePathNames" ), mRelativePathNames, false ); + mRelativePathNamesItem->setLabel( i18n("Use relative path names") ); + mRelativePathNamesItem->setWhatsThis( i18n("Use relative paths (-R, --relative). This means that the full path names specified on the command line are sent to the server rather than just the last parts of the file names.") ); + addItem( mRelativePathNamesItem, QString::fromLatin1( "RelativePathNames" ) ); + mNoImpliedDirectoriesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "NoImpliedDirectories" ), mNoImpliedDirectories, false ); + mNoImpliedDirectoriesItem->setLabel( i18n("Don't send implied directories with --relative") ); + mNoImpliedDirectoriesItem->setWhatsThis( i18n("Don't send implied directories with --relative (--no-implied-dirs). This means that the corresponding path elements on the destination system are left unchanged if they exist, and any missing implied directories are created with default attributes. This even allows these implied path elements to have big differences, such as being a symlink to a directory on one side of the transfer, and a real directory on the other side.") ); + addItem( mNoImpliedDirectoriesItem, QString::fromLatin1( "NoImpliedDirectories" ) ); + mTransferDirectoriesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "TransferDirectories" ), mTransferDirectories, false ); + mTransferDirectoriesItem->setLabel( i18n("Transfer directories without recursing") ); + mTransferDirectoriesItem->setWhatsThis( i18n("Transfer directories without recursing (-d, --dirs). This means that all top-level subdirectories are transferred but without their contents.") ); + addItem( mTransferDirectoriesItem, QString::fromLatin1( "TransferDirectories" ) ); + mCompressDataItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "CompressData" ), mCompressData, false ); + mCompressDataItem->setLabel( i18n("Compress data during transfer") ); + mCompressDataItem->setWhatsThis( i18n("Compress data during transfer (-z, --compress). This significantly reduces the amount of data that is being transferred. You may want to use this option, if you have a slow connection.") ); + addItem( mCompressDataItem, QString::fromLatin1( "CompressData" ) ); + mPreserveSymlinksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreserveSymlinks" ), mPreserveSymlinks, true ); + mPreserveSymlinksItem->setLabel( i18n("Preserve symlinks") ); + mPreserveSymlinksItem->setWhatsThis( i18n("Copy symlinks as symlinks (-l, --links).") ); + addItem( mPreserveSymlinksItem, QString::fromLatin1( "PreserveSymlinks" ) ); + mTransformSymlinksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "TransformSymlinks" ), mTransformSymlinks, false ); + mTransformSymlinksItem->setLabel( i18n("Transform symlinks") ); + mTransformSymlinksItem->setWhatsThis( i18n("Transform symlinks into the items they are pointing to (-L, --copy-links).") ); + addItem( mTransformSymlinksItem, QString::fromLatin1( "TransformSymlinks" ) ); + mTransformUnsafeSymlinksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "TransformUnsafeSymlinks" ), mTransformUnsafeSymlinks, false ); + mTransformUnsafeSymlinksItem->setLabel( i18n("Only transform unsafe symlinks") ); + mTransformUnsafeSymlinksItem->setWhatsThis( i18n("Transform unsafe symlinks into the items they are pointing to (--copy-unsafe-links). This means that only those symlinks are transformed that point to items that are outside the copied tree. Absolute symlinks are treated the same way. This option has no additional effect if --copy-links has also been specified.") ); + addItem( mTransformUnsafeSymlinksItem, QString::fromLatin1( "TransformUnsafeSymlinks" ) ); + mIgnoreUnsafeSymlinksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "IgnoreUnsafeSymlinks" ), mIgnoreUnsafeSymlinks, false ); + mIgnoreUnsafeSymlinksItem->setLabel( i18n("Ignore unsafe symlinks") ); + mIgnoreUnsafeSymlinksItem->setWhatsThis( i18n("Ignore symlinks that point outside the copied tree (--safe-links). All absolute symlinks are also ignored. If you use this option in conjunction with --relative you might get unexpected results.") ); + addItem( mIgnoreUnsafeSymlinksItem, QString::fromLatin1( "IgnoreUnsafeSymlinks" ) ); + mPreserveHardLinksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreserveHardLinks" ), mPreserveHardLinks, false ); + mPreserveHardLinksItem->setLabel( i18n("Preserve hard links") ); + mPreserveHardLinksItem->setWhatsThis( i18n("Preserve hard links (-H, --hard-links). This options causes rsync to preserve the hard links that are found during the transfer. Without it, hard links are treated as though they were separate files.") ); + addItem( mPreserveHardLinksItem, QString::fromLatin1( "PreserveHardLinks" ) ); + mKeepDirectorySymlinksItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "KeepDirectorySymlinks" ), mKeepDirectorySymlinks, false ); + mKeepDirectorySymlinksItem->setLabel( i18n("Keep directory symlinks") ); + mKeepDirectorySymlinksItem->setWhatsThis( i18n("Treat symlinked directories on the receiving side as though they were real ones (-K, --keep-dirlinks). This only works if the symlink matches a real directory from the sending side. Without this option, the receiver's symlink will be deleted and replaced with a real directory.") ); + addItem( mKeepDirectorySymlinksItem, QString::fromLatin1( "KeepDirectorySymlinks" ) ); + mPreservePermissionsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreservePermissions" ), mPreservePermissions, true ); + mPreservePermissionsItem->setLabel( i18n("Preserve permissions") ); + mPreservePermissionsItem->setWhatsThis( i18n("Preserve permissions (-p, --perms). The permissions of the destination file will be same as the source file. For what happens if this option is switched off, please read rsync's manual page.") ); + addItem( mPreservePermissionsItem, QString::fromLatin1( "PreservePermissions" ) ); + mPreserveGroupItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreserveGroup" ), mPreserveGroup, true ); + mPreserveGroupItem->setLabel( i18n("Preserve group") ); + mPreserveGroupItem->setWhatsThis( i18n("Preserve the group (-g, --group). The group of the destination file will be set to the same value as the source file.") ); + addItem( mPreserveGroupItem, QString::fromLatin1( "PreserveGroup" ) ); + mPreserveOwnerItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreserveOwner" ), mPreserveOwner, true ); + mPreserveOwnerItem->setLabel( i18n("Preserve owner (super user only)") ); + mPreserveOwnerItem->setWhatsThis( i18n("Preserve the owner (-o, --owner). The owner of the destination file will be set to the same value as the source file, but only if the receiving rsync is run as the super user. Without this option, the owner is set to the invoking user on the receiving side.") ); + addItem( mPreserveOwnerItem, QString::fromLatin1( "PreserveOwner" ) ); + mPreserveDevicesAndSpecialsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreserveDevicesAndSpecials" ), mPreserveDevicesAndSpecials, true ); + mPreserveDevicesAndSpecialsItem->setLabel( i18n("Preserve device and special files") ); + mPreserveDevicesAndSpecialsItem->setWhatsThis( i18n("Preserve device and special files (-D, --devices --specials). This option causes rsync to transfer character and block devices as well as special files such as named sockets and fifos. It works only partially if rsync is not run as super user and the --super option is not specified.") ); + addItem( mPreserveDevicesAndSpecialsItem, QString::fromLatin1( "PreserveDevicesAndSpecials" ) ); + mPreserveTimesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "PreserveTimes" ), mPreserveTimes, true ); + mPreserveTimesItem->setLabel( i18n("Preserve times") ); + mPreserveTimesItem->setWhatsThis( i18n("Preserve times (-t, --times). The modification times are transferred along with the files. For what happens if this option is switched off, please read rsync's manual page.") ); + addItem( mPreserveTimesItem, QString::fromLatin1( "PreserveTimes" ) ); + mOmitDirectoryTimesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "OmitDirectoryTimes" ), mOmitDirectoryTimes, false ); + mOmitDirectoryTimesItem->setLabel( i18n("Omit directories when preserving times") ); + mOmitDirectoryTimesItem->setWhatsThis( i18n("Omit directories when preserving times (-O, --omit-dir-times). This means that directories are omitted when modification times are being preserved. Thus, this feature only works in conjunction with --times.") ); + addItem( mOmitDirectoryTimesItem, QString::fromLatin1( "OmitDirectoryTimes" ) ); + mRemoveSourceFilesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "RemoveSourceFiles" ), mRemoveSourceFiles, false ); + mRemoveSourceFilesItem->setLabel( i18n("Remove synchronized source files") ); + mRemoveSourceFilesItem->setWhatsThis( i18n("Remove all synchronized source files (--remove-source-files). This tells rsync to remove from the sending side the non-directory items that are a part of the transfer and have been successfully duplicated on the receiving side.") ); + addItem( mRemoveSourceFilesItem, QString::fromLatin1( "RemoveSourceFiles" ) ); + mDeleteExtraneousItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "DeleteExtraneous" ), mDeleteExtraneous, false ); + mDeleteExtraneousItem->setLabel( i18n("Delete extraneous files") ); + mDeleteExtraneousItem->setWhatsThis( i18n("Delete extraneous files from destination (--delete). This tells rsync to delete all files from the receiving side that are not present on the sending side, but only for the directories that are being synchronized.") ); + addItem( mDeleteExtraneousItem, QString::fromLatin1( "DeleteExtraneous" ) ); + mDeleteBeforeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "DeleteBefore" ), mDeleteBefore, false ); + mDeleteBeforeItem->setLabel( i18n("Delete files before transfer") ); + mDeleteBeforeItem->setWhatsThis( i18n("Delete files on the receiving side before the transfer starts (--delete-before). This is the default behavior if --delete or --delete-excluded is specified without one of the --delete-WHEN options.") ); + addItem( mDeleteBeforeItem, QString::fromLatin1( "DeleteBefore" ) ); + mDeleteAfterItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "DeleteAfter" ), mDeleteAfter, false ); + mDeleteAfterItem->setLabel( i18n("Delete files after transfer") ); + mDeleteAfterItem->setWhatsThis( i18n("Delete files on the receiving side after the transfer has completed (--delete-after, --del).") ); + addItem( mDeleteAfterItem, QString::fromLatin1( "DeleteAfter" ) ); + mDeleteDuringItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "DeleteDuring" ), mDeleteDuring, false ); + mDeleteDuringItem->setLabel( i18n("Delete files during transfer") ); + mDeleteDuringItem->setWhatsThis( i18n("Delete files on the receiving side during the transfer (--delete-during). This method is faster than --delete-before or --delete-after, but it is only supported with rsync 2.6.4 or later.") ); + addItem( mDeleteDuringItem, QString::fromLatin1( "DeleteDuring" ) ); + mDeleteExcludedItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "DeleteExcluded" ), mDeleteExcluded, false ); + mDeleteExcludedItem->setLabel( i18n("Also delete excluded files from destination directory") ); + mDeleteExcludedItem->setWhatsThis( i18n("Also delete excluded files from destination directory (--delete-excluded). In addition to deleting the files on the receiving side that are not on the sending side, this tells rsync to also delete any files on the receiving side that are excluded. Refer to rsync's manual page for further information.") ); + addItem( mDeleteExcludedItem, QString::fromLatin1( "DeleteExcluded" ) ); + mIgnoreErrorsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "IgnoreErrors" ), mIgnoreErrors, false ); + mIgnoreErrorsItem->setLabel( i18n("Delete even if I/O errors occur") ); + mIgnoreErrorsItem->setWhatsThis( i18n("Delete even if I/O errors occur (--ignore-errors). This option has to be specified in conjunction with --delete to take effect.") ); + addItem( mIgnoreErrorsItem, QString::fromLatin1( "IgnoreErrors" ) ); + mForceDirectoryDeletionItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "ForceDirectoryDeletion" ), mForceDirectoryDeletion, false ); + mForceDirectoryDeletionItem->setLabel( i18n("Force deletion of non-void directories") ); + mForceDirectoryDeletionItem->setWhatsThis( i18n("Force deletion of directories even if they are not empty (--force). This option tells rsync to delete a non-empty directory when it is to be replaced by a non-directory. This is only relevant if deletions are not active.") ); + addItem( mForceDirectoryDeletionItem, QString::fromLatin1( "ForceDirectoryDeletion" ) ); + mUseMaximumDeleteItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseMaximumDelete" ), mUseMaximumDelete, false ); + mUseMaximumDeleteItem->setLabel( i18n("Only delete a maximum number of files") ); + mUseMaximumDeleteItem->setWhatsThis( i18n("Only delete as many files as defined here (--max-delete=NUM). This tells rsync not to delete more than NUM files or directories (NUM must be non-zero). This is useful when mirroring very large trees to prevent disasters.") ); + addItem( mUseMaximumDeleteItem, QString::fromLatin1( "UseMaximumDelete" ) ); + mMaximumDeleteValueItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "MaximumDeleteValue" ), mMaximumDeleteValue, 0 ); + mMaximumDeleteValueItem->setMinValue(0); + mMaximumDeleteValueItem->setLabel( i18n("Value for DeleteMaximum config entry") ); + addItem( mMaximumDeleteValueItem, QString::fromLatin1( "MaximumDeleteValue" ) ); + mUseMinimalTransferSizeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseMinimalTransferSize" ), mUseMinimalTransferSize, false ); + mUseMinimalTransferSizeItem->setLabel( i18n("Don't transfer any file smaller than SIZE") ); + mUseMinimalTransferSizeItem->setWhatsThis( i18n("This option causes rsync to not transfer any file that is smaller than the specified size (--min-size=SIZE).") ); + addItem( mUseMinimalTransferSizeItem, QString::fromLatin1( "UseMinimalTransferSize" ) ); + mMinimalTransferSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "MinimalTransferSize" ), mMinimalTransferSize, 0 ); + mMinimalTransferSizeItem->setMinValue(0); + mMinimalTransferSizeItem->setLabel( i18n("Value for MinimalTransferSize config entry") ); + addItem( mMinimalTransferSizeItem, QString::fromLatin1( "MinimalTransferSize" ) ); + mUseMaximalTransferSizeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseMaximalTransferSize" ), mUseMaximalTransferSize, false ); + mUseMaximalTransferSizeItem->setLabel( i18n("Don't transfer any file smaller than SIZE") ); + mUseMaximalTransferSizeItem->setWhatsThis( i18n("This option causes rsync to not transfer any file that is larger than the specified size (--max-size=SIZE).") ); + addItem( mUseMaximalTransferSizeItem, QString::fromLatin1( "UseMaximalTransferSize" ) ); + mMaximalTransferSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "MaximalTransferSize" ), mMaximalTransferSize, 0 ); + mMaximalTransferSizeItem->setMinValue(0); + mMaximalTransferSizeItem->setLabel( i18n("Value for MamximalTransferSize config entry") ); + addItem( mMaximalTransferSizeItem, QString::fromLatin1( "MaximalTransferSize" ) ); + mKeepPartialItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "KeepPartial" ), mKeepPartial, false ); + mKeepPartialItem->setLabel( i18n("Keep partially transferred files") ); + mKeepPartialItem->setWhatsThis( i18n("Keep partially transferred files (--partial). The default behavor is that any partially transferred file is deleted if the transfer is interrupted.") ); + addItem( mKeepPartialItem, QString::fromLatin1( "KeepPartial" ) ); + mUsePartialDirectoryItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UsePartialDirectory" ), mUsePartialDirectory, false ); + mUsePartialDirectoryItem->setLabel( i18n("The directory where to put a partially transferred file into.") ); + mUsePartialDirectoryItem->setWhatsThis( i18n("Put a partially transferred file into this directory (--partial-dir=DIR). This is a better way than the --partial option to keep partial files, because the partially transferred file is kept in a different directory and the destination file is not overwritten.") ); + addItem( mUsePartialDirectoryItem, QString::fromLatin1( "UsePartialDirectory" ) ); + mPartialDirectoryItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "PartialDirectory" ), mPartialDirectory, QString::fromLatin1( "$HOME" ) ); + mPartialDirectoryItem->setLabel( i18n("The data for the UsePartialDirectory option") ); + addItem( mPartialDirectoryItem, QString::fromLatin1( "PartialDirectory" ) ); + mUseCVSExcludeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseCVSExclude" ), mUseCVSExclude, false ); + mUseCVSExcludeItem->setLabel( i18n("Auto-ignore files in the same way CVS does") ); + mUseCVSExcludeItem->setWhatsThis( i18n("Auto-ignore files in the same way CVS does (-C, --cvs-exclude). This is a useful shorthand for excluding a broad range of files that you often do not want to transfer between systems. This option uses the same algorithm that CVS uses to determine if a file should be ignored.") ); + addItem( mUseCVSExcludeItem, QString::fromLatin1( "UseCVSExclude" ) ); + mUseExcludePatternItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseExcludePattern" ), mUseExcludePattern, false ); + mUseExcludePatternItem->setLabel( i18n("Exclude files that match a certain pattern") ); + mUseExcludePatternItem->setWhatsThis( i18n("Exclude files that match a certain pattern (--exclude=PATTERN). This is a special filter rule. For further information on filter rules see rsync's manual page.") ); + addItem( mUseExcludePatternItem, QString::fromLatin1( "UseExcludePattern" ) ); + mExcludePatternItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "ExcludePattern" ), mExcludePattern ); + mExcludePatternItem->setLabel( i18n("Pattern that is used for file exclusion") ); + addItem( mExcludePatternItem, QString::fromLatin1( "ExcludePattern" ) ); + mUseExcludeFromItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseExcludeFrom" ), mUseExcludeFrom, false ); + mUseExcludeFromItem->setLabel( i18n("Read exclude patterns from a file") ); + mUseExcludeFromItem->setWhatsThis( i18n("Read exclude patterns from a file (--exclude-from=FILE). This option is similar to the --exclude=PATTERN option except that the exclude patterns are read from a file. This is a special filter rule. For further information on filter rules see rsync's manual page.") ); + addItem( mUseExcludeFromItem, QString::fromLatin1( "UseExcludeFrom" ) ); + mExcludeFromItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "ExcludeFrom" ), mExcludeFrom, QString::fromLatin1( "$HOME/exclude.txt" ) ); + mExcludeFromItem->setLabel( i18n("The file from which the exclude patterns are read") ); + addItem( mExcludeFromItem, QString::fromLatin1( "ExcludeFrom" ) ); + mUseIncludePatternItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseIncludePattern" ), mUseIncludePattern, false ); + mUseIncludePatternItem->setLabel( i18n("Do not exclude files matching a certain pattern") ); + mUseIncludePatternItem->setWhatsThis( i18n("Do not exclude files matching a certain pattern (--include=PATTERN). This is a special filter rule. For further information on filter rules see rsync's manual page.") ); + addItem( mUseIncludePatternItem, QString::fromLatin1( "UseIncludePattern" ) ); + mIncludePatternItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "IncludePattern" ), mIncludePattern ); + mIncludePatternItem->setLabel( i18n("Pattern that is used for file inclusion") ); + addItem( mIncludePatternItem, QString::fromLatin1( "IncludePattern" ) ); + mUseIncludeFromItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseIncludeFrom" ), mUseIncludeFrom, false ); + mUseIncludeFromItem->setLabel( i18n("Read include patterns from a file") ); + mUseIncludeFromItem->setWhatsThis( i18n("Read include patterns from a file (--include-from=FILE). This option is similar to the --include=PATTERN option except that the include patterns are read from a file. This is a special filter rule. For further information on filter rules see rsync's manual page.") ); + addItem( mUseIncludeFromItem, QString::fromLatin1( "UseIncludeFrom" ) ); + mIncludeFromItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "IncludeFrom" ), mIncludeFrom, QString::fromLatin1( "$HOME/include.txt" ) ); + mIncludeFromItem->setLabel( i18n("The file from which the include patterns are read") ); + addItem( mIncludeFromItem, QString::fromLatin1( "IncludeFrom" ) ); + mCustomFilteringRulesItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "CustomFilteringRules" ), mCustomFilteringRules ); + mCustomFilteringRulesItem->setLabel( i18n("Add custom file-filtering rules") ); + mCustomFilteringRulesItem->setWhatsThis( i18n("Add custom file-filtering rules (-f, --filter=RULE). This option allows you to add rules to selectively exclude certain files from the list of files to be transferred.") ); + addItem( mCustomFilteringRulesItem, QString::fromLatin1( "CustomFilteringRules" ) ); + mUseFFilterRuleItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseFFilterRule" ), mUseFFilterRule, false ); + mUseFFilterRuleItem->setLabel( i18n("Use -F filter rule") ); + mUseFFilterRuleItem->setWhatsThis( i18n("This filter rule tells rsync to look for per-directory .rsync-filter files that have been sprinkled through the hierarchy and use their rules to filter the files in the transfer. It has no effect, if you also choose to use the --filter='exclude .rsync-filter' rule.") ); + addItem( mUseFFilterRuleItem, QString::fromLatin1( "UseFFilterRule" ) ); + mUseFFFilterRuleItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseFFFilterRule" ), mUseFFFilterRule, false ); + mUseFFFilterRuleItem->setLabel( i18n("Use -FF filter rule") ); + mUseFFFilterRuleItem->setWhatsThis( i18n("This rule filters out the .rsync-filter files from the transfer. These files normally contain filter rules that can be activated by choosing the --filter='dir-merge /.rsync-filter' rule and deselecting this one.") ); + addItem( mUseFFFilterRuleItem, QString::fromLatin1( "UseFFFilterRule" ) ); + mEfficientSparseFileHandlingItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "EfficientSparseFileHandling" ), mEfficientSparseFileHandling, false ); + mEfficientSparseFileHandlingItem->setLabel( i18n("Handle sparse files efficiently") ); + mEfficientSparseFileHandlingItem->setWhatsThis( i18n("Handle sparse files efficiently (-S, --sparse) so that they take up less space on the destination. This option conflicts with --inplace. For further information read rsync's manual page.") ); + addItem( mEfficientSparseFileHandlingItem, QString::fromLatin1( "EfficientSparseFileHandling" ) ); + mCopyFilesWholeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "CopyFilesWhole" ), mCopyFilesWhole, false ); + mCopyFilesWholeItem->setLabel( i18n("Copy files whole (no rsync algorithm)") ); + mCopyFilesWholeItem->setWhatsThis( i18n("Copy files whole (-W, --whole-file). With this option the incremental rsync algorithm is not used and the whole file is sent as-is instead.") ); + addItem( mCopyFilesWholeItem, QString::fromLatin1( "CopyFilesWhole" ) ); + mOneFileSystemItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "OneFileSystem" ), mOneFileSystem, false ); + mOneFileSystemItem->setLabel( i18n("Do not cross file system boundaries") ); + mOneFileSystemItem->setWhatsThis( i18n("Do not cross file system boundaries (-x, --one-file-system). This tells rsync to avoid crossing a filesystem boundary when recursing. For further information on this option, read the manual page.") ); + addItem( mOneFileSystemItem, QString::fromLatin1( "OneFileSystem" ) ); + mUpdateExistingItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UpdateExisting" ), mUpdateExisting, false ); + mUpdateExistingItem->setLabel( i18n("Skip creating new files on the receiving side") ); + mUpdateExistingItem->setWhatsThis( i18n("Skip creating new files on the receiving side (--existing). This tells rsync to skip creating files (including directories) that do not exist yet on the destination. If this option is combined with the --ignore-existing option, no files will be updated (which can be useful if all you want to do is to delete extraneous files).") ); + addItem( mUpdateExistingItem, QString::fromLatin1( "UpdateExisting" ) ); + mIgnoreExistingItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "IgnoreExisting" ), mIgnoreExisting, false ); + mIgnoreExistingItem->setLabel( i18n("Skip updating files that exist on the receiving side") ); + mIgnoreExistingItem->setWhatsThis( i18n("Skip updating files that already exist on the receiving side (--ignore-existing). Existing directories are not ignored.") ); + addItem( mIgnoreExistingItem, QString::fromLatin1( "IgnoreExisting" ) ); + mDelayUpdatesItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "DelayUpdates" ), mDelayUpdates, false ); + mDelayUpdatesItem->setLabel( i18n("Delay updates until the end of the transfer") ); + mDelayUpdatesItem->setWhatsThis( i18n("Delay updates until the end of the transfer (--delay-updates). This option puts the temporary file from each updated file into a holding directory until the end of the transfer, at which time all the files are renamed and copied into place in rapid succession.") ); + addItem( mDelayUpdatesItem, QString::fromLatin1( "DelayUpdates" ) ); + mMakeBackupsItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "MakeBackups" ), mMakeBackups, false ); + mMakeBackupsItem->setLabel( i18n("Make backups") ); + mMakeBackupsItem->setWhatsThis( i18n("Make backups (-b, --backup). With this option, preexisting destination files are renamed as each file is transferred or deleted. You can control where the backup file goes and what (if any) suffix gets appended using the --backup-dir=DIR and --suffix=SUFFIX options.") ); + addItem( mMakeBackupsItem, QString::fromLatin1( "MakeBackups" ) ); + mUseBackupSuffixItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseBackupSuffix" ), mUseBackupSuffix, false ); + mUseBackupSuffixItem->setLabel( i18n("Use a suffix for backups") ); + mUseBackupSuffixItem->setWhatsThis( i18n("Use this suffix for backups (--suffix=SUFFIX).") ); + addItem( mUseBackupSuffixItem, QString::fromLatin1( "UseBackupSuffix" ) ); + mBackupSuffixItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "BackupSuffix" ), mBackupSuffix, QString::fromLatin1( "~" ) ); + mBackupSuffixItem->setLabel( i18n("Backup suffix") ); + addItem( mBackupSuffixItem, QString::fromLatin1( "BackupSuffix" ) ); + mUseBackupDirectoryItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseBackupDirectory" ), mUseBackupDirectory, false ); + mUseBackupDirectoryItem->setLabel( i18n("Put backups into a certain directory") ); + mUseBackupDirectoryItem->setWhatsThis( i18n("Store backups in this directory (--backup-dir=DIR).") ); + addItem( mUseBackupDirectoryItem, QString::fromLatin1( "UseBackupDirectory" ) ); + mBackupDirectoryItem = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "BackupDirectory" ), mBackupDirectory, QString::fromLatin1( "$HOME" ) ); + mBackupDirectoryItem->setLabel( i18n("Backup directory") ); + addItem( mBackupDirectoryItem, QString::fromLatin1( "BackupDirectory" ) ); + mUseBlockSizeItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseBlockSize" ), mUseBlockSize, false ); + mUseBlockSizeItem->setLabel( i18n("Force a fixed checksum block-size") ); + mUseBlockSizeItem->setWhatsThis( i18n("Force a fixed checksum block-size (-B, --block-size=SIZE). This forces the block size used in the rsync algorithm to a fixed value.") ); + addItem( mUseBlockSizeItem, QString::fromLatin1( "UseBlockSize" ) ); + mBlockSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "BlockSize" ), mBlockSize, 0 ); + mBlockSizeItem->setMinValue(0); + mBlockSizeItem->setLabel( i18n("The block size") ); + addItem( mBlockSizeItem, QString::fromLatin1( "BlockSize" ) ); + mUseChecksumSeedItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseChecksumSeed" ), mUseChecksumSeed, false ); + mUseChecksumSeedItem->setLabel( i18n("Set block/file checksum seed") ); + mUseChecksumSeedItem->setWhatsThis( i18n("Set block/file checksum seed (--checksum-seed=NUM). Set the MD4 checksum seed to this integer. This 4 byte checksum seed is included in each block and file MD4 checksum calculation. By default the checksum seed is generated by the server and defaults to the current time.") ); + addItem( mUseChecksumSeedItem, QString::fromLatin1( "UseChecksumSeed" ) ); + mChecksumSeedItem = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "ChecksumSeed" ), mChecksumSeed, 0 ); + mChecksumSeedItem->setMinValue(0); + mChecksumSeedItem->setLabel( i18n("The checksum seed") ); + addItem( mChecksumSeedItem, QString::fromLatin1( "ChecksumSeed" ) ); + mUseChecksumItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseChecksum" ), mUseChecksum, false ); + mUseChecksumItem->setLabel( i18n("Skip files based on a checksum") ); + mUseChecksumItem->setWhatsThis( i18n("Skip files based on a checksum and not based on modification time and size (-c, --checksum). For further information on how this feature works read rsync's manual page.") ); + addItem( mUseChecksumItem, QString::fromLatin1( "UseChecksum" ) ); + + setCurrentGroup( QString::fromLatin1( "SuperUser" ) ); + + QValueList valuesSuperUserProgram; + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Sudo" ); + valuesSuperUserProgram.append( choice ); + } + { + KConfigSkeleton::ItemEnum::Choice choice; + choice.name = QString::fromLatin1( "Super" ); + valuesSuperUserProgram.append( choice ); + } + mSuperUserProgramItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "SuperUserProgram" ), mSuperUserProgram, valuesSuperUserProgram, EnumSuperUserProgram::Sudo ); + mSuperUserProgramItem->setLabel( i18n("The program that should be used to gain super user privileges") ); + mSuperUserProgramItem->setWhatsThis( i18n("Choose the program that will grant you limited super user privileges for mounting and unmounting remote shares. You can either select sudo, the standard tool for this purpose on most distributions, or super.") ); + addItem( mSuperUserProgramItem, QString::fromLatin1( "SuperUserProgram" ) ); + mUseForceUnmountItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "UseForceUnmount" ), mUseForceUnmount, false ); + mUseForceUnmountItem->setLabel( i18n("Use super user privileges to unmount inaccessible shares") ); + mUseForceUnmountItem->setWhatsThis( i18n("Unmount a share under Linux by force. This even works if the file system is \"busy\", because it is immediately detached from the file system hierarchy and all references to it are cleaned up later when it is not busy anymore. Linux kernel 2.4.11 or later is needed to take advantage of this feature. Use with case! Note, that you will need the root password to write the necessary changes to the configuration file.") ); + addItem( mUseForceUnmountItem, QString::fromLatin1( "UseForceUnmount" ) ); + mAlwaysUseSuperUserItem = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "AlwaysUseSuperUser" ), mAlwaysUseSuperUser, false ); + mAlwaysUseSuperUserItem->setLabel( i18n("Use super user privileges to mount and unmount shares") ); + mAlwaysUseSuperUserItem->setWhatsThis( i18n("Use super user privileges for mounting and unmounting remote shares. This feature is only needed, if you are not allowed to use smbmount, smbumount, mount.cifs and umount.cifs as normal user. Note, that you will need the root password to write the necessary changes to the configuration file.") ); + addItem( mAlwaysUseSuperUserItem, QString::fromLatin1( "AlwaysUseSuperUser" ) ); +} + +Smb4KSettings::~Smb4KSettings() +{ + if ( mSelf == this ) + staticSmb4KSettingsDeleter.setObject( mSelf, 0, false ); +} + diff --git a/smb4k/core/smb4ksettings.kcfgc b/smb4k/core/smb4ksettings.kcfgc new file mode 100644 index 0000000..c103aec --- /dev/null +++ b/smb4k/core/smb4ksettings.kcfgc @@ -0,0 +1,6 @@ +File=smb4k.kcfg +ClassName=Smb4KSettings +Singleton=true +Mutators=true +ItemAccessors=true +SetUserTexts=true diff --git a/smb4k/core/smb4kshare.cpp b/smb4k/core/smb4kshare.cpp new file mode 100644 index 0000000..7877171 --- /dev/null +++ b/smb4k/core/smb4kshare.cpp @@ -0,0 +1,216 @@ +/*************************************************************************** + smb4kshare - This is a container that holds information about + a mounted remote share. + ------------------- + begin : Do Mär 4 2004 + copyright : (C) 2004 by Franck Babin + (C) 2005 by Alexander Reinholdt + email : babinfranck@yahoo.ca + dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include + +// system includes +#include +#include + +// application specific includes +#include "smb4kshare.h" + + +Smb4KShare::Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const int uid, const int gid, bool broken ) : +m_name(name), m_path( path.local8Bit() ), m_filesystem( filesystem ), m_user( uid ), m_group( gid ), m_cifs_login( QString::null ), m_broken( broken ), m_total( 0 ), m_free( 0 ) +{ + //FIXME should throw an exception if one of the param is empty + + if ( uid != (int)getuid() && gid != (int)getgid() ) + { + m_foreign_mount = true; + } + else + { + m_foreign_mount = false; + } +} + + +Smb4KShare::Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const QString &username, bool foreign, bool broken ) : +m_name( name ), m_path( path.local8Bit() ), m_filesystem( filesystem ), m_user( (int)getuid() ), m_group( (int)getgid() ), m_cifs_login( username ), m_foreign_mount( foreign ), m_broken( broken ), m_total( 0 ), m_free( 0 ) +{ +} + + +Smb4KShare::Smb4KShare( const Smb4KShare &s ) : +m_name( s.name() ), m_path( s.path() ), m_filesystem( s.filesystem() ), m_user( s.uid() ), m_group( s.gid() ), m_cifs_login( s.cifsLogin() ), m_foreign_mount( s.isForeign() ), m_broken( s.isBroken() ), m_total( s.totalDiskSpace() ), m_free( s.freeDiskSpace() ) +{ +} + + +Smb4KShare::~Smb4KShare() +{ +} + + + +const QString &Smb4KShare::name() const +{ + return m_name; +} + + +const QCString &Smb4KShare::path() const +{ + return m_path; +} + + +const QCString Smb4KShare::canonicalPath() const +{ + return m_broken ? m_path : QDir( m_path ).canonicalPath().local8Bit(); +} + + +int Smb4KShare::uid() const +{ + return (int)m_user.uid(); +} + + +void Smb4KShare::setUID( int uid ) +{ + m_user = KUser( uid ); +} + + +int Smb4KShare::gid() const +{ + return (int)m_group.gid(); +} + + +void Smb4KShare::setGID( int gid ) +{ + m_group = KUserGroup( gid ); +} + + +const QString Smb4KShare::user() const +{ + return m_user.loginName(); +} + + +const QString Smb4KShare::group() const +{ + return m_group.name(); +} + + +const QString &Smb4KShare::filesystem() const +{ + return m_filesystem; +} + + +const QString &Smb4KShare::cifsLogin() const +{ + return m_cifs_login; +} + + +bool Smb4KShare::isForeign() const +{ + return m_foreign_mount; +} + + +void Smb4KShare::setForeign( bool foreign ) +{ + m_foreign_mount = foreign; +} + + +bool Smb4KShare::isBroken() const +{ + return m_broken; +} + + +void Smb4KShare::setBroken( bool broken ) +{ + m_broken = broken; +} + + +void Smb4KShare::setTotalDiskSpace( double total ) +{ + m_total = total; +} + + +void Smb4KShare::setFreeDiskSpace( double free ) +{ + m_free = free; +} + + +double Smb4KShare::totalDiskSpace() const +{ + return m_total; +} + + +double Smb4KShare::freeDiskSpace() const +{ + return m_free; +} + + +double Smb4KShare::percentage() const +{ + return (m_total - m_free) / m_total * 100; +} + + +bool Smb4KShare::equals( const Smb4KShare &share ) +{ + bool equal = false; + + if ( QString::compare( m_name, share.name() ) == 0 && + QString::compare( m_path, share.path() ) == 0 && + QString::compare( m_filesystem, share.filesystem() ) == 0 && + QString::compare( m_cifs_login, share.cifsLogin() ) == 0 && + (int)m_user.uid() == share.uid() && + (int)m_group.gid() == share.gid() && + m_broken == share.isBroken() && + m_foreign_mount == share.isForeign() && + m_total == share.totalDiskSpace() && + m_free == share.freeDiskSpace() ) + { + equal = true; + } + + return equal; +} diff --git a/smb4k/core/smb4kshare.h b/smb4k/core/smb4kshare.h new file mode 100644 index 0000000..40c8c47 --- /dev/null +++ b/smb4k/core/smb4kshare.h @@ -0,0 +1,291 @@ +/*************************************************************************** + smb4kshare - This is a container that holds information about + a mounted remote share. + ------------------- + begin : Do M� 4 2004 + copyright : (C) 2004 by Franck Babin + (C) 2005-2007 by Alexander Reinholdt + email : babinfranck@yahoo.ca + dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARE_H +#define SMB4KSHARE_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include + + +/** + * This class is a container that holds information about a remote share + * that was mounted on the system. It belongs to the core classes of + * Smb4K. + * + * @author Franck Babin, + * @author Alexander Reinholdt + */ + +class Smb4KShare +{ + public: + /** + * The default constructor. + * + * @param name The name of the share: //HOST/SHARE or //USER\@HOST/SHARE (FreeBSD). + * + * @param path The path where the share is mounted to. + * + * @param filesystem The filesystem that was used. If you use this constructor it should be "smbfs". + * + * @param uid The UID of the user. + * + * @param gid The GID of the user. + * + * @param broken Determines whether the share is broken. "Broken" means that the share is unaccessible. + */ + Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const int uid = 0, const int gid = 0, bool broken = false ); + + /** + * The constructor for CIFS shares. It does not take the UID and GID, but the + * user name with which the login was done. + * + * @param name The name of the share: //HOST/SHARE or //USER@HOST/SHARE (FreeBSD). + * + * @param path The path where the share is mounted to. + * + * @param filesystem The filesystem that was used. If you use this constructor it should be "cifs". + * + * @param username The the user name that had to be used for authentication. It can be different from the local user name. + * + * @param foreign Determines whether the share was mounted by another user (i.e. is a foreign share). + * + * @param broken Determines whether the share is broken. "Broken" means that the share is unaccessible. + */ + Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const QString &username, bool foreign = false, bool broken = false ); + + /** + * Empty constructor. + */ + Smb4KShare() {} + + /** + * Copy constructor. + * + * @param share The share that is to be copied. + */ + Smb4KShare( const Smb4KShare &share ); + + /** + * The destructor + */ + ~Smb4KShare(); + + /** + * Returns the name of the share as it has been gathered by the mounter. + * + * @returns The name of the share. + */ + const QString &name() const; + + /** + * Returns the mount point aka path of the share as it has been gathered + * by the mounter. This is a C-type string. + * + * @returns The path of the share. + */ + const QCString &path() const; + + /** + * This function returns the canonical path of the share. In contrast to + * Smb4KShare::path(), it will return the absolute path without symlinks. However, + * should the share be broken (i.e. Smb4KShare::isBroken() returns TRUE), + * only Smb4KShare::path() is returned. + * + * @returns Returns the canonical path of the share. + */ + const QCString canonicalPath() const; + + /** + * Returns the UID of the mounted share. + */ + int uid() const; + + /** + * Set the UID of the mounted share. + * + * @param uid The UID of the share + */ + void setUID( int uid ); + + /** + * Returns the GID of the mounted share. + */ + int gid() const; + + /** + * Set the GID of the mounted share. + * + * @param gid The GID of the share + */ + void setGID( int gid ); + + /** + * Returns the name of the user of the share. + */ + const QString user() const; + + /** + * Returns the name of the group of the share. + */ + const QString group() const; + + /** + * Returns the file system of the share. + */ + const QString &filesystem() const; + + /** + * Returns the CIFS login (user name). + */ + const QString &cifsLogin() const; + + /** + * Is TRUE if the share is/seems to be mounted by another + * user. + * + * @returns TRUE if another user mounted the share and FALSE otherwise. + */ + bool isForeign() const; + + /** + * This function sets the share to be foreign. + * + * @param foreign TRUE if share is foreign and FALSE otherwise. + */ + void setForeign( bool foreign ); + + /** + * Returns TRUE if the share is broken and FALSE otherwise. + */ + bool isBroken() const; + + /** + * Sets the share to be broken. + * + * @param broken TRUE if the share is broken and FALSE otherwise. + */ + void setBroken( bool broken ); + + /** + * This function sets the value of the total disk usage. The value has to + * be provided in kilobytes. If the disk usage could not be determined, + * total has to be set to -1. + * + * @param total The total disk usage in kB. + */ + void setTotalDiskSpace( double total ); + + /** + * This function sets the value of the free space on the share. The value + * has to be provided in kilobytes. If the free space could not be determined, + * free has to be set to -1. + * + * @param free The free disk space in kB. + */ + void setFreeDiskSpace( double free ); + + /** + * This function returns the total disk space of the share. + * + * @returns The total disk space in kB. + */ + double totalDiskSpace() const; + + /** + * This function returns the free disk space available on the share in kB. + * + * @returns the free disk space in kB. + */ + double freeDiskSpace() const; + + /** + * This function returns the percentage of used disk space on the + * share. + * + * @returns the percentage of disk space used on the share. + */ + double percentage() const; + + /** + * Compare another Smb4KShare object with this one and return TRUE if both + * carry the same data. + * + * @param share The Smb4KShare object that is compared to this one + * + * @returns TRUE if the values match. + */ + bool equals( const Smb4KShare &share ); + + + private: + /** + * The name of the share. + */ + QString m_name; + + /** + * The mount point / path of the share + */ + QCString m_path; + + /** + * The filesystem string + */ + QString m_filesystem; + + /** + * The user ID of the share. + */ + KUser m_user; + + /** + * The group ID of the share. + */ + KUserGroup m_group; + + /** + * The CIFS login name + */ + QString m_cifs_login; + bool m_foreign_mount; + bool m_broken; + double m_total; + double m_free; +}; + +#endif diff --git a/smb4k/core/smb4ksynchronizationinfo.cpp b/smb4k/core/smb4ksynchronizationinfo.cpp new file mode 100644 index 0000000..072014f --- /dev/null +++ b/smb4k/core/smb4ksynchronizationinfo.cpp @@ -0,0 +1,76 @@ +/*************************************************************************** + smb4ksynchronizationinfo - This is a container that holds + information about progress of the synchronization + ------------------- + begin : So Mai 20 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// application specific includes +#include "smb4ksynchronizationinfo.h" + + +Smb4KSynchronizationInfo::Smb4KSynchronizationInfo() : m_text( QString::null ), +m_individual_progress( -1 ), m_total_progress( -1 ), m_total_files( -1 ), +m_processed_files( -1 ), m_rate( QString::null ) +{ +} + + +Smb4KSynchronizationInfo::~Smb4KSynchronizationInfo() +{ +} + + +void Smb4KSynchronizationInfo::setText( const QString &text ) +{ + m_text = text; +} + + +void Smb4KSynchronizationInfo::setIndividualProgress( int percent ) +{ + m_individual_progress = percent; +} + + +void Smb4KSynchronizationInfo::setTotalProgress( int percent ) +{ + m_total_progress = percent; +} + + +void Smb4KSynchronizationInfo::setTotalFileNumber( int total ) +{ + m_total_files = total; +} + + +void Smb4KSynchronizationInfo::setProcessedFileNumber( int processed ) +{ + m_processed_files = processed; +} + + +void Smb4KSynchronizationInfo::setTransferRate( const QString &rate ) +{ + m_rate = rate; +} diff --git a/smb4k/core/smb4ksynchronizationinfo.h b/smb4k/core/smb4ksynchronizationinfo.h new file mode 100644 index 0000000..f254dd1 --- /dev/null +++ b/smb4k/core/smb4ksynchronizationinfo.h @@ -0,0 +1,176 @@ +/*************************************************************************** + smb4ksynchronizationinfo - This is a container that holds + information about progress of the synchronization + ------------------- + begin : So Mai 20 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSYNCHRONIZATIONINFO_H +#define SMB4KSYNCHRONIZATIONINFO_H + +// Qt includes +#include + +class Smb4KSynchronizationInfo +{ + public: + /** + * The constructor. It takes no arguments and you should use the + * setXYZ() functions to set the necessary values. + */ + Smb4KSynchronizationInfo(); + + /** + * The destructor. + */ + ~Smb4KSynchronizationInfo(); + + /** + * Set the text that's provided in rsync's output. This may either be a + * file name or some information about the progress + * + * @param text The text + */ + void setText( const QString &text ); + + /** + * Return the name of the file that is currently processed. This may + * be empty if no information about the file name is available. + * + * @returns the name of the file that is currently processed or an empty + * string + */ + const QString &text () const { return m_text; } + + /** + * Set the progress of the file that's currently processed. + * + * @param percent The progress in percent + */ + void setIndividualProgress( int percent ); + + /** + * Return the progress of the current file transfer. If no + * information is available, -1 is returned. + * + * @returns the progress of the current file transfer or -1. + */ + const int individualProgress() const { return m_individual_progress; } + + /** + * Set the total progress of synchronization process. + * + * @param percent The progress in percent + */ + void setTotalProgress( int percent ); + + /** + * Return the total progress of synchronization process. If no + * information is available, -1 is returned. + * + * @returns the total progress of the synchronization or -1. + */ + const int totalProgress() const { return m_total_progress; } + + /** + * Set the total number of files that have been considered for the + * synchronization. + * + * @param total The total number of files + */ + void setTotalFileNumber( int total ); + + /** + * Return the total number of files that were considered for synchronization. + * If no information is available, -1 is returned. + * + * @returns the total number of files or -1. + */ + const int totalFileNumber() const { return m_total_files; } + + /** + * Set the number of files that have already been processed during the + * synchronization. + * + * @param processed The number of files that have been processed + */ + void setProcessedFileNumber( int processed ); + + /** + * Return the number of files that have already been processed during the + * synchronization. If no information is available, -1 is returned. + * + * @returns the number of processed files or -1. + */ + const int processedFileNumber() const { return m_processed_files; } + + /** + * Set the transfer rate. This should be a string that already contains + * all information, i.e. the string should look like this: 100 kB/s. + * + * @param rate The rate string (e.g. 100 kB/s) + */ + void setTransferRate( const QString &rate ); + + /** + * Return the transfer rate. This is a string that already contains all + * information, so that you can just put it into your widget without any + * modification. It may also be empty if no information about the rate is + * available. + * + * @returns The rate or an empty string. + */ + const QString &transferRate() const { return m_rate; } + + private: + /** + * The text + */ + QString m_text; + + /** + * The individual progress + */ + int m_individual_progress; + + /** + * The total progress + */ + int m_total_progress; + + /** + * The total file number + */ + int m_total_files; + + /** + * The number of processed files + */ + int m_processed_files; + + /** + * The rate string + */ + QString m_rate; +}; + +#endif diff --git a/smb4k/core/smb4ksynchronizer.cpp b/smb4k/core/smb4ksynchronizer.cpp new file mode 100644 index 0000000..21ac788 --- /dev/null +++ b/smb4k/core/smb4ksynchronizer.cpp @@ -0,0 +1,503 @@ +/*************************************************************************** + smb4ksynchronizer - This is the synchronizer of Smb4K. + ------------------- + begin : Mo Jul 4 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4ksynchronizer.h" +#include "smb4kdefs.h" +#include "smb4kerror.h" +#include "smb4kglobal.h" +#include "smb4kshare.h" +#include "smb4ksynchronizationinfo.h" +#include "smb4ksettings.h" + +using namespace Smb4KGlobal; + +bool cancel = false; + + +Smb4KSynchronizer::Smb4KSynchronizer( QObject *parent, const char *name ) +: QObject( parent, name ) +{ + m_proc = new KProcess( this, "SynchronizerProcess" ); + + m_proc->setUseShell( true ); + + m_working = false; + + connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) ); + + connect( m_proc, SIGNAL( processExited( KProcess* ) ), + this, SLOT( slotProcessExited( KProcess * ) ) ); + + connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ), + this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) ); + + connect( kapp, SIGNAL( shutDown() ), + this, SLOT( slotShutdown() ) ); +} + + +Smb4KSynchronizer::~Smb4KSynchronizer() +{ +} + + +/**************************************************************************** + Synchronizes a share with a local copy or vice versa. +****************************************************************************/ + +void Smb4KSynchronizer::synchronize( const QString &source, const QString &destination ) +{ + if ( Smb4KSettings::rsync().isEmpty() ) + { + Smb4KError::error( ERROR_COMMAND_NOT_FOUND, "rsync" ); + return; + } + + // FIXME: Do not stop here but buffer the requests and + // process them if the previous process finished. + if ( isRunning() ) + { + return; + } + + m_working = true; + emit state( SYNCHRONIZER_START ); + emit start(); + + // We will only define the stuff we urgently need + // here. The options that actually influence rsync's + // behavior will be retrieved by readRsyncOptions(). + QString command = "rsync --progress "; + + command.append( readRsyncOptions() ); + command.append( " " ); + command.append( KProcess::quote( source ) ); + command.append( " " ); + command.append( KProcess::quote( destination ) ); + + *m_proc << command; + + // Use KProcess::OwnGroup instead of KProcess::NotifyOnExit here, because + // this garantees that the process is indeed killed when using abort(). + // See KProcess docs for further information. + m_proc->start( KProcess::OwnGroup, KProcess::AllOutput ); +} + + +/**************************************************************************** + Reads the options that should be used with rsync +****************************************************************************/ + +const QString Smb4KSynchronizer::readRsyncOptions() +{ + QString options; + + if ( Smb4KSettings::archiveMode() ) + { + options.append( " --archive" ); + } + else + { + options.append( Smb4KSettings::recurseIntoDirectories() ? + " --recursive" : + "" ); + + options.append( Smb4KSettings::preserveSymlinks() ? + " --links" : + "" ); + + options.append( Smb4KSettings::preservePermissions() ? + " --perms" : + "" ); + + options.append( Smb4KSettings::preserveTimes() ? + " --times" : + "" ); + + options.append( Smb4KSettings::preserveGroup() ? + " --group" : + "" ); + + options.append( Smb4KSettings::preserveOwner() ? + " --owner" : + "" ); + + options.append( Smb4KSettings::preserveDevicesAndSpecials() ? + " --devices --specials" : // alias: -D + "" ); + } + + options.append( Smb4KSettings::relativePathNames() ? + " --relative" : + "" ); + + options.append( Smb4KSettings::omitDirectoryTimes() ? + " --omit-dir-times" : + "" ); + + options.append( Smb4KSettings::noImpliedDirectories() ? + " --no-implied-dirs" : + "" ); + + options.append( Smb4KSettings::updateTarget() ? + " --update" : + "" ); + + options.append( Smb4KSettings::updateInPlace() ? + " --inplace" : + "" ); + + options.append( Smb4KSettings::transferDirectories() ? + " --dirs" : + "" ); + + options.append( Smb4KSettings::transformSymlinks() ? + " --copy-links" : + "" ); + + options.append( Smb4KSettings::transformUnsafeSymlinks() ? + " --copy-unsafe-links" : + "" ); + + options.append( Smb4KSettings::ignoreUnsafeSymlinks() ? + " --safe-links" : + "" ); + + options.append( Smb4KSettings::preserveHardLinks() ? + " --hard-links" : + "" ); + + options.append( Smb4KSettings::keepDirectorySymlinks() ? + " --keep-dirlinks" : + "" ); + + options.append( Smb4KSettings::deleteExtraneous() ? + " --delete" : + "" ); + + options.append( Smb4KSettings::removeSourceFiles() ? + " --remove-source-files" : + "" ); + + options.append( Smb4KSettings::deleteBefore() ? + " --delete-before" : + "" ); + + options.append( Smb4KSettings::deleteDuring() ? + " --delete-during" : + "" ); + + options.append( Smb4KSettings::deleteAfter() ? + " --delete-after" : + "" ); + + options.append( Smb4KSettings::deleteExcluded() ? + " --delete-excluded" : + "" ); + + options.append( Smb4KSettings::ignoreErrors() ? + " --ignore-errors" : + "" ); + + options.append( Smb4KSettings::forceDirectoryDeletion() ? + " --force" : + "" ); + + options.append( Smb4KSettings::copyFilesWhole() ? + " --whole-file" : + "" ); + + options.append( Smb4KSettings::efficientSparseFileHandling() ? + " --sparse" : + "" ); + + options.append( Smb4KSettings::oneFileSystem() ? + " --one-file-system" : + "" ); + + options.append( Smb4KSettings::updateExisting() ? + " --existing" : + "" ); + + options.append( Smb4KSettings::ignoreExisting() ? + " --ignore-existing" : + "" ); + + options.append( Smb4KSettings::delayUpdates() ? + " --delay-updates" : + "" ); + + options.append( Smb4KSettings::compressData() ? + " --compress" : + "" ); + + if ( Smb4KSettings::makeBackups() ) + { + options.append( " --backup" ); + + options.append( Smb4KSettings::useBackupDirectory() ? + " --backup-dir="+Smb4KSettings::backupDirectory() : + "" ); + + options.append( Smb4KSettings::useBackupSuffix() ? + " --suffix="+Smb4KSettings::backupSuffix() : + "" ); + } + + options.append( Smb4KSettings::useMaximumDelete() ? + " --max-delete="+QString( "%1" ).arg( Smb4KSettings::maximumDeleteValue() ) : + "" ); + + options.append( Smb4KSettings::useChecksum() ? + " --checksum" : + "" ); + + options.append( Smb4KSettings::useBlockSize() ? + " --block-size="+QString( "%1" ).arg( Smb4KSettings::blockSize() ) : + "" ); + + options.append( Smb4KSettings::useChecksumSeed() ? + " --checksum-seed="+QString( "%1" ).arg( Smb4KSettings::checksumSeed() ) : + "" ); + + if ( !Smb4KSettings::customFilteringRules().isEmpty() ) + { + options.append( " "+Smb4KSettings::customFilteringRules() ); + } + + options.append( Smb4KSettings::useMinimalTransferSize() ? + " --min-size="+QString( "%1" ).arg( Smb4KSettings::minimalTransferSize() )+"K" : + "" ); + + options.append( Smb4KSettings::useMaximalTransferSize() ? + " --max-size="+QString( "%1" ).arg( Smb4KSettings::maximalTransferSize() )+"K" : + "" ); + + if ( Smb4KSettings::keepPartial() ) + { + options.append( " --partial" ); + + options.append( Smb4KSettings::usePartialDirectory() ? + " --partial-dir="+Smb4KSettings::partialDirectory() : + "" ); + } + + options.append( Smb4KSettings::useCVSExclude() ? + " --cvs-exclude" : + "" ); + + options.append( Smb4KSettings::useFFilterRule() ? + " -F" : + "" ); + + options.append( Smb4KSettings::useFFFilterRule() ? + " -F -F" : + "" ); + + options.append( Smb4KSettings::useExcludePattern() ? + " --exclude="+Smb4KSettings::excludePattern() : + "" ); + + options.append( Smb4KSettings::useExcludeFrom() ? + " --exclude-from="+Smb4KSettings::excludeFrom() : + "" ); + + options.append( Smb4KSettings::useIncludePattern() ? + " --include="+Smb4KSettings::includePattern() : + "" ); + + options.append( Smb4KSettings::useIncludeFrom() ? + " --include-from="+Smb4KSettings::includeFrom() : + "" ); + + return options; +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSynchronizer::abort() +{ + cancel = true; + + if ( m_proc->isRunning() ) + { + m_proc->kill(); + } +} + + +void Smb4KSynchronizer::slotProcessExited( KProcess * ) +{ + m_proc->clearArguments(); + + m_working = false; + + emit finished(); + emit state( SYNCHRONIZER_STOP ); +} + + +void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len ) +{ + m_buffer = QString::fromLocal8Bit( buf, len ); + + Smb4KSynchronizationInfo sync_info; + + QString partial, total, files, rate; + + if ( m_buffer[0].isSpace() && m_buffer.contains( "/s ", true ) > 0 ) + { + partial = m_buffer.section( "%", 0, 0 ).section( " ", -1, -1 ).stripWhiteSpace(); + + if ( !partial.isEmpty() ) + { + sync_info.setIndividualProgress( partial.toInt() ); + } + + if ( m_buffer.contains( "to-check=" ) > 0 ) + { + // Newer versions of rsync: + QString tmp = m_buffer.section( "to-check=", 1, 1 ).section( ")", 0, 0 ).stripWhiteSpace(); + + if ( !tmp.isEmpty() ) + { + double tmp_total = tmp.section( "/", 1, 1 ).stripWhiteSpace().toInt(); + double tmp_done = tmp.section( "/", 0, 0 ).stripWhiteSpace().toInt(); + double tmp_percent = ((tmp_total-tmp_done)/tmp_total)*100; + + total = QString( "%1" ).arg( tmp_percent ).section( ".", 0, 0 ).stripWhiteSpace(); + } + } + else + { + // Older versions of rsync: + total = m_buffer.section( " (", 1, 1 ).section( ",", 1, 1 ).section( "%", 0, 0 ).section( ".", 0, 0 ).stripWhiteSpace(); + } + + if ( !total.isEmpty() ) + { + sync_info.setTotalProgress( total.toInt() ); + } + + if ( m_buffer.contains( "xfer#" ) > 0 ) + { + // Newer versions of rsync: + files = m_buffer.section( "xfer#", 1, 1 ).section( ",", 0, 0 ).stripWhiteSpace(); + } + else + { + // Older versions of rsync: + files = m_buffer.section( " (", 1, 1 ).section( ",", 0, 0 ).stripWhiteSpace(); + } + + if ( !files.isEmpty() ) + { + sync_info.setProcessedFileNumber( files.toInt() ); + sync_info.setTotalFileNumber( m_total_files.toInt() ); + } + + rate = m_buffer.section( "/s ", 0, 0 ).section( " ", -1, -1 ).stripWhiteSpace(); + + if ( !rate.isEmpty() ) + { + rate.append( "/s" ); + rate.insert( rate.length() - 4, " " ); + + sync_info.setTransferRate( rate ); + } + + m_buffer = QString::null; + } + else if ( !m_buffer[0].isSpace() && m_buffer.endsWith( "\n" ) && m_buffer.contains( "/s ", true ) == 0 ) + { + sync_info.setText( m_buffer.stripWhiteSpace() ); + + if ( m_buffer.contains( "files to consider" ) != 0 ) + { + m_total_files = m_buffer.section( " files to consider", 0, 0 ).section( " ", -1, -1 ).stripWhiteSpace(); + + sync_info.setTotalFileNumber( m_total_files.toInt() ); + } + + m_buffer = QString::null; + } + + emit progress( sync_info ); +} + + + +void Smb4KSynchronizer::slotReceivedStderr( KProcess *, char *buf, int len ) +{ + QString error_message = QString::fromLocal8Bit( buf, len ); + + // At least under Debian unstable (20051216), rsync emits an error + // when you kill the process (using SIGTERM). Pressing the cancel + // button will exactly do this. Thus, we need to exclude this occasion + // from here. + if ( !cancel && error_message.contains( "rsync error:", true ) != 0 ) + { + // Cancel the whole synchronization in case an error occurred. + // If we don't do it, the user might be flooded with error messages + // especially if you try to synchronize a local copy with a remote + // share that is mounted read-only. + abort(); + Smb4KError::error( ERROR_SYNCHRONIZING, QString::null, error_message ); + } + else + { + cancel = false; + } +} + + +void Smb4KSynchronizer::slotShutdown() +{ + abort(); +} + +#include "smb4ksynchronizer.moc" diff --git a/smb4k/core/smb4ksynchronizer.h b/smb4k/core/smb4ksynchronizer.h new file mode 100644 index 0000000..ecc279f --- /dev/null +++ b/smb4k/core/smb4ksynchronizer.h @@ -0,0 +1,194 @@ +/*************************************************************************** + smb4ksynchronizer - This is the synchronizer of Smb4K. + ------------------- + begin : Mo Jul 4 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSYNCHRONIZER_H +#define SMB4KSYNCHRONIZER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +// Qt includes +#include +#include + +// forward declarations +class Smb4KShare; +class Smb4KSynchronizationInfo; + + +/** + * This is a core class of Smb4K. It manages the synchronization of remote + * shares with a local copy (and vice versa). + * + * @author Alexander Reinholdt + */ + + +class Smb4KSynchronizer : public QObject +{ + Q_OBJECT + + public: + /** + * The constructor of the synchronizer. + * + * @param parent The parent of this object + * + * @param name The name of this object + */ + Smb4KSynchronizer( QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KSynchronizer(); + + /** + * This function synchronizes a destination with the source. + * + * @param source The source location + * + * @param destination The destination + */ + void synchronize( const QString &source, const QString &destination ); + + /** + * This function reports if the synchronizer is running or not. + * + * @returns TRUE if the synchronizer is running an FALSE otherwise. + */ + bool isRunning() { return m_working; } + + public slots: + /** + * This function aborts the synchronization, i.e. the sync process is killed. + */ + void abort(); + + signals: + /** + * This signal emits the run state. + * + * @param state The so-called run state. There are several defined + * in the smb4kdefs.h header file. + */ + void state( int state ); + + /** + * This signal is emitted just before the synchronization process is + * started. + */ + void start(); + + /** + * This signal is emitted when the synchronization process finished. + */ + void finished(); + + /** + * Emit information about the progress of current synchronization process. + * The information that's available may only be partial, i.e. that maybe + * the file name or the rate or somthing else is missing. That's because + * of the way the output of rsync is processed. + * + * @param info Information about progress of the synchronization + * process + */ + void progress( const Smb4KSynchronizationInfo &info ); + + protected slots: + /** + * Reimplemented from KProcess. + * + * @param proc The process that exited + */ + void slotProcessExited( KProcess *proc ); + + /** + * Reimplemented from KProcess. + * + * @param proc The process from which output was received on stdout + * + * @param buf The buffer that contains the output + * + * @param len The length of the buffer + */ + void slotReceivedStdout( KProcess *proc, char *buf, int len ); + + /** + * Reimplemented from KProcess. + * + * @param proc The process from which output was received on stderr + * + * @param buf The buffer that contains the output + * + * @param len The length of the buffer + */ + void slotReceivedStderr( KProcess *proc, char *buf, int len ); + + /** + * This slot is connected to KApplication::shutDown() signal. + * It aborts the running KProcess if necessary. + */ + void slotShutdown(); + + private: + /** + * The process object for this class. + */ + KProcess *m_proc; + + /** + * This booian is TRUE if the synchronizer is working and FALSE otherwise. + */ + bool m_working; + + /** + * This function reads the options, that the user chose to use with rsync. + * + * @returns an option string + */ + const QString readRsyncOptions(); + + /** + * The buffer for the output. + * + * NOTE: The buffer is not to contain error messages, that are received + * via slotReceivedStderr()! + */ + QString m_buffer; + + /** + * Total number of files to transfer + */ + QString m_total_files; +}; + +#endif diff --git a/smb4k/dialogs/Makefile.am b/smb4k/dialogs/Makefile.am new file mode 100644 index 0000000..28a1b47 --- /dev/null +++ b/smb4k/dialogs/Makefile.am @@ -0,0 +1,11 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO +lib_LTLIBRARIES = libsmb4kdialogs.la +libsmb4kdialogs_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries) +libsmb4kdialogs_la_SOURCES = smb4kbookmarkeditor.cpp \ + smb4kcustomoptionsdialog.cpp smb4kmountdialog.cpp smb4kpreviewdialog.cpp smb4kprintdialog.cpp \ + smb4ksynchronizationdialog.cpp +libsmb4kdialogs_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_QT) +noinst_HEADERS = smb4kbookmarkeditor.h smb4kmountdialog.h smb4kpreviewdialog.h \ + smb4kprintdialog.h smb4ksynchronizationdialog.h diff --git a/smb4k/dialogs/smb4kbookmarkeditor.cpp b/smb4k/dialogs/smb4kbookmarkeditor.cpp new file mode 100644 index 0000000..b348e80 --- /dev/null +++ b/smb4k/dialogs/smb4kbookmarkeditor.cpp @@ -0,0 +1,258 @@ +/*************************************************************************** + smb4kbookmarkeditor - This is the bookmark editor of Smb4K. + ------------------- + begin : Di Okt 5 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4kbookmarkeditor.h" +#include "../core/smb4kbookmark.h" +#include "../core/smb4kcore.h" +#include "../core/smb4kglobal.h" +#include "../core/smb4ksettings.h" + +using namespace Smb4KGlobal; + + +Smb4KBookmarkEditor::Smb4KBookmarkEditor( QWidget *parent, const char *name ) +: KDialogBase( Plain, i18n( "Bookmark Editor" ), Ok|Cancel, Ok, parent, name, true, true ) +{ + setWFlags( Qt::WDestructiveClose ); + + QFrame *frame = plainPage(); + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 5 ); + + m_view = new KListView( frame ); + m_view->addColumn( i18n( "Bookmark" ), Bookmark ); + m_view->addColumn( i18n( "Workgroup" ), Workgroup ); + m_view->addColumn( i18n( "IP Address" ), IPAddress ); + m_view->addColumn( i18n( "Label" ), Label ); +// m_view->setAllColumnsShowFocus( true ); + m_view->setItemsRenameable( true ); + m_view->setRenameable( Bookmark, false ); + m_view->setRenameable( Workgroup, false ); + m_view->setRenameable( IPAddress, true ); + m_view->setRenameable( Label, true ); + + m_collection = new KActionCollection( this, "BookmarkEditor_ActionCollection", KGlobal::instance() ); + + (void) new KAction( i18n( "&Remove" ), "remove", Key_Delete, this, SLOT( slotRemoveClicked() ), m_collection, "remove_bookmark" ); + + (void) new KAction( i18n( "Remove &All" ), "editdelete", CTRL+Key_X, this, SLOT( slotDeleteAllClicked() ), m_collection, "remove_all_bookmarks" ); + + slotLoadBookmarks(); + + layout->addWidget( m_view, 0, 0, 0 ); + + setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "BookmarkEditor" ) ); + setMinimumSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() ); + + connect( m_view, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), + this, SLOT( slotRightButtonPressed( QListViewItem *, const QPoint &, int ) ) ); + + connect( m_view, SIGNAL( itemRenamed( QListViewItem * ) ), + this, SLOT( slotItemRenamed( QListViewItem * ) ) ); + + connect( this, SIGNAL( okClicked() ), + this, SLOT( slotOkClicked() ) ); + + connect( this, SIGNAL( cancelClicked() ), + this, SLOT( slotCancelClicked() ) ); + + connect( Smb4KCore::bookmarkHandler(), SIGNAL( bookmarksUpdated() ), + this, SLOT( slotLoadBookmarks() ) ); +} + + +Smb4KBookmarkEditor::~Smb4KBookmarkEditor() +{ + uint index = 0; + + while ( index < m_collection->count() ) + { + delete m_collection->action( index++ ); + } + + m_collection->clear(); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KBookmarkEditor::slotRightButtonPressed( QListViewItem *item, const QPoint &pos, int ) +{ + if ( !item ) + { + m_collection->action( "remove_bookmark" )->setEnabled( false ); + } + else + { + m_collection->action( "remove_bookmark" )->setEnabled( true ); + } + + if ( m_view->childCount() == 0 ) + { + m_collection->action( "remove_all_bookmarks" )->setEnabled( false ); + } + else + { + m_collection->action( "remove_all_bookmarks" )->setEnabled( true ); + } + + KActionMenu *menu = static_cast( child( "BookmarkEditorPopupMenu", "KActionMenu", true ) ); + + if ( !menu ) + { + menu = new KActionMenu( this, "BookmarkEditorPopupMenu" ); + menu->insert( m_collection->action( "remove_bookmark" ) ); + menu->insert( m_collection->action( "remove_all_bookmarks" ) ); + } + + menu->popup( pos ); +} + + +void Smb4KBookmarkEditor::slotRemoveClicked() +{ + if ( m_view->currentItem() ) + { + delete m_view->currentItem(); + } + + // Adjust the columns: + for ( int col = 0; col < m_view->columns(); col++ ) + { + m_view->adjustColumn( col ); + } +} + + +void Smb4KBookmarkEditor::slotDeleteAllClicked() +{ + m_view->clear(); + + // Adjust the columns: + for ( int col = 0; col < m_view->columns(); col++ ) + { + m_view->adjustColumn( col ); + } +} + + +void Smb4KBookmarkEditor::slotOkClicked() +{ + KActionPtrList list = m_collection->actions( "BookmarkEditor" ); + + for ( KActionPtrList::Iterator it = list.begin(); it != list.end(); ++it ) + { + delete *it; + } + + QValueList bookmarks; + + if ( m_view->childCount() != 0 ) + { + QListViewItemIterator it( m_view ); + + while( it.current() ) + { + bookmarks.append( new Smb4KBookmark( + it.current()->text( Bookmark ).section( "/", 2, 2 ).stripWhiteSpace(), + it.current()->text( Bookmark ).section( "/", 3, 3 ).stripWhiteSpace(), + it.current()->text( Workgroup ).stripWhiteSpace(), + it.current()->text( IPAddress ).stripWhiteSpace(), + "Disk", + it.current()->text( Label ).stripWhiteSpace() ) ); + ++it; + } + } + + Smb4KCore::bookmarkHandler()->writeBookmarkList( bookmarks ); + + saveDialogSize( *(Smb4KSettings::self()->config()), "BookmarkEditor" ); +} + + +void Smb4KBookmarkEditor::slotCancelClicked() +{ + KActionPtrList list = m_collection->actions( "BookmarkEditor" ); + + for ( KActionPtrList::Iterator it = list.begin(); it != list.end(); ++it ) + { + m_collection->kaccel()->remove( (*it)->name() ); + m_collection->remove( *it ); + } +} + + +void Smb4KBookmarkEditor::slotLoadBookmarks() +{ + m_view->clear(); + + QValueList bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks(); + + for ( QValueList::ConstIterator it = bookmarks.begin(); it != bookmarks.end(); ++it ) + { + KListViewItem *item = new KListViewItem( m_view ); + item->setText( Bookmark, (*it)->bookmark() ); + item->setText( Workgroup, (*it)->workgroup() ); + item->setText( IPAddress, (*it)->ip() ); + item->setText( Label, (*it)->label() ); + item->setPixmap( Bookmark, SmallIcon( "folder" ) ); + } + + // Adjust the columns: + for ( int col = 0; col < m_view->columns(); col++ ) + { + m_view->adjustColumn( col ); + } +} + + +void Smb4KBookmarkEditor::slotItemRenamed( QListViewItem * ) +{ + // Adjust the columns: + for ( int col = 0; col < m_view->columns(); col++ ) + { + m_view->adjustColumn( col ); + } +} + +#include "smb4kbookmarkeditor.moc" diff --git a/smb4k/dialogs/smb4kbookmarkeditor.h b/smb4k/dialogs/smb4kbookmarkeditor.h new file mode 100644 index 0000000..8184c0c --- /dev/null +++ b/smb4k/dialogs/smb4kbookmarkeditor.h @@ -0,0 +1,137 @@ +/*************************************************************************** + smb4kbookmarkeditor - description + ------------------- + begin : Di Okt 5 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KBOOKMARKEDITOR_H +#define SMB4KBOOKMARKEDITOR_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include +#include + +/** + * This is the bookmark editor of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KBookmarkEditor : public KDialogBase +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent of this dialog. + * + * @param name The name of this dialog. + */ + Smb4KBookmarkEditor( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KBookmarkEditor(); + + /** + * This function returns a pointer to the action collection of this class. + * You should use it to include the action into the action collection of the + * main action collection (e.g. KMainWindow::actionCollection()). + * + * The entries in this action collection are members of the group "BookmarkEditor". + * + * @returns a pointer to the action collection of this class + */ + KActionCollection *action_collection() { return m_collection; } + + protected slots: + /** + * This slot is activated whenever the right mouse button + * has been pressed. + * + * @param item The item over which the mouse pointer is (maybe NULL). + * + * @param pos The position where the mouse is. + * + * @param col The column of the list view item. + */ + void slotRightButtonPressed ( QListViewItem *item, const QPoint &pos, int col ); + + /** + * This slot is activated whenever the remove button of the + * menu is clicked. + */ + void slotRemoveClicked(); + + /** + * This slot is activated whenever the 'Remove All' button of + * the menu has been clicked. + */ + void slotDeleteAllClicked(); + + /** + * This slot is activated if the OK button has been clicked. + */ + void slotOkClicked(); + + /** + * This slot is activated if the Cancel button has been clicked. + */ + void slotCancelClicked(); + + /** + * This slot is invoked, if the bookmark handler updated the bookmarks. + */ + void slotLoadBookmarks(); + + /** + * This slot is invoked when an item was renamed. It will adjust the columns. + * + * @param item The item that was renamed. + */ + void slotItemRenamed( QListViewItem *item ); + + private: + /** + * Enumeration for the columns in the list view. + */ + enum Columns { Bookmark = 0, Workgroup = 1, IPAddress = 2, Label = 3 }; + /** + * The listview. + */ + KListView *m_view; + + /** + * The action collection of this class. + */ + KActionCollection *m_collection; +}; + +#endif diff --git a/smb4k/dialogs/smb4kcustomoptionsdialog.cpp b/smb4k/dialogs/smb4kcustomoptionsdialog.cpp new file mode 100644 index 0000000..6d8609b --- /dev/null +++ b/smb4k/dialogs/smb4kcustomoptionsdialog.cpp @@ -0,0 +1,1027 @@ +/*************************************************************************** + smb4kcustomoptionsdialog - With this dialog the user can define + custom Samba options for hosts or shares. + ------------------- + begin : So Jun 25 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include + +// application specific includes +#include "smb4kcustomoptionsdialog.h" +#include "../core/smb4kglobal.h" +#include "../core/smb4kcore.h" +#include "../core/smb4ksambaoptionsinfo.h" +#include "../core/smb4ksambaoptionshandler.h" +#include "../core/smb4knetworkitems.h" +#include "../core/smb4ksettings.h" + +using namespace Smb4KGlobal; + + +// FIXME: Maybe introduce a private class here? +static int default_port = -1; +static QString default_protocol = QString::null; +static bool default_kerberos = false; +static QString default_uid = QString::null; +static QString default_gid = QString::null; +#ifndef __FreeBSD__ +static QString default_filesystem = QString::null; +static bool default_readwrite = true; +#endif + +static int port_value = -1; +static QString protocol_value = QString::null; +static bool kerberos_value = false; +static QString uid_value = QString::null; +static QString gid_value = QString::null; +#ifndef __FreeBSD__ +static QString filesystem_value = QString::null; +static bool readwrite_value = true; +#endif + +static bool port_changed_ok = false; +static bool protocol_changed_ok = false; +static bool kerberos_changed_ok = false; +static bool uid_changed_ok = false; +static bool gid_changed_ok = false; +#ifndef __FreeBSD__ +static bool filesystem_changed_ok = false; +static bool readwrite_changed_ok = false; +#endif + +static bool port_changed_default = false; +static bool protocol_changed_default = false; +static bool kerberos_changed_default = false; +static bool uid_changed_default = false; +static bool gid_changed_default = false; +#ifndef __FreeBSD__ +static bool filesystem_changed_default = false; +static bool readwrite_changed_default = false; +#endif + + +Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KHostItem *host, QWidget *parent, const char *name ) +: KDialogBase( Plain, i18n( "Custom Options" ), User1|Ok|Cancel, Ok, parent, name, true, true ), m_type( Host ), m_host_item( host ), m_share_item( NULL ), m_homes_user( QString::null ) +{ + m_initialized = true; + + setButtonGuiItem( User1, KStdGuiItem::defaults() ); + + setWFlags( Qt::WDestructiveClose ); + + setupDialog(); +} + + +Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KShareItem *share, QWidget *parent, const char *name ) +: KDialogBase( Plain, i18n( "Custom Options" ), User1|Ok|Cancel, Ok, parent, name, true, true ), m_type( Share ), m_host_item( NULL ), m_share_item( share ), m_homes_user( QString::null ) +{ + if ( QString::compare( share->name(), "homes" ) != 0 ) + { + m_initialized = true; + } + else + { + m_homes_user = specifyUser( share->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" ); + m_initialized = m_homes_user.isEmpty() ? false : true; + } + + setButtonGuiItem( User1, KStdGuiItem::defaults() ); + + setWFlags( Qt::WDestructiveClose ); + + setupDialog(); +} + + +Smb4KCustomOptionsDialog::~Smb4KCustomOptionsDialog() +{ +} + + +void Smb4KCustomOptionsDialog::setupDialog() +{ + // The Smb4KSambaOptionsInfo object: + Smb4KSambaOptionsInfo *info = NULL; + + // We need this later to decide if the "Default" + // button needs to be enabled: + bool enable_default_button = false; + + // These are the input widgets we need below: + m_port_input = NULL; + m_kerberos = NULL; + m_proto_input = NULL; + m_uid_input = NULL; + m_gid_input = NULL; +#ifndef __FreeBSD__ + m_fs_input = NULL; + m_rw_input = NULL; +#endif + + // Set-up the widget: + QFrame *frame = plainPage(); + + QGridLayout *grid = new QGridLayout( frame ); + grid->setSpacing( 5 ); + grid->setMargin( 0 ); + + // The following widgets are independent of the type of + // the network item: + QLabel *location_label = new QLabel( m_type == Host ? i18n( "Host:" ) : i18n( "Share:" ), frame ); + KLineEdit *location = new KLineEdit( m_type == Host ? m_host_item->name() : "//"+m_share_item->host()+"/"+(QString::compare( m_share_item->name(), "homes" ) != 0 ? m_share_item->name() : m_homes_user), frame ); + location->setReadOnly( true ); + + QLabel *port_label = new QLabel( i18n( "Port:" ), frame ); + m_port_input = new KIntNumInput( -1, frame ); + m_port_input->setMinimumWidth( 200 ); + m_port_input->setMinValue( -1 ); + m_port_input->setMaxValue( 65535 ); + + // The widgets will be put into the layout below. + + // Here comes the item-dependent stuff: + switch ( m_type ) + { + case Host: + { + QLabel *protocol_label = new QLabel( i18n( "Protocol:" ), frame ); + m_proto_input = new KComboBox( false, frame ); + m_proto_input->setMinimumWidth( 200 ); + m_proto_input->insertItem( i18n( "auto" ), -1 ); + m_proto_input->insertItem( "RPC", -1 ); + m_proto_input->insertItem( "RAP", -1 ); + m_proto_input->insertItem( "ADS", -1 ); + + m_kerberos = new QCheckBox( i18n( "Try to authenticate with Kerberos (Active Directory)" ), frame ); + + grid->addWidget( location_label, 0, 0, 0 ); + grid->addWidget( location, 0, 1, 0 ); + grid->addWidget( port_label, 1, 0, 0 ); + grid->addWidget( m_port_input, 1, 1, 0 ); + grid->addWidget( protocol_label, 2, 0, 0 ); + grid->addWidget( m_proto_input, 2, 1, 0 ); + grid->addMultiCellWidget( m_kerberos, 3, 3, 0, 1, 0 ); + + info = optionsHandler()->findItem( m_host_item->name() ); + + // Get the default values from the config file: + default_port = Smb4KSettings::remotePort(); + + default_kerberos = Smb4KSettings::useKerberos(); + + switch ( Smb4KSettings::protocolHint() ) + { + case Smb4KSettings::EnumProtocolHint::Automatic: + { + // In this case the user leaves it to the net + // command to determine the right protocol. + default_protocol = "auto"; + + break; + } + case Smb4KSettings::EnumProtocolHint::RPC: + { + default_protocol = "rpc"; + + break; + } + case Smb4KSettings::EnumProtocolHint::RAP: + { + default_protocol = "rap"; + + break; + } + case Smb4KSettings::EnumProtocolHint::ADS: + { + default_protocol = "ads"; + + break; + } + default: + { + default_protocol = QString::null; + + break; + } + } + + // Define the values that have to be put into the widgets: + port_value = (info && info->port() != -1) ? + info->port() : + default_port; + + protocol_value = (info && !info->protocol().isEmpty()) ? + info->protocol() : + default_protocol; + + kerberos_value = (info && info->kerberos() != default_kerberos) ? + info->kerberos() : + default_kerberos; + + // Put the values in the widgets: + m_port_input->setValue( port_value ); + m_proto_input->setCurrentText( (QString::compare( protocol_value, "auto" ) == 0 ? i18n( "auto" ) : protocol_value.upper()) ); + m_kerberos->setChecked( kerberos_value ); + + // Does the 'Default' button need to be enabled? + if ( default_port != port_value || + QString::compare( default_protocol, protocol_value ) != 0 || + default_kerberos != kerberos_value ) + { + enable_default_button = true; + } + + // Connections: + connect( m_port_input, SIGNAL( valueChanged( int ) ), + this, SLOT( slotPortChanged( int ) ) ); + + connect( m_kerberos, SIGNAL( toggled( bool ) ), + this, SLOT( slotKerberosToggled( bool ) ) ); + + connect( m_proto_input, SIGNAL( activated( const QString & ) ), + this, SLOT( slotProtocolChanged( const QString & ) ) ); + + break; + } + case Share: + { +#ifndef __FreeBSD__ + QLabel *filesystem_label = new QLabel( i18n( "File system:" ), frame ); + m_fs_input = new KComboBox( false, frame ); + m_fs_input->setMinimumWidth( 200 ); + m_fs_input->insertItem( "SMBFS", -1 ); + m_fs_input->insertItem( "CIFS", -1 ); + m_fs_input->setCurrentItem( 0 ); + + QLabel *permission_label = new QLabel( i18n( "Write access:" ), frame ); + m_rw_input = new KComboBox( false, frame ); + m_rw_input->setMinimumWidth( 200 ); + m_rw_input->insertItem( i18n( "read-write" ) ); + m_rw_input->insertItem( i18n( "read-only" ) ); + + QLabel *uid_label = new QLabel( i18n( "User ID:" ), frame ); + m_uid_input = new KLineEdit( frame ); + m_uid_input->setMinimumWidth( 200 ); + m_uid_input->setAlignment( Qt::AlignRight ); + QLabel *gid_label = new QLabel( i18n( "Group ID:" ), frame ); + m_gid_input = new KLineEdit( frame ); + m_gid_input->setMinimumWidth( 200 ); + m_gid_input->setAlignment( Qt::AlignRight ); + + m_kerberos = new QCheckBox( i18n( "Try to authenticate with Kerberos (Active Directory)" ), frame ); + + grid->addWidget( location_label, 0, 0, 0 ); + grid->addWidget( location, 0, 1, 0 ); + grid->addWidget( port_label, 1, 0, 0 ); + grid->addWidget( m_port_input, 1, 1, 0 ); + grid->addWidget( filesystem_label, 2, 0, 0 ); + grid->addWidget( m_fs_input, 2, 1, 0 ); + grid->addWidget( uid_label, 3, 0, 0 ); + grid->addWidget( m_uid_input, 3, 1, 0 ); + grid->addWidget( gid_label, 4, 0, 0 ); + grid->addWidget( m_gid_input, 4, 1, 0 ); + grid->addWidget( permission_label, 5, 0, 0 ); + grid->addWidget( m_rw_input, 5, 1, 0 ); + grid->addMultiCellWidget( m_kerberos, 6, 6, 0, 1, 0 ); +#else + QLabel *uid_label = new QLabel( i18n( "User ID:" ), frame ); + m_uid_input = new KLineEdit( frame ); + m_uid_input->setMinimumWidth( 200 ); + m_uid_input->setAlignment( Qt::AlignRight ); + QLabel *gid_label = new QLabel( i18n( "Group ID:" ), frame ); + m_gid_input = new KLineEdit( frame ); + m_gid_input->setMinimumWidth( 200 ); + m_gid_input->setAlignment( Qt::AlignRight ); + + grid->addWidget( location_label, 0, 0, 0 ); + grid->addWidget( location, 0, 1, 0 ); + grid->addWidget( port_label, 1, 0, 0 ); + grid->addWidget( m_port_input, 1, 1, 0 ); + grid->addWidget( uid_label, 2, 0, 0 ); + grid->addWidget( m_uid_input, 2, 1, 0 ); + grid->addWidget( gid_label, 3, 0, 0 ); + grid->addWidget( m_gid_input, 3, 1, 0 ); +#endif + + info = optionsHandler()->findItem( QString( "//%1/%2" ).arg( m_share_item->host(), m_share_item->name() ) ); + + // Get the default values from the config file: + default_port = Smb4KSettings::remotePort(); + default_uid = Smb4KSettings::userID(); + default_gid = Smb4KSettings::groupID(); +#ifndef __FreeBSD__ + default_kerberos = Smb4KSettings::useKerberos(); + + switch ( Smb4KSettings::writeAccess() ) + { + case Smb4KSettings::EnumWriteAccess::ReadWrite: + { + default_readwrite = true; + + break; + } + case Smb4KSettings::EnumWriteAccess::ReadOnly: + { + default_readwrite = false; + + break; + } + default: + { + break; + } + } + + + switch( Smb4KSettings::filesystem() ) + { + case Smb4KSettings::EnumFilesystem::CIFS: + { + default_filesystem = "cifs"; + + break; + } + case Smb4KSettings::EnumFilesystem::SMBFS: + { + default_filesystem = "smbfs"; + + break; + } + default: + { + // FIXME: Set default_filesystem to "cifs"? + break; + } + } +#endif + + // Define the values that have to be put into the widgets: + port_value = (info && info->port() != -1) ? + info->port() : + default_port; + + uid_value = (info && !info->uid().isEmpty()) ? + info->uid() : + default_uid; + + gid_value = (info && !info->gid().isEmpty()) ? + info->gid() : + default_gid; +#ifndef __FreeBSD__ + kerberos_value = (info && info->kerberos() != default_kerberos) ? + info->kerberos() : + default_kerberos; + + readwrite_value = (info && info->writeAccess() != default_readwrite) ? + info->writeAccess() : + default_readwrite; + + filesystem_value = (info && !info->filesystem().isEmpty()) ? + info->filesystem() : + default_filesystem; +#endif + + // Put the values in the widgets: + m_port_input->setValue( port_value ); + m_uid_input->setText( uid_value ); + m_gid_input->setText( gid_value ); +#ifndef __FreeBSD__ + m_kerberos->setChecked( kerberos_value ); + m_fs_input->setCurrentText( filesystem_value.upper() ); + m_rw_input->setCurrentText( (readwrite_value ? + i18n( "read-write" ) : + i18n( "read-only" )) ); + + // Because we do not have Kerberos with CIFS, disable this button + // in that case: + m_kerberos->setEnabled( !(QString::compare( filesystem_value, "cifs" ) == 0) ); +#endif + + // Does the 'Default' button need to be enabled? +#ifndef __FreeBSD__ + if ( default_port != port_value || + QString::compare( default_filesystem, filesystem_value ) != 0 || + default_kerberos != kerberos_value || + default_readwrite != readwrite_value || + QString::compare( default_uid, uid_value ) != 0 || + QString::compare( default_gid, gid_value ) != 0 ) + { + enable_default_button = true; + } +#else + if ( default_port != port_value || + QString::compare( default_uid, uid_value ) != 0 || + QString::compare( default_gid, gid_value ) != 0 ) + { + enable_default_button = true; + } +#endif + + // Connections: + connect( m_port_input, SIGNAL( valueChanged( int ) ), + this, SLOT( slotPortChanged( int ) ) ); + + connect( m_uid_input, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotUIDChanged( const QString & ) ) ); + + connect( m_gid_input, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotGIDChanged( const QString & ) ) ); + +#ifndef __FreeBSD__ + connect( m_kerberos, SIGNAL( toggled( bool ) ), + this, SLOT( slotKerberosToggled( bool ) ) ); + + connect( m_rw_input, SIGNAL( activated( const QString & ) ), + this, SLOT( slotWriteAccessChanged( const QString & ) ) ); + + connect( m_fs_input, SIGNAL( activated( const QString & ) ), + this, SLOT( slotFilesystemChanged( const QString & ) ) ); +#endif + + break; + } + default: + { + // This should not happen... + break; + } + } + + // Enable the buttons: + enableButton( Ok, false ); + enableButton( User1, enable_default_button ); + + // Connect the buttons: + connect( this, SIGNAL( okClicked() ), + this, SLOT( slotOKButtonClicked() ) ); + + connect( this, SIGNAL( user1Clicked() ), + this, SLOT( slotDefaultButtonClicked() ) ); + + setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() ); +} + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KCustomOptionsDialog::slotPortChanged( int val ) +{ + port_changed_ok = (port_value != val); + port_changed_default = (default_port != val); + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || +#ifndef __FreeBSD__ + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || +#endif + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || +#ifndef __FreeBSD__ + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || +#endif + uid_changed_default || + gid_changed_default ); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KCustomOptionsDialog::slotFilesystemChanged( const QString &text ) +{ +#ifndef __FreeBSD__ + filesystem_changed_ok = (QString::compare( filesystem_value, text.lower() ) != 0); + filesystem_changed_default = (QString::compare( default_filesystem, text.lower() ) != 0); + + // Authentication with Kerberos does not exist with mount.cifs: + if ( QString::compare( text, "CIFS" ) == 0 ) + { + m_kerberos->setEnabled( false ); + } + else + { + m_kerberos->setEnabled( true ); + } + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || + uid_changed_default || + gid_changed_default ); + break; + } + default: + { + break; + } + } +#endif +} + + +void Smb4KCustomOptionsDialog::slotProtocolChanged( const QString &protocol ) +{ + protocol_changed_ok = (QString::compare( protocol_value, protocol.lower() ) != 0); + protocol_changed_default = (QString::compare( default_protocol, protocol.lower() ) != 0); + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || +#ifndef __FreeBSD__ + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || +#endif + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || +#ifndef __FreeBSD__ + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || +#endif + uid_changed_default || + gid_changed_default ); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KCustomOptionsDialog::slotKerberosToggled( bool on ) +{ + kerberos_changed_ok = (kerberos_value != on); + kerberos_changed_default = (default_kerberos != on); + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || +#ifndef __FreeBSD__ + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || +#endif + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || +#ifndef __FreeBSD__ + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || +#endif + uid_changed_default || + gid_changed_default ); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KCustomOptionsDialog::slotWriteAccessChanged( const QString &rw ) +{ +#ifndef __FreeBSD__ + bool readwrite = (QString::compare( rw, i18n( "read-write" ) ) == 0); + readwrite_changed_ok = (readwrite_value != readwrite); + readwrite_changed_default = (default_readwrite != readwrite); + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || + uid_changed_default || + gid_changed_default ); + break; + } + default: + { + break; + } + } +#endif +} + + +void Smb4KCustomOptionsDialog::slotUIDChanged( const QString &uid ) +{ + uid_changed_ok = (QString::compare( uid_value, uid ) != 0); + uid_changed_default = (QString::compare( default_uid, uid ) != 0); + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || +#ifndef __FreeBSD__ + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || +#endif + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || +#ifndef __FreeBSD__ + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || +#endif + uid_changed_default || + gid_changed_default ); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KCustomOptionsDialog::slotGIDChanged( const QString &gid ) +{ + gid_changed_ok = (QString::compare( gid_value, gid ) != 0); + gid_changed_default = (QString::compare( default_gid, gid ) != 0); + + switch ( m_type ) + { + case Host: + { + enableButton( Ok, port_changed_ok || + protocol_changed_ok || + kerberos_changed_ok ); + + enableButton( User1, port_changed_default || + protocol_changed_default || + kerberos_changed_default ); + + break; + } + case Share: + { + enableButton( Ok, port_changed_ok || +#ifndef __FreeBSD__ + filesystem_changed_ok || + kerberos_changed_ok || + readwrite_changed_ok || +#endif + uid_changed_ok || + gid_changed_ok ); + + enableButton( User1, port_changed_default || +#ifndef __FreeBSD__ + filesystem_changed_default || + kerberos_changed_default || + readwrite_changed_default || +#endif + uid_changed_default || + gid_changed_default ); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KCustomOptionsDialog::slotOKButtonClicked() +{ + Smb4KSambaOptionsInfo *info = NULL; + + switch ( m_type ) + { + case Host: + { + QString item_name = m_host_item->name(); + + // Check if we can remove the item: + if ( !port_changed_default && !protocol_changed_default && !kerberos_changed_default ) + { + optionsHandler()->removeItem( item_name, true ); + } + else + { + // First search for the item in the custom options list + // and create a new one only if the info could not be + // found: + if ( !(info = optionsHandler()->findItem( item_name, true )) ) + { + info = new Smb4KSambaOptionsInfo( item_name ); + } + + // Put in the needed information: + info->setPort( m_port_input->value() ); + + info->setProtocol( QString::compare( m_proto_input->currentText(), i18n( "auto" ) ) == 0 ? + "auto" : + m_proto_input->currentText().lower() ); + + info->setKerberos( m_kerberos->isChecked() ); + + // Add the new item. + optionsHandler()->addItem( info, true ); + } + + break; + } + case Share: + { + QString item_name = QString( "//%1/%2" ).arg( m_share_item->host(), + QString::compare( m_share_item->name(), "homes" ) == 0 ? + m_homes_user : + m_share_item->name() ); + +#ifndef __FreeBSD__ + // Check if we can remove the item: + if ( !port_changed_default && !filesystem_changed_default && !kerberos_changed_default && + !readwrite_changed_default && !uid_changed_default && !gid_changed_default ) + { + optionsHandler()->removeItem( item_name, true ); + } + else + { + // First search for the item in the custom options list + // and create a new one only if the info could not be + // found: + if ( !(info = optionsHandler()->findItem( item_name, true )) ) + { + info = new Smb4KSambaOptionsInfo( item_name ); + } + + // Put in the needed information: + info->setPort( m_port_input->value() ); + info->setKerberos( m_kerberos->isChecked() ); + info->setWriteAccess( (QString::compare( m_rw_input->currentText(), i18n( "read-write" ) ) == 0) ); + info->setFilesystem( m_fs_input->currentText().lower() ); + info->setUID( m_uid_input->text() ); + info->setGID( m_gid_input->text() ); + + // Add the new item. + optionsHandler()->addItem( info, true ); + } +#else + // Check if we can remove the item: + if ( !port_changed_default && !kerberos_changed_default && !uid_changed_default && + !gid_changed_default ) + { + optionsHandler()->removeItem( item_name, true ); + } + else + { + // First search for the item in the custom options list + // and create a new one only if the info could not be + // found: + if ( !(info = optionsHandler()->findItem( item_name, true )) ) + { + info = new Smb4KSambaOptionsInfo( item_name ); + } + + // Put in the needed information: + info->setPort( m_port_input->value() ); + info->setUID( m_uid_input->text() ); + + info->setGID( m_gid_input->text() ); + + // Add the new item. + optionsHandler()->addItem( info, true ); + } +#endif + + break; + } + default: + { + break; + } + } +} + + +void Smb4KCustomOptionsDialog::slotDefaultButtonClicked() +{ + // Here, we only reset the dialog and enable the OK button + // if necessary. + + switch ( m_type ) + { + case Host: + { + m_port_input->setValue( default_port ); + m_kerberos->setChecked( default_kerberos ); + QString protocol = (QString::compare( default_protocol, "auto" ) == 0 ? i18n( "auto" ) : protocol_value.upper()); + m_proto_input->setCurrentText( protocol ); + + // Enable or disable the OK button: + enableButton( Ok, default_port != port_value || + default_kerberos != kerberos_value || + QString::compare( default_protocol, protocol_value ) != 0 ); + + break; + } + case Share: + { + m_port_input->setValue( default_port ); + m_uid_input->setText( default_uid ); + m_gid_input->setText( default_gid ); + +#ifndef __FreeBSD__ + m_kerberos->setChecked( default_kerberos ); + QString write_access = (default_readwrite ? i18n( "read-write" ) : i18n( "read-only" )); + m_rw_input->setCurrentText( write_access ); + m_fs_input->setCurrentText( default_filesystem.upper() ); + + // Enable or disable the Kerberos check box depending on + // the (default) file system: + if ( QString::compare( default_filesystem, "cifs" ) == 0 ) + { + m_kerberos->setEnabled( false ); + } + else + { + m_kerberos->setEnabled( true ); + } +#endif + + // Enable or disable the OK button: + enableButton( Ok, default_port != port_value || +#ifndef __FreeBSD__ + default_kerberos != kerberos_value || + QString::compare( default_filesystem, filesystem_value ) != 0 || + default_readwrite != readwrite_value || +#endif + QString::compare( default_uid, uid_value ) != 0 || + QString::compare( default_gid, gid_value ) != 0 ); + + break; + } + default: + { + break; + } + } + + // We just put the default values into the dialog. + // Disable the 'Default' button: + enableButton( User1, false ); +} + +#include "smb4kcustomoptionsdialog.moc" diff --git a/smb4k/dialogs/smb4kcustomoptionsdialog.h b/smb4k/dialogs/smb4kcustomoptionsdialog.h new file mode 100644 index 0000000..10594a9 --- /dev/null +++ b/smb4k/dialogs/smb4kcustomoptionsdialog.h @@ -0,0 +1,232 @@ +/*************************************************************************** + smb4kcustomoptionsdialog - With this dialog the user can define + custom Samba options for hosts or shares. + ------------------- + begin : So Jun 25 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KCUSTOMOPTIONSDIALOG_H +#define SMB4KCUSTOMOPTIONSDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include +#include +#include +#include + +// forward declarations +class Smb4KHostItem; +class Smb4KShareItem; + +class Smb4KCustomOptionsDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param host The host (server) for which the custom options should be defined. + * + * @param parent The parent of this dialog + * + * @param name The name of this dialog + */ + Smb4KCustomOptionsDialog( Smb4KHostItem *host, QWidget *parent = 0, const char *name = 0 ); + + /** + * Another constructor, similar to the one above. + * + * @param share The share for which the custom options should be defined. + * + * @param parent The parent of this dialog + * + * @param name The name of this dialog + */ + Smb4KCustomOptionsDialog( Smb4KShareItem *share, QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KCustomOptionsDialog(); + + /** + * This function returns TRUE if the dialog has been initialized correctly + * and may be shown now. It will always return TRUE if you want to set options + * for a server or for a share, that is not a 'homes' share. Only in the case + * of a homes share it may return FALSE, if you didn't choose a user name. + * + * @returns TRUE if the dialog has been set up correctly. + */ + bool isInitialized() { return m_initialized; } + + protected slots: + /** + * Is invoked when the port value changed + * + * @param int The port number + */ + void slotPortChanged( int value ); + + /** + * Is invoked when the file system value changed + * + * @param fs The file system + */ + void slotFilesystemChanged( const QString &fs ); + + /** + * Is invoked when the protocol value changed + * + * @param t The protocol + */ + void slotProtocolChanged( const QString &p ); + + /** + * Is invoked when the user clicked the 'Use Kerberos' + * check box. + * + * @param on TRUE if the check box was + * checked and FALSE otherwise + */ + void slotKerberosToggled( bool on ); + + /** + * Commit the custom options provided for the selected + * network item. + */ + void slotOKButtonClicked(); + + /** + * Is invoked if the "Default" button has been pressed. + */ + void slotDefaultButtonClicked(); + + /** + * This slot is invoked when the "Write Access" value changed. + * + * @param rw Either 'read-write' or 'read-only' (localized). + */ + void slotWriteAccessChanged( const QString &rw ); + + /** + * This slot is invoked when the UID value changed. + * + * @param uid The UID value + */ + void slotUIDChanged( const QString &uid ); + + /** + * This slot is invoked when the GID value changed. + * + * @param gid The UID value + */ + void slotGIDChanged( const QString &gid ); + + private: + /** + * Enumeration + */ + enum ItemType{ Host, Share }; + + /** + * The item type + */ + int m_type; + + /** + * Sets up the dialog + */ + void setupDialog(); + + /** + * The host item (is NULL if you process a share). + */ + Smb4KHostItem *m_host_item; + + /** + * The share item (is NULL if you process a host). + */ + Smb4KShareItem *m_share_item; + + /** + * Port input + */ + KIntNumInput *m_port_input; + +#ifndef __FreeBSD__ + /** + * The file system + */ + KComboBox *m_fs_input; + + /** + * This combo box determines if the user wants to mount a share + * readwrite or readonly. + */ + KComboBox *m_rw_input; +#endif + + /** + * The protocol + */ + KComboBox *m_proto_input; + + /** + * Boolean that is TRUE if the dialog has been initialized + * correctly and my be shown now. + */ + bool m_initialized; + + /** + * This will only be set if we are dealing with a 'homes' share. + */ + QString m_homes_user; + + /** + * This check box will determine if the user wants to try to + * authenticate with Kerberos or not. This is needed for Active + * Directory stuff. + */ + QCheckBox *m_kerberos; + + /** + * This combo box holds the values of the UID that the user can + * chose from. + */ + KLineEdit *m_uid_input; + + /** + * This combo box holds the values of the GID that the user can + * chose from. + */ + KLineEdit *m_gid_input; +}; + +#endif diff --git a/smb4k/dialogs/smb4kmountdialog.cpp b/smb4k/dialogs/smb4kmountdialog.cpp new file mode 100644 index 0000000..7cafe35 --- /dev/null +++ b/smb4k/dialogs/smb4kmountdialog.cpp @@ -0,0 +1,172 @@ +/*************************************************************************** + smb4kmountdialog - This class provides a dialog for mounting shares + manually. + ------------------- + begin : Mo Nov 29 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include +#include +#include + +// application specific includes +#include "smb4kmountdialog.h" + +#include "../core/smb4kmounter.h" +#include "../core/smb4kbookmarkhandler.h" +#include "../core/smb4kbookmark.h" +#include "../core/smb4kcore.h" +#include "../smb4k.h" + +Smb4KMountDialog::Smb4KMountDialog( QWidget *parent, const char *name ) : +KDialogBase( Plain, i18n( "Mount Share" ), Ok|Cancel, Ok, parent, name, true, true ) +{ + setWFlags( Qt::WDestructiveClose ); + + setupView(); + + setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() ); +} + + +Smb4KMountDialog::~Smb4KMountDialog() +{ +} + + +void Smb4KMountDialog::setupView() +{ + QFrame *frame = plainPage(); + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 5 ); + layout->setMargin( 0 ); + + QLabel *shareLabel = new QLabel( i18n( "Share:" ), frame ); + m_share_input = new KLineEdit( frame, "ShareInputLine" ); + m_share_input->setMinimumWidth( 200 ); + m_share_input->setFocus(); + + QLabel *addressLabel = new QLabel( i18n( "IP Address:" ), frame ); + m_ip_input = new KLineEdit( frame, "IPInputLine" ); + m_ip_input->setMinimumWidth( 200 ); + + QLabel *workgroupLabel = new QLabel( i18n( "Workgroup:" ), frame ); + m_workgroup_input = new KLineEdit( frame, "WorkgroupInputLine" ); + m_workgroup_input->setMinimumWidth( 200 ); + + m_bookmark = new QCheckBox( i18n( "Add this share to the bookmarks" ), frame, "BookmarkButton" ); + + layout->addWidget( shareLabel, 0, 0, 0 ); + layout->addWidget( m_share_input, 0, 1, 0 ); + layout->addWidget( addressLabel, 1, 0, 0 ); + layout->addWidget( m_ip_input, 1, 1, 0 ); + layout->addWidget( workgroupLabel, 2, 0, 0 ); + layout->addWidget( m_workgroup_input, 2, 1, 0 ); + layout->addMultiCellWidget( m_bookmark, 3, 3, 0, 1, 0 ); + + connect( m_share_input, SIGNAL( textChanged ( const QString & ) ) , + this, SLOT( slotChangeInputValue( const QString & ) ) ); + + slotChangeInputValue( m_share_input->text() ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KMountDialog::slotChangeInputValue( const QString& _test) +{ + enableButtonOK( !_test.isEmpty() ); +} + +void Smb4KMountDialog::slotOk() +{ + // FIXME: Leave the decision if the share is not formatted + // correctly up to the mounter. Just pass the string to + // Smb4KCore::mounter()->mountShare(). + + if ( !m_share_input->text().stripWhiteSpace().isEmpty() ) + { +#ifndef __FreeBSD__ + if ( m_share_input->text().contains( "/" ) == 3 ) +#else + if ( m_share_input->text().contains( "/" ) == 3 + && m_share_input->text().contains( '@' ) == 0 ) +#endif + { + QString host = m_share_input->text().stripWhiteSpace().section( "/", 2, 2 ); + QString share = m_share_input->text().stripWhiteSpace().section( "/", 3, 3 ); + QString ip = m_ip_input->text().stripWhiteSpace(); + QString workgroup = m_workgroup_input->text().stripWhiteSpace(); + + Smb4KCore::mounter()->mountShare( workgroup, host, ip, share ); + + if ( m_bookmark->isChecked() ) + { + Smb4KCore::bookmarkHandler()->addBookmark( new Smb4KBookmark( host, share, workgroup, ip, QString::null ) ); + } + + connect( Smb4KCore::mounter(), SIGNAL( state( int ) ), this, SLOT( slotMounterStateChanged( int ) ) ); + } + else + { + KMessageBox::error( this, i18n( "The format of the share you entered is not correct. It must have the form //HOST/SHARE." ) ); + } + } +} + + +void Smb4KMountDialog::slotCancel() +{ + Smb4KCore::mounter()->abort(); + + KDialogBase::slotCancel(); +} + + +void Smb4KMountDialog::slotMounterStateChanged( int state ) +{ + switch ( state ) + { + case MOUNTER_STOP: + { + accept(); + + break; + } + default: + { + break; + } + } +} + +#include "smb4kmountdialog.moc" + diff --git a/smb4k/dialogs/smb4kmountdialog.h b/smb4k/dialogs/smb4kmountdialog.h new file mode 100644 index 0000000..ff7ff5f --- /dev/null +++ b/smb4k/dialogs/smb4kmountdialog.h @@ -0,0 +1,111 @@ +/*************************************************************************** + smb4kmountdialog - This class provides a dialog for mounting shares + manually. + ------------------- + begin : Mo Nov 29 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KMOUNTDIALOG_H +#define SMB4KMOUNTDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include +#include + +/** + * This class provides a dialog with which you can mount shares "manually". + * + * @author Alexander Reinholdt + */ + +class Smb4KMountDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * The constructor. + */ + Smb4KMountDialog( QWidget *parent = 0, const char *name = 0 ); + /** + * The destructor. + */ + ~Smb4KMountDialog(); + + protected slots: + /** + * Reimplemented from KDialogBase. + */ + void slotOk(); + + /** + * Reimplemented from KDoalogBase. + */ + void slotCancel(); + + /** + * This slot is being enabled if there is input text. + * + * @param text The input text. + */ + void slotChangeInputValue( const QString &text ); + + /** + * This slot is connected to the Smb4KCore::mounter()::state() signal. + * It is used to close the dialog. + * + * @param state The state of the mounter. + */ + void slotMounterStateChanged( int state ); + + private: + /** + * This function sets up the view. + */ + void setupView(); + /** + * The line edit where the user has to enter the share. + */ + KLineEdit *m_share_input; + /** + * The line edit where the user can enter the IP address. + */ + KLineEdit *m_ip_input; + /** + * The line edit where the user can enter the workgroup. + */ + KLineEdit *m_workgroup_input; + /** + * This checkbox determines whether the share should be added to the + * bookmarks. + */ + QCheckBox *m_bookmark; +}; + +#endif diff --git a/smb4k/dialogs/smb4kpreviewdialog.cpp b/smb4k/dialogs/smb4kpreviewdialog.cpp new file mode 100644 index 0000000..4a3f7b8 --- /dev/null +++ b/smb4k/dialogs/smb4kpreviewdialog.cpp @@ -0,0 +1,399 @@ +/*************************************************************************** + smb4kpreviewdialog.cpp - The preview dialog of Smb4K + ------------------- + begin : Fre Jul 4 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4kpreviewdialog.h" +#include "../core/smb4kcore.h" +#include "../core/smb4knetworkitems.h" +#include "../core/smb4ksettings.h" + + +Smb4KPreviewDialog::Smb4KPreviewDialog( Smb4KShareItem *item, QWidget *parent, const char *name ) +: KDialogBase( Plain, i18n( "Preview" ), Close, Close, parent, name, false, true ) +{ + setWFlags( Qt::WDestructiveClose ); + + m_item = new Smb4KPreviewItem( item ); + + if ( m_item ) + { + if ( Smb4KHostItem *host = Smb4KCore::scanner()->getHost( item->host(), item->workgroup() ) ) + { + m_item->setIP( host->ip() ); + } + + m_button_id = None; + + m_current_item = m_history.end(); + + setupView(); + + setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "PreviewDialog" ) ); + + connect( m_view, SIGNAL( executed( QIconViewItem * ) ), + this, SLOT( slotItemExecuted( QIconViewItem * ) ) ); + + connect( m_toolbar, SIGNAL( clicked( int ) ), + this, SLOT( slotButtonClicked( int ) ) ); + + connect( m_combo, SIGNAL( activated( const QString & ) ), + this, SLOT( slotItemActivated( const QString & ) ) ); + + connect( Smb4KCore::previewer(), SIGNAL( result( Smb4KPreviewItem * ) ), + this, SLOT( slotReceivedData( Smb4KPreviewItem * ) ) ); + + m_initialized = Smb4KCore::previewer()->preview( m_item ); + } + + setMinimumSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() ); +} + + +Smb4KPreviewDialog::~Smb4KPreviewDialog() +{ + delete m_item; +} + + +void Smb4KPreviewDialog::setupView() +{ + QFrame *frame = plainPage(); + QGridLayout *layout = new QGridLayout( frame ); + + m_view = new KIconView( frame, 0, 0 ); + m_view->setItemTextPos( KIconView::Right ); + m_view->setResizeMode( KIconView::Adjust ); + m_view->setArrangement( KIconView::TopToBottom ); + m_view->setSpacing( 1 ); + m_view->setGridX( 200 ); + m_view->setWordWrapIconText( false ); + m_view->setShowToolTips( true ); + m_view->setAutoArrange( true ); + m_view->setSorting( true, true ); + + m_toolbar = new KToolBar( frame, 0, true, false ); + m_toolbar->insertButton( "reload", Reload, true, i18n( "Reload" ), 0 ); + m_toolbar->insertButton( "back", Back, false, i18n( "Back" ), 1 ); + m_toolbar->insertButton( "forward", Forward, false, i18n( "Forward" ), 2 ); + m_toolbar->insertButton( "up", Up, false, i18n( "Up" ), 3 ); + + m_combo = new KComboBox( false, m_toolbar, 0 ); + m_combo->listBox()->setHScrollBarMode( QScrollView::Auto ); + m_combo->listBox()->setVScrollBarMode( QScrollView::Auto ); + m_combo->listBox()->setMinimumHeight( 100 ); + m_toolbar->insertWidget( Combo, 10, m_combo, 4 ); + m_toolbar->setItemAutoSized( Combo, true ); + + layout->addWidget( m_view, 0, 0, 0 ); + layout->addWidget( m_toolbar, 1, 0, 0 ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item ) +{ + // If the item is NULL or not equal to m_item, + // stop right here: + if ( !item || item != m_item ) + { + return; + } + + // Clear the icon view: + m_view->clear(); + + // The item should be equal to m_item, so we can use either of those + // pointers. + + // Process the data: + if ( !item->contents().isEmpty() ) + { + // Generate the history. + switch ( m_button_id ) + { + case Reload: /* Really? */ + case Back: + case Forward: + { + // Do not insert anything into the history if + // one of these three buttons was clicked. + + break; + } + default: + { + m_history.append( item->location() ); + m_current_item = --m_history.end(); + + break; + } + } + + // Clear the combo box, put the new history there and set the + // current item: + m_combo->clear(); + + for ( QStringList::Iterator it = m_history.begin(); it != m_history.end(); it++ ) + { + if ( !m_combo->listBox()->findItem( *it, Qt::CaseSensitive|Qt::ExactMatch ) ) + { + m_combo->insertItem( *it, -1 ); + } + } + + m_combo->setCurrentText( *m_current_item ); + + // Now put the contents in the icon view: + for ( QValueList::ConstIterator it = item->contents().begin(); + it != item->contents().end(); ++it ) + { + switch ( (*it).first ) + { + case Smb4KPreviewItem::File: + { + KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "file" ) ); + view_item->setKey( QString( "[file]_%1" ).arg( (*it).second ) ); + + break; + } + case Smb4KPreviewItem::Directory: + { + // We do not want to show the '.' and '..' directories. + if ( QString::compare( (*it).second, "." ) != 0 && QString::compare( (*it).second, ".." ) != 0 ) + { + KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "folder" ) ); + view_item->setKey( QString( "[directory]_%1" ).arg( (*it).second ) ); + } + + break; + } + case Smb4KPreviewItem::HiddenFile: + { + if ( Smb4KSettings::previewHiddenItems() ) + { + KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "file" ) ); + view_item->setKey( QString( "[file]_%1" ).arg( (*it).second ) ); + } + + break; + } + case Smb4KPreviewItem::HiddenDirectory: + { + if ( Smb4KSettings::previewHiddenItems() && + QString::compare( (*it).second, "." ) != 0 && QString::compare( (*it).second, ".." ) != 0 ) + { + KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "folder" ) ); + view_item->setKey( QString( "[directory]_%1" ).arg( (*it).second ) ); + } + + break; + } + default: + { + break; + } + } + } + + // Now activate or deactivate the buttons: + + // Activate the 'Up' button if the current address is + // not equal to the base address. + m_toolbar->setItemEnabled( Up, QString::compare( "//"+item->host()+"/"+item->share()+"/", item->location() ) != 0 ); + + // Activate/Deactivate 'Back' and 'Forward' buttons. + m_toolbar->setItemEnabled( Back, m_current_item != m_history.at( 0 ) ); + m_toolbar->setItemEnabled( Forward, m_current_item != m_history.at( m_history.count() - 1 ) ); + } + else + { + return; + } +} + + +void Smb4KPreviewDialog::slotItemExecuted( QIconViewItem *item ) +{ + if ( !item->key().startsWith( "[file]_" ) ) + { + m_button_id = None; + + m_item->setPath( m_item->path()+item->text()+"/" ); + + Smb4KCore::previewer()->preview( m_item ); + } +} + + +void Smb4KPreviewDialog::slotButtonClicked( int id ) +{ + m_button_id = id; + + m_item->clearContents(); + + switch ( id ) + { + case Reload: + { + Smb4KCore::previewer()->preview( m_item ); + + break; + } + case Up: + { + // Do nothing if the path is empty because + // we are already in the root directory. + if ( m_item->path().isEmpty() ) + { + return; + } + + if ( m_item->path().contains( "/" ) > 1 ) + { + m_item->setPath( m_item->path().section( "/", 0, -3 ).append( "/" ) ); + } + else if ( m_item->path().contains( "/", true ) == 1 ) + { + m_item->setPath( QString::null ); + } + + Smb4KCore::previewer()->preview( m_item ); + + break; + } + case Back: + { + // Move one item back in the list: + if ( m_current_item != m_history.at( 0 ) ) + { + m_current_item--; + } + else + { + return; + } + + // Get the path: + if ( (*m_current_item).contains( "/", true ) == 3 ) + { + m_item->setPath( QString::null ); + } + else + { + m_item->setPath( (*m_current_item).section( "/", 4, -1 ) ); + + if ( !m_item->path().isEmpty() ) + { + m_item->setPath( m_item->path()+"/" ); + } + else + { + // Do nothing. + } + } + + Smb4KCore::previewer()->preview( m_item ); + + break; + } + case Forward: + { + // Move one item forward in the list: + if ( m_current_item != m_history.at( m_history.count() - 1 ) ) + { + m_current_item++; + } + else + { + return; + } + + // Get the path: + if ( (*m_current_item).contains( "/", true ) == 3 ) + { + m_item->setPath( QString::null ); + } + else + { + m_item->setPath( (*m_current_item).section( "/", 4, -1 ) ); + + if ( !m_item->path().isEmpty() ) + { + m_item->setPath( m_item->path()+"/" ); + } + else + { + // Do nothing. + } + } + + Smb4KCore::previewer()->preview( m_item ); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KPreviewDialog::slotItemActivated( const QString &item ) +{ + m_button_id = Combo; + + // First we have to strip the address: + m_item->setPath( item.section( "//"+m_item->host()+"/"+m_item->share()+"/", 1, 1 ).stripWhiteSpace() ); + + Smb4KCore::previewer()->preview( m_item ); +} + + +void Smb4KPreviewDialog::slotClose() +{ + saveDialogSize( *(Smb4KSettings::self()->config()), "PreviewDialog" ); + + KDialogBase::slotClose(); +} + + +#include "smb4kpreviewdialog.moc" + diff --git a/smb4k/dialogs/smb4kpreviewdialog.h b/smb4k/dialogs/smb4kpreviewdialog.h new file mode 100644 index 0000000..8c8fe15 --- /dev/null +++ b/smb4k/dialogs/smb4kpreviewdialog.h @@ -0,0 +1,167 @@ +/*************************************************************************** + smb4kpreviewdialog.h - The preview dialog of Smb4K + ------------------- + begin : Fre Jul 4 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPREVIEWDIALOG_H +#define SMB4KPREVIEWDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include +#include +#include +#include + +// application specific includes +#include "../core/smb4kpreviewitem.h" + +// forward declarations +class Smb4KShareItem; + +/** + * This is the preview dialog of Smb4K. You can preview remote + * shares with it. + * + * @author Alexander Reinholdt + */ + +class Smb4KPreviewDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * This is the constructor of the preview dialog. + * + * @param item The Smb4KShareItem object. + * + * @param parent The parent of this widget + * + * @param name The name of this widget + */ + Smb4KPreviewDialog( Smb4KShareItem *item, QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KPreviewDialog(); + + /** + * This function returns TRUE if the preview dialog has been + * initialized correctly and FALSE otherwise. + * + * @returns TRUE if the dialog was initialized correctly. + */ + bool isInitialized() { return m_initialized; } + + protected slots: + /** + * This slot receives the results of the attempt to generate + * a preview. + * + * @param item The Smb4KPreviewItem for which a preview + * was generated. + */ + void slotReceivedData( Smb4KPreviewItem *item ); + + /** + * Is called, if one icon view item is clicked. + */ + void slotItemExecuted( QIconViewItem *item ); + + /** + * Is called, if a tool bar button is clicked. + */ + void slotButtonClicked( int id ); + + /** + * Is called, if an item in the combo box is activated. + */ + void slotItemActivated( const QString &item ); + + /** + * Reimplemented from KDialogBase. Saves the dialog size and + * then executes KDialogBase::slotClose(). + */ + void slotClose(); + + private: + /** + * Enumeration for the buttons. + */ + enum ButtonID{ Reload, Up, Back, Forward, Combo, None }; + + /** + * The current button id + */ + int m_button_id; + + /** + * Sets up the file view. + */ + void setupView(); + + /** + * The icon view. + */ + KIconView *m_view; + + /** + * The toolbar. + */ + KToolBar *m_toolbar; + + /** + * The combo box. + */ + KComboBox *m_combo; + + /** + * The private Smb4KHostItem object + */ + Smb4KPreviewItem *m_item; + + /** + * This list holds the history of the session. + */ + QStringList m_history; + + /** + * This iterator points to the current item in the history. + */ + QStringList::Iterator m_current_item; + + /** + * TRUE if the dialog was successfully initilized and + * FALSE otherwise. + */ + bool m_initialized; +}; +#endif diff --git a/smb4k/dialogs/smb4kprintdialog.cpp b/smb4k/dialogs/smb4kprintdialog.cpp new file mode 100644 index 0000000..342d085 --- /dev/null +++ b/smb4k/dialogs/smb4kprintdialog.cpp @@ -0,0 +1,196 @@ +/*************************************************************************** + smb4kprintdialog - The print dialog for Smb4K + ------------------- + begin : So Apr 11 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4kprintdialog.h" +#include "../core/smb4kprintinfo.h" +#include "../core/smb4kcore.h" +#include "../core/smb4knetworkitems.h" + + +Smb4KPrintDialog::Smb4KPrintDialog( Smb4KShareItem *item, QWidget *parent, const char *name ) +: KDialogBase( Plain, i18n( "Print File" ), Details|Filler|User1|Cancel, User1, parent, name, true, true ), +m_item( item ), m_ip( QString::null ) /* will collect it in an instant */ +{ + setWFlags( Qt::WDestructiveClose ); + + if ( !m_item ) + { + close(); + } + + setButtonGuiItem( User1, KStdGuiItem::print() ); + setButtonText( Details, i18n( "Options" ) ); + + // Get the IP address + if ( Smb4KHostItem *host = Smb4KCore::scanner()->getHost( m_item->host(), m_item->workgroup() ) ) + { + m_ip = host->ip(); + } + + // Bild the view: + QFrame *frame = plainPage(); + + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 10 ); + + QGroupBox *p = new QGroupBox( 2, Qt::Horizontal, i18n( "Printer" ), frame ); + p->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "Name:" ), p ); + (void) new QLabel( m_item->name()+ + (!m_item->comment().stripWhiteSpace().isEmpty() ? + " ("+m_item->comment()+")" : + ""), p ); + +// (void) new QLabel( i18n( "Comment:" ), p ); +// (void) new QLabel( m_item->comment(), p ); + + (void) new QLabel( i18n( "Host:" ), p ); + (void) new QLabel( m_item->host(), p ); + + (void) new QLabel( i18n( "IP address:" ), p ); + (void) new QLabel( m_ip.stripWhiteSpace().isEmpty() ? + i18n( "Unknown" ) : + m_ip, + p ); + + (void) new QLabel( i18n( "Workgroup:" ), p ); + (void) new QLabel( m_item->workgroup(), p ); + + QGroupBox *f = new QGroupBox( 2, Qt::Horizontal, i18n( "File" ), frame ); + f->setInsideSpacing( 5 ); + + (void) new QLabel( i18n( "File:" ), f ); + KURLRequester *requester = new KURLRequester( QString::null, f, "URL" ); + requester->setMode( KFile::File | KFile::LocalOnly ); + + QGroupBox *s = new QGroupBox( 2, Qt::Horizontal, i18n( "Options" ), frame ); + s->setInsideSpacing( 5 ); + + setDetailsWidget( s ); + + (void) new QLabel( i18n( "Copies:" ), s ); + KIntNumInput *cp = new KIntNumInput( 1, s, 10, "Copies" ); + cp->setMinValue( 1 ); + + layout->addWidget( p, 0, 0, 0 ); + layout->addWidget( f, 1, 0, 0 ); + + setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() ); + + enableButton( User1, false ); + + connect( requester, SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotInputValueChanged( const QString & ) ) ); +} + + +Smb4KPrintDialog::~ Smb4KPrintDialog() +{ + // Do not delete the pointer to the Smb4KShareObject here! +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KPrintDialog::slotUser1() +{ + KURLRequester *url = static_cast( child( "URL", "KURLRequester", true ) ); + KIntNumInput *copies = static_cast( child( "Copies", "KIntNumInput", true ) ); + + if ( url && copies ) + { + if ( !url->url().stripWhiteSpace().isEmpty() ) + { + if ( Smb4KCore::print()->print( new Smb4KPrintInfo( m_item, m_ip, url->url().stripWhiteSpace(), copies->value() ) ) ) + { + enableButton( User1, false ); + + connect( Smb4KCore::print(), SIGNAL( state( int ) ), this, SLOT( slotPrintStateChanged( int ) ) ); + } + else + { + // FIXME: Should we report an error here? + } + } + else + { + KMessageBox::error( this, i18n( "You haven't specified a file." ) ); + } + } +} + + +void Smb4KPrintDialog::slotCancel() +{ + if ( Smb4KCore::printIsRunning() ) + { + Smb4KCore::print()->abort(); + } + + KDialogBase::slotCancel(); +} + + +void Smb4KPrintDialog::slotPrintStateChanged( int state ) +{ + switch ( state ) + { + case PRINT_STOP: + { + accept(); + + break; + } + default: + { + break; + } + } +} + + +void Smb4KPrintDialog::slotInputValueChanged( const QString &text ) +{ + enableButton( User1, !text.isEmpty() ); +} + + +#include "smb4kprintdialog.moc" diff --git a/smb4k/dialogs/smb4kprintdialog.h b/smb4k/dialogs/smb4kprintdialog.h new file mode 100644 index 0000000..c7bff79 --- /dev/null +++ b/smb4k/dialogs/smb4kprintdialog.h @@ -0,0 +1,105 @@ +/*************************************************************************** + smb4kprintdialog - The print dialog for Smb4K + ------------------- + begin : So Apr 11 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KPRINTDIALOG_H +#define SMB4KPRINTDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include + +// forward declarations +class Smb4KShareItem; + + +/** + * This class provides the print dialog for Smb4K. You can choose the + * file that is to be printed and you can define the number of copies + * you want to have. + * + * @author Alexander Reinholdt + */ + +class Smb4KPrintDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param item The Smb4KShareItem of the printer. + * + * @param parent The parent widget of this dialog. + * + * @param name The name of this dialog. + */ + Smb4KPrintDialog( Smb4KShareItem *item, QWidget *parent = 0, const char *name = 0 ); + /** + * The destructor + */ + ~Smb4KPrintDialog(); + + protected slots: + /** + * Reimplemented from KDialogBase. + */ + void slotUser1(); + + /** + * Reimplemented from KDialogBase. + */ + void slotCancel(); + + /** + * This slot is connected to the Smb4KPrint::state() signal. + */ + void slotPrintStateChanged( int state ); + + /** + * This slot is being enabled if there is input text. + * + * @param text The input text. + */ + void slotInputValueChanged( const QString &text ); + + private: + /** + * The Smb4KShareItem object. + */ + Smb4KShareItem *m_item; + /** + * Holds the IP address. + */ + QString m_ip; +}; + +#endif diff --git a/smb4k/dialogs/smb4ksynchronizationdialog.cpp b/smb4k/dialogs/smb4ksynchronizationdialog.cpp new file mode 100644 index 0000000..5d72cce --- /dev/null +++ b/smb4k/dialogs/smb4ksynchronizationdialog.cpp @@ -0,0 +1,239 @@ +/*************************************************************************** + smb4ksynchronizationdialog - The synchronization dialog of Smb4K + ------------------- + begin : Sa Mai 19 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4ksynchronizationdialog.h" +#include "../core/smb4kshare.h" +#include "../core/smb4kcore.h" +#include "../core/smb4ksynchronizationinfo.h" +#include "../core/smb4ksettings.h" + +Smb4KSynchronizationDialog::Smb4KSynchronizationDialog( Smb4KShare *share, QWidget *parent, const char *name ) +: KDialogBase( Plain, i18n( "Synchronization" ), User2|User1|Cancel, User1, parent, name, false, true ), +m_share( share ) +{ + setWFlags( Qt::WDestructiveClose ); + + setButtonGuiItem( User1, KGuiItem( i18n( "Synchronize" ), "bottom", i18n( "Synchronize the destination with the source" ) ) ); + setButtonGuiItem( User2, KGuiItem( i18n( "Swap Paths" ), QString::null, i18n( "Swap source and destination" ) ) ); + + QFrame *frame = plainPage(); + QGridLayout *layout = new QGridLayout( frame ); + layout->setSpacing( 5 ); + layout->setMargin( 0 ); + + QLabel *source_label = new QLabel( i18n( "Source:" ), frame, "SourceURLLabel" ); + KURLRequester *source = new KURLRequester( m_share->path()+"/", frame, "SourceURL" ); + source->setShowLocalProtocol( false ); + source->setMode( KFile::Directory | KFile::LocalOnly ); + + QLabel *destination_label = new QLabel( i18n( "Destination:" ), frame, "DestinationURLLabel" ); + KURLRequester *destination = new KURLRequester( Smb4KSettings::rsyncPrefix(), frame, "DestinationURL" ); + destination->setShowLocalProtocol( false ); + destination->setMode( KFile::Directory | KFile::LocalOnly ); + + KLineEdit *current_file = new KLineEdit( QString::null, frame, "ProgressInfo" ); + current_file->setEnableSqueezedText( true ); + current_file->setReadOnly( true ); + + KProgress *individual = new KProgress( frame, "IndividualProgress", 0 ); + individual->setEnabled( false ); + + KProgress *total = new KProgress( frame, "TotalProgress", 0 ); + total->setEnabled( false ); + + QWidget *transfer_widget = new QWidget( frame, "TransferInfoWidget" ); + QGridLayout *trans_layout = new QGridLayout( transfer_widget ); + trans_layout->setSpacing( 5 ); + trans_layout->setMargin( 0 ); + + QLabel *file_label = new QLabel( i18n( "Files transferred:" ), transfer_widget, + "FilesTransferredLabel" ); + QLabel *file_trans_label = new QLabel( "0 / 0", transfer_widget, + "FilesTransferred" ); + + QLabel *rate_label = new QLabel( i18n( "Transfer rate:" ), transfer_widget, + "TransferRateLabel" ); + QLabel *trans_rate_label = new QLabel( "0.00 kB/s", transfer_widget, + "TransferRate" ); + + trans_layout->addWidget( file_label, 0, 0, 0 ); + trans_layout->addWidget( file_trans_label, 0, 1, Qt::AlignRight ); + trans_layout->addWidget( rate_label, 1, 0, 0 ); + trans_layout->addWidget( trans_rate_label, 1, 1, Qt::AlignRight ); + + transfer_widget->setEnabled( false ); + + layout->addWidget( source_label, 0, 0, 0 ); + layout->addWidget( source, 0, 1, 0 ); + layout->addWidget( destination_label, 1, 0, 0 ); + layout->addWidget( destination, 1, 1, 0 ); + layout->addMultiCellWidget( current_file, 2, 2, 0, 1, 0 ); + layout->addMultiCellWidget( individual, 3, 3, 0, 1, 0 ); + layout->addMultiCellWidget( total, 4, 4, 0, 1, 0 ); + layout->addMultiCellWidget( transfer_widget, 5, 6, 0, 1, 0 ); + + // Connections + connect( Smb4KCore::synchronizer(), SIGNAL( progress( const Smb4KSynchronizationInfo & ) ), + this, SLOT( slotProgress( const Smb4KSynchronizationInfo & ) ) ); + + connect( Smb4KCore::synchronizer(), SIGNAL( finished() ), + this, SLOT( slotSynchronizationFinished() ) ); + + + setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() ); +} + + +Smb4KSynchronizationDialog::~Smb4KSynchronizationDialog() +{ + // Do *not* delete the share object here. +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + + +void Smb4KSynchronizationDialog::slotUser1() +{ + // Synchronize! + + // Disable the URL requesters but in a way, that the information + // proviced in them is still readable: + KURLRequester *source = static_cast( child( "SourceURL", "KURLRequester", true ) ); + source->lineEdit()->setReadOnly( true ); + source->button()->setEnabled( false ); + + KURLRequester *destination = static_cast( child( "DestinationURL", "KURLRequester", true ) ); + destination->lineEdit()->setReadOnly( true ); + destination->button()->setEnabled( false ); + + QWidget *transfer_widget = static_cast( child( "TransferInfoWidget", "QWidget", true ) ); + transfer_widget->setEnabled( true ); + + enableButton( User1, false ); + enableButton( User2, false ); + + // Enable the progress bars and the information widgets: + static_cast( child( "IndividualProgress", "KProgress", true ) )->setEnabled( true ); + static_cast( child( "TotalProgress", "KProgress", true ) )->setEnabled( true ); + + Smb4KCore::synchronizer()->synchronize( source->url(), destination->url() ); +} + + +void Smb4KSynchronizationDialog::slotUser2() +{ + // Swap URLs. + + KURLRequester *source = static_cast( child( "SourceURL", "KURLRequester", true ) ); + KURLRequester *destination = static_cast( child( "DestinationURL", "KURLRequester", true ) ); + + QString sourceURL = source->url(); + QString destinationURL = destination->url(); + + source->setURL( destinationURL ); + destination->setURL( sourceURL ); +} + + +void Smb4KSynchronizationDialog::slotCancel() +{ + Smb4KCore::synchronizer()->abort(); + + KDialogBase::slotCancel(); +} + + +void Smb4KSynchronizationDialog::slotProgress( const Smb4KSynchronizationInfo &info ) +{ + KLineEdit *progress = static_cast( child( "ProgressInfo", "KLineEdit", true ) ); + KProgress *individual = static_cast( child( "IndividualProgress", "KProgress", true ) ); + KProgress *total = static_cast( child( "TotalProgress", "KProgress", true ) ); + QLabel *transferred = static_cast( child( "FilesTransferred", "QLabel", true ) ); + QLabel *rate = static_cast( child( "TransferRate", "QLabel", true ) ); + + if ( !info.text().isEmpty() ) + { + progress->setSqueezedText( info.text() ); + } + + if ( info.individualProgress() != -1 ) + { + individual->setProgress( info.individualProgress() ); + } + + if ( info.totalProgress() != -1 ) + { + total->setProgress( info.totalProgress() ); + } + + if ( info.totalFileNumber() != -1 && info.processedFileNumber() != -1 ) + { + transferred->setText( QString( "%1 / %2" ).arg( info.processedFileNumber() ).arg( info.totalFileNumber() ) ); + } + + if ( !info.transferRate().isEmpty() ) + { + rate->setText( info.transferRate() ); + } +} + + +void Smb4KSynchronizationDialog::slotSynchronizationFinished() +{ + KProgress *individual = static_cast( child( "IndividualProgress", "KProgress", true ) ); + KProgress *total = static_cast( child( "TotalProgress", "KProgress", true ) ); + + if ( individual && individual->progress() != 100 ) + { + individual->setProgress( 100 ); + } + + if ( total && total->progress() != 100 ) + { + total->setProgress( 100 ); + } + + // Change the "Cancel" button to a "Close" button. + setButtonGuiItem( Cancel, KStdGuiItem::close() ); +} + +#include "smb4ksynchronizationdialog.moc" diff --git a/smb4k/dialogs/smb4ksynchronizationdialog.h b/smb4k/dialogs/smb4ksynchronizationdialog.h new file mode 100644 index 0000000..c2c0c2d --- /dev/null +++ b/smb4k/dialogs/smb4ksynchronizationdialog.h @@ -0,0 +1,111 @@ +/*************************************************************************** + smb4ksynchronizationdialog - The synchronization dialog of Smb4K + ------------------- + begin : Sa Mai 19 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSYNCHRONIZATIONDIALOG_H +#define SMB4KSYNCHRONIZATIONDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +// forward declarations +class Smb4KShare; +class Smb4KSynchronizationInfo; + +/** + * This class provides a synchronization dialog. It contains URL requesters + * for the source and destination as well as widgets to monitor the process + * of the synchronization. + * + * @author Alexander Reinholdt + */ + +class Smb4KSynchronizationDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param share The share item + * + * @param parent The parent widget + * + * @param name The name of this dialog + */ + Smb4KSynchronizationDialog( Smb4KShare *share, QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KSynchronizationDialog(); + + protected slots: + /** + * Reimplemented from KDialogBase. This slot starts the + * synchronization. + */ + void slotUser1(); + + /** + * Reimplemented from KDialogBase. This slot swaps the + * paths of the source and destination. + */ + void slotUser2(); + + /** + * Reimplemented from KDialogBase. This slot aborts the + * current synchronization and exists the dialog. + */ + void slotCancel(); + + /** + * This slot receives information about the progress of the + * current synchronization and puts it into the dialog. + * + * @param info Information about the progress of the + * current synchronization process. + */ + void slotProgress( const Smb4KSynchronizationInfo &info ); + + /** + * This slot is invoked when the synchronization has finished. + * It is connected to the Smb4KSynchronizer::finished() signal. + */ + void slotSynchronizationFinished(); + + private: + /** + * A pointer to the share object + */ + Smb4KShare *m_share; +}; + +#endif diff --git a/smb4k/icons/Makefile.am b/smb4k/icons/Makefile.am new file mode 100644 index 0000000..5f3734f --- /dev/null +++ b/smb4k/icons/Makefile.am @@ -0,0 +1,22 @@ +####### kdevelop will overwrite this part!!! (begin)########## + + +EXTRA_DIST = cr16-app-smb4k.png cr32-app-smb4k.png cr48-app-smb4k.png cr64-app-smb4k.png + +install-data-local: + $(mkinstalldirs) $(kde_icondir)/crystalsvg/16x16/apps/ + $(INSTALL_DATA) $(srcdir)/cr16-app-smb4k.png $(kde_icondir)/crystalsvg/16x16/apps/smb4k.png + $(mkinstalldirs) $(kde_icondir)/crystalsvg/32x32/apps/ + $(INSTALL_DATA) $(srcdir)/cr32-app-smb4k.png $(kde_icondir)/crystalsvg/32x32/apps/smb4k.png + $(mkinstalldirs) $(kde_icondir)/crystalsvg/48x48/apps/ + $(INSTALL_DATA) $(srcdir)/cr48-app-smb4k.png $(kde_icondir)/crystalsvg/48x48/apps/smb4k.png + $(mkinstalldirs) $(kde_icondir)/crystalsvg/64x64/apps/ + $(INSTALL_DATA) $(srcdir)/cr64-app-smb4k.png $(kde_icondir)/crystalsvg/64x64/apps/smb4k.png + +uninstall-local: + -rm -f $(kde_icondir)/crystalsvg/16x16/apps/smb4k.png + -rm -f $(kde_icondir)/crystalsvg/32x32/apps/smb4k.png + -rm -f $(kde_icondir)/crystalsvg/48x48/apps/smb4k.png + -rm -f $(kde_icondir)/crystalsvg/64x64/apps/smb4k.png + +####### kdevelop will overwrite this part!!! (end)############ diff --git a/smb4k/icons/cr16-app-smb4k.png b/smb4k/icons/cr16-app-smb4k.png new file mode 100644 index 0000000..dfd36fb Binary files /dev/null and b/smb4k/icons/cr16-app-smb4k.png differ diff --git a/smb4k/icons/cr32-app-smb4k.png b/smb4k/icons/cr32-app-smb4k.png new file mode 100644 index 0000000..3712c0e Binary files /dev/null and b/smb4k/icons/cr32-app-smb4k.png differ diff --git a/smb4k/icons/cr48-app-smb4k.png b/smb4k/icons/cr48-app-smb4k.png new file mode 100644 index 0000000..789fcb1 Binary files /dev/null and b/smb4k/icons/cr48-app-smb4k.png differ diff --git a/smb4k/icons/cr64-app-smb4k.png b/smb4k/icons/cr64-app-smb4k.png new file mode 100644 index 0000000..5a33038 Binary files /dev/null and b/smb4k/icons/cr64-app-smb4k.png differ diff --git a/smb4k/iconview/Makefile.am b/smb4k/iconview/Makefile.am new file mode 100644 index 0000000..ec51fb2 --- /dev/null +++ b/smb4k/iconview/Makefile.am @@ -0,0 +1,16 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = libsmb4ksharesiconview.la +libsmb4ksharesiconview_la_SOURCES = smb4ksharesiconview.cpp \ + smb4ksharesiconview_part.cpp smb4ksharesiconviewitem.cpp \ + smb4ksharesiconviewtooltip.cpp +libsmb4ksharesiconview_la_LDFLAGS = -module -no-undefined $(all_libraries) +noinst_HEADERS = smb4ksharesiconview.h smb4ksharesiconview_part.h \ + smb4ksharesiconviewitem.h smb4ksharesiconviewtooltip.h +libsmb4ksharesiconview_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(top_builddir)/smb4k/dialogs/libsmb4kdialogs.la $(LIB_KIO) $(LIB_KDECORE) $(LIB_KDEUI) $(KDE_PLUGIN) $(LIB_KPARTS) \ + $(LIB_QT) + +partrcdir = $(kde_datadir)/smb4ksharesiconviewpart +partrc_DATA = smb4ksharesiconview_part.rc diff --git a/smb4k/iconview/smb4ksharesiconview.cpp b/smb4k/iconview/smb4ksharesiconview.cpp new file mode 100644 index 0000000..bb669e1 --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconview.cpp @@ -0,0 +1,271 @@ +/*************************************************************************** + smb4ksharesiconview - This is the shares icon view of Smb4K. + ------------------- + begin : Mo Dez 4 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include +#include +#include +#include + +// application specific includes +#include "smb4ksharesiconview.h" +#include "smb4ksharesiconviewitem.h" +#include "smb4ksharesiconviewtooltip.h" +#include "../core/smb4kshare.h" +#include "../core/smb4ksettings.h" +#include "../core/smb4kcore.h" + + +Smb4KSharesIconView::Smb4KSharesIconView( QWidget *parent, const char *name ) +: KIconView( parent, name ) +{ + setSelectionMode( KIconView::Single ); // If this is changed, revise dragObject() function. + setResizeMode( KIconView::Adjust ); + setAutoArrange( true ); + setSorting( true, true ); + setItemsMovable( false ); + setAcceptDrops( true ); + setItemTextPos( KIconView::Bottom ); + setMaxItemWidth( 150 ); + setArrangement( KIconView::LeftToRight ); + setWordWrapIconText( true ); + + m_tooltip = NULL; + + // Connections: + connect( this, SIGNAL( pressed( QIconViewItem * ) ), + this, SLOT( slotPressed( QIconViewItem * ) ) ); +} + + +Smb4KSharesIconView::~Smb4KSharesIconView() +{ + // The tool tip's parent is 0 and not this icon view. + if ( m_tooltip ) + { + delete m_tooltip; + } +} + + +void Smb4KSharesIconView::updateToolTip() +{ + if ( !m_tooltip ) + { + return; + } + + m_tooltip->update(); +} + + +KURLDrag *Smb4KSharesIconView::dragObject() +{ + // Get the KURL of the item that is to be dragged: + KURL url = KURL( static_cast( currentItem() )->shareObject()->canonicalPath() ); + + KURLDrag *drag = new KURLDrag( KURL::List::List( url ), this ); + drag->setPixmap( DesktopIcon( "folder" ) ); +// drag->dragCopy(); + + return drag; +} + + +void Smb4KSharesIconView::startDrag() +{ + // Kill the tooltip, so it is not in the way: + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + + if ( !Smb4KSettings::enableDragSupport() ) + { + return; + } + + KIconView::startDrag(); +} + + +void Smb4KSharesIconView::contentsDragEnterEvent( QDragEnterEvent *e ) +{ + e->accept( Smb4KSettings::enableDropSupport() ); +} + + +void Smb4KSharesIconView::contentsDragMoveEvent( QDragMoveEvent *e ) +{ + QIconViewItem *item = findItem( e->pos() ); + + e->accept( Smb4KSettings::enableDropSupport() && item ); +} + + +void Smb4KSharesIconView::contentsDropEvent( QDropEvent *e ) +{ + QIconViewItem *item = findItem( e->pos() ); + KURL::List src; + + // Do we have to stop here? + if ( !Smb4KSettings::enableDropSupport() || + !item || + !KURLDrag::decode( e, src ) ) + { + e->ignore(); + + return; + } + + KURL dest; + dest.setPath( static_cast( item )->shareObject()->canonicalPath() ); + + // Deny dropping if we dropped something on itself. + // This was inspired by KonqOperations::doDrop() function. + for ( KURL::List::Iterator it = src.begin(); it != src.end(); ++it ) + { + if ( dest.equals( *it, true ) ) + { + if ( e->source() == this || e->source()->parent() == this ) + { + e->ignore(); + + return; + } + } + } + + // We only allow copying: + KIO::CopyJob *job = KIO::copy( src, dest, true ); + job->setAutoErrorHandlingEnabled( true, NULL ); +#if KDE_VERSION_MAJOR >= 3 && KDE_VERSION_MINOR >= 5 + job->setAutoWarningHandlingEnabled( true ); +#endif +} + + +void Smb4KSharesIconView::contentsMouseMoveEvent( QMouseEvent *e ) +{ + m_pos = e->globalPos(); + + Smb4KSharesIconViewItem *item = static_cast( findItem( e->pos() ) ); + + if ( item ) + { + if ( m_tooltip ) + { + // Check if tool tip is still valid: + if ( m_tooltip->item() != item ) + { + delete m_tooltip; + + if ( hasMouse() && Smb4KSettings::showShareToolTip() ) + { + m_tooltip = new Smb4KSharesIconViewToolTip( item ); + + QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) ); + } + else + { + m_tooltip = NULL; + } + } + else + { + // Do nothing + } + + } + else + { + // Create new tool tip: + if ( hasMouse() && Smb4KSettings::showShareToolTip() ) + { + m_tooltip = new Smb4KSharesIconViewToolTip( item ); + + QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) ); + } + else + { + // Do nothing + } + } + } + else + { + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + } + + KIconView::contentsMouseMoveEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSharesIconView::slotPressed( QIconViewItem *item ) +{ + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + + if ( !item ) + { + // Clear the selection if the user clicked onto the + // viewport: + clearSelection(); + } + else + { + // Do nothing + } +} + + +void Smb4KSharesIconView::slotShowToolTip() +{ + if ( m_tooltip && hasMouse() && Smb4KSettings::showShareToolTip() && + (m_tooltip->item() == static_cast( findItem( viewport()->mapFromGlobal( m_pos ) ) )) ) + { + m_tooltip->showTip( m_pos ); + } + else + { + delete m_tooltip; + m_tooltip = NULL; + } +} + + +#include "smb4ksharesiconview.moc" diff --git a/smb4k/iconview/smb4ksharesiconview.h b/smb4k/iconview/smb4ksharesiconview.h new file mode 100644 index 0000000..048e23d --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconview.h @@ -0,0 +1,139 @@ +/*************************************************************************** + smb4ksharesiconview - This is the shares icon view of Smb4K. + ------------------- + begin : Mo Dez 4 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESICONVIEW_H +#define SMB4KSHARESICONVIEW_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include +#include + +// forward declarations +class Smb4KSharesIconViewItem; +class Smb4KSharesIconViewToolTip; + + +/** + * This widget class provides the shares icon view of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesIconView : public KIconView +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent widget + * + * @param name The name of the widget + */ + Smb4KSharesIconView( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KSharesIconView(); + + /** + * Update the tool tip if it exists. This function just executes + * Smb4KSharesListViewToolTip::update(). + */ + void updateToolTip(); + + protected: + /** + * Reimplemented (sort of) from QIconView to enable dragging. As QDragObject + * a KURLDrag will be returned. + * + * @returns a KURLDrag object. + */ + KURLDrag *dragObject(); + + /** + * Reimplemented from QIconView to allow some actions to be carried + * out before the drag begins. + */ + void startDrag(); + + /** + * Reimplemented from QIconView. + */ + void contentsDragEnterEvent( QDragEnterEvent * ); + + /** + * Reimplemented from QIconView. + */ + void contentsDragMoveEvent( QDragMoveEvent *e ); + + /** + * Reimplemented from QIconView. + */ + void contentsDropEvent( QDropEvent *e ); + + /** + * Reimplemented from QIconView. This function is used to + * show the tooltips. + */ + void contentsMouseMoveEvent( QMouseEvent *e ); + + protected slots: + /** + * This slot is connected to KIconView::pressed() and clears the selection + * if the user clicked on the viewport. + * + * @param item The QIconViewItem that the user clicked or NULL + * if he/she pressed a mouse button on the viewport. + */ + void slotPressed( QIconViewItem *item ); + + /** + * This slot shows the tool tip for an icon view item. + */ + void slotShowToolTip(); + + private: + /** + * The current global mouse position + */ + QPoint m_pos; + + /** + * The tool tip + */ + Smb4KSharesIconViewToolTip *m_tooltip; +}; + +#endif diff --git a/smb4k/iconview/smb4ksharesiconview_part.cpp b/smb4k/iconview/smb4ksharesiconview_part.cpp new file mode 100644 index 0000000..0f47631 --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconview_part.cpp @@ -0,0 +1,573 @@ +/*************************************************************************** + smb4ksharesview_part - This Part includes the shares icon view + of Smb4K. + ------------------- + begin : Mo Dez 4 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4ksharesiconview_part.h" +#include "smb4ksharesiconview.h" +#include "smb4ksharesiconviewitem.h" +#include "../dialogs/smb4ksynchronizationdialog.h" +#include "../core/smb4kshare.h" +#include "../core/smb4kcore.h" +#include "../core/smb4ksettings.h" + + +KInstance *Smb4KSharesIconViewPartFactory::m_instance = 0L; +KAboutData *Smb4KSharesIconViewPartFactory::m_about = 0L; + + +Smb4KSharesIconViewPart::Smb4KSharesIconViewPart( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name ) +: KParts::Part( parent, name ) +{ + // First of all We need an instance: + setInstance( Smb4KSharesIconViewPartFactory::instance() ); + + // Set the XML file: + setXMLFile( "smb4ksharesiconview_part.rc" ); + + // Set the widget of this part: + m_widget = new Smb4KSharesIconView( parentWidget, widgetName ); + setWidget( m_widget ); + + // Set up the actions. + // Do not put this before setWidget() or the shortcuts + // will not be shown. + setupActions(); + + // Import the shares: + slotMountedShares(); + + // Load settings: + loadSettings(); + + // Add some connections: + connect( Smb4KCore::mounter(), SIGNAL( updated() ), + this, SLOT( slotMountedShares() ) ); + + connect( Smb4KCore::synchronizer(), SIGNAL( state( int ) ), + this, SLOT( slotSynchronizationState( int ) ) ); + + connect( m_widget, SIGNAL( contextMenuRequested( QIconViewItem *, const QPoint & ) ), + this, SLOT( slotContextMenuRequested( QIconViewItem *, const QPoint & ) ) ); + + connect( m_widget, SIGNAL( selectionChanged( QIconViewItem * ) ), + this, SLOT( slotSelectionChanged( QIconViewItem * ) ) ); + + connect( m_widget, SIGNAL( pressed( QIconViewItem * ) ), + this, SLOT( slotMouseButtonPressed( QIconViewItem * ) ) ); + + connect( m_widget, SIGNAL( executed( QIconViewItem * ) ), + this, SLOT( slotFilemanager() ) ); +} + + +Smb4KSharesIconViewPart::~Smb4KSharesIconViewPart() +{ +} + + +void Smb4KSharesIconViewPart::setupActions() +{ + // Create the actions: + KAction *unmount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut( CTRL+Key_U ), + this, SLOT( slotUnmountShare() ), + actionCollection(), "unmount_action" ); +#ifdef __linux__ + KAction *force = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut( CTRL+Key_F ), + this, SLOT( slotForceUnmountShare() ), + actionCollection(), "force_unmount_action" ); +#endif + KAction *all = new KAction( i18n( "U&nmount All" ), "gear", KShortcut( CTRL+Key_N ), + this, SLOT( slotUnmountAllShares() ), + actionCollection(), "unmount_all_action" ); + KAction *sync = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut( CTRL+Key_Y ), + this, SLOT( slotSynchronize() ), + actionCollection(), "synchronize_action" ); + KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut( CTRL+Key_L ), + this, SLOT( slotKonsole() ), + actionCollection(), "konsole_action" ); + KAction *konq = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut( CTRL+Key_K ), + this, SLOT( slotFilemanager() ), + actionCollection(), "filemanager_action" ); + + // Disable all actions for now: + unmount->setEnabled( false ); +#ifdef __linux__ + force->setEnabled( false ); +#endif + all->setEnabled( false ); + sync->setEnabled( false ); + konsole->setEnabled( false ); + konq->setEnabled( false ); + + // Insert the actions into the menu: + m_menu = new KActionMenu( this, "SharesIconViewMenu" ); + m_menu->popupMenu()->insertTitle( SmallIcon( "hdd_mount" ), i18n( "Shares" ), 0 ); + m_menu->insert( unmount, -1 ); +#ifdef __linux__ + m_menu->insert( force, -1 ); +#endif + m_menu->insert( all, -1 ); + m_menu->popupMenu()->insertSeparator( -1 ); + m_menu->insert( sync, -1 ); + m_menu->popupMenu()->insertSeparator( -1 ); + m_menu->insert( konsole, -1 ); + m_menu->insert( konq, -1 ); +} + + +void Smb4KSharesIconViewPart::loadSettings() +{ +#ifdef __linux__ + actionCollection()->action( "force_unmount_action" )->setEnabled( Smb4KSettings::useForceUnmount() ); +#endif + + // Change the text of the share: + for ( QIconViewItem *it = m_widget->firstItem(); it; it = it->nextItem() ) + { + Smb4KSharesIconViewItem *item = static_cast( it ); + + if ( item ) + { + item->setText( (Smb4KSettings::showMountPoint() ? + item->shareObject()->path() : + item->shareObject()->name()) ); + } + } + + // Enable/disable support for dropping: + m_widget->setAcceptDrops( Smb4KSettings::enableDropSupport() ); + + // Load or remove all foreign shares. The easiest way to do this + // is to invoke slotMountedShares(): + slotMountedShares(); +} + + +void Smb4KSharesIconViewPart::customEvent( QCustomEvent *e ) +{ + switch ( e->type() ) + { + case EVENT_LOAD_SETTINGS: + { + loadSettings(); + slotMountedShares(); + + break; + } + case EVENT_SET_FOCUS: + { + KIconView *view = static_cast( m_widget ); + + if ( view->count() != 0 ) + { + view->setSelected( !view->currentItem() ? + view->firstItem() : + view->currentItem(), true, false ); + } + + view->setFocus(); + + break; + } + default: + { + break; + } + } + + KParts::Part::customEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS (Smb4KSharesIconViewPart) +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSharesIconViewPart::slotContextMenuRequested( QIconViewItem *item, const QPoint &pos ) +{ + if ( item ) + { + m_menu->popupMenu()->changeTitle( 0, SmallIcon( "hdd_mount" ), + static_cast( item )->shareObject()->name() ); + } + else + { + m_menu->popupMenu()->changeTitle( 0, SmallIcon( "hdd_mount" ), i18n( "Shares" ) ); + } + + m_menu->popupMenu()->exec( pos, 0 ); +} + + +void Smb4KSharesIconViewPart::slotSelectionChanged( QIconViewItem *item ) +{ + // NOTE: Here we only enable or disable the KActions. All other things + // are done in the Smb4KSharesIconView class. + + // This slot is used to enable or disable the actions when the user + // changes the item in the icon view. This slot won't be called when + // the user clicks on the view port! + if ( item ) + { + actionCollection()->action( "unmount_action" )->setEnabled( true ); +#ifdef __linux__ + actionCollection()->action( "force_unmount_action" )->setEnabled( Smb4KSettings::useForceUnmount() ); +#endif + actionCollection()->action( "unmount_all_action" )->setEnabled( true ); + + Smb4KShare *share = static_cast( item )->shareObject(); + + if ( !share->isBroken() ) + { + actionCollection()->action( "konsole_action" )->setEnabled( !Smb4KSettings::konsole().isEmpty() ); + actionCollection()->action( "filemanager_action" )->setEnabled( true ); + actionCollection()->action( "synchronize_action" )->setEnabled( !Smb4KSettings::rsync().isEmpty() && + !Smb4KCore::synchronizer()->isRunning() ); + } + else + { + actionCollection()->action( "konsole_action" )->setEnabled( false ); + actionCollection()->action( "filemanager_action" )->setEnabled( false ); + actionCollection()->action( "synchronize_action" )->setEnabled( false ); + } + } + else + { + // Smb4KSharesIconViewPart::slotMouseButtonPressed() + } +} + + +void Smb4KSharesIconViewPart::slotMouseButtonPressed( QIconViewItem *item ) +{ + // NOTE: Here we only enable or disable the KActions. All other things + // are done in the Smb4KSharesIconView class. + + // Here we do all the stuff that cannot be done in + // Smb4KSharesIconViewPart::slotSelectionChanged() + if ( !item ) + { + actionCollection()->action( "unmount_action" )->setEnabled( false ); +#ifdef __linux__ + actionCollection()->action( "force_unmount_action" )->setEnabled( false ); +#endif + actionCollection()->action( "unmount_all_action" )->setEnabled( (m_widget->count() > 0) ); + actionCollection()->action( "konsole_action" )->setEnabled( false ); + actionCollection()->action( "filemanager_action" )->setEnabled( false ); + actionCollection()->action( "synchronize_action" )->setEnabled( false ); + } + else + { + // See Smb4KSharesIconViewPart::slotSelectionChanged() + } +} + + +void Smb4KSharesIconViewPart::slotMountedShares() +{ + // Get the list of shares: + QValueList list = Smb4KCore::mounter()->getShares(); + + // Update the view: + if ( !list.isEmpty() ) + { + // Remove all obsolete items: + Smb4KSharesIconViewItem *test_item = static_cast( m_widget->firstItem() ); + Smb4KSharesIconViewItem *next_item = NULL; + + while ( test_item ) + { + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( test_item->shareObject()->path() ); + next_item = static_cast( test_item->nextItem() ); + + if( !share || (test_item->shareObject()->isForeign() && !Smb4KSettings::showAllShares()) ) + { + delete test_item; + test_item = NULL; + } + + test_item = next_item; + } + + // Now process the entries in the list: + bool already_in_view = false; + + for ( QValueListConstIterator it = list.begin(); it != list.end(); ++it ) + { + // Check, whether the share is already in the list. Look for the + // mount point. + for ( Smb4KSharesIconViewItem *item = static_cast( m_widget->firstItem() ); + item; item = static_cast( item->nextItem() ) ) + { + if ( QString::compare( item->shareObject()->path(), (*it)->path() ) == 0 || + QString::compare( item->shareObject()->canonicalPath(), (*it)->canonicalPath() ) == 0 ) + { + // Replace the share object if something changed: + if ( !item->sameShareObject( *it ) ) + { + item->replaceShareObject( *it ); + } + + already_in_view = true; + + break; + } + else + { + continue; + } + } + + if ( !already_in_view ) + { + if ( !Smb4KSettings::showAllShares() && (*it)->isForeign() ) + { + // If the user does not want to have foreign shares + // displayed continue. + continue; + } + else + { + // Put the new item into the icon view: + (void) new Smb4KSharesIconViewItem( *it, Smb4KSettings::showMountPoint(), m_widget ); + + continue; + } + } + + already_in_view = false; + } + + m_widget->sort( m_widget->sortDirection() ); + } + else + { + m_widget->clear(); + } + + // Update the tool tip, if it exists: + if ( m_widget->count() != 0 ) + { + m_widget->updateToolTip(); + } + + // Enable/disable the actions: + QIconViewItem *item = m_widget->currentItem(); + bool have_selected_item = (item && item->isSelected()); + + actionCollection()->action( "unmount_action" )->setEnabled( have_selected_item ); +#ifdef __linux__ + if ( Smb4KSettings::useForceUnmount() ) + { + actionCollection()->action( "force_unmount_action" )->setEnabled( have_selected_item ); + } + else + { + actionCollection()->action( "force_unmount_action" )->setEnabled( false ); + } +#endif + actionCollection()->action( "unmount_all_action" )->setEnabled( (m_widget->count() > 0) ); + actionCollection()->action( "konsole_action" )->setEnabled( !Smb4KSettings::konsole().isEmpty() && + have_selected_item ); + actionCollection()->action( "filemanager_action" )->setEnabled( have_selected_item ); + actionCollection()->action( "synchronize_action" )->setEnabled( !Smb4KSettings::rsync().isEmpty() && + !Smb4KCore::synchronizer()->isRunning() && + have_selected_item ); +} + + +void Smb4KSharesIconViewPart::slotUnmountShare() +{ + Smb4KSharesIconViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item ) + { + Smb4KCore::mounter()->unmountShare( item->shareObject(), false ); + } +} + + +void Smb4KSharesIconViewPart::slotForceUnmountShare() +{ + Smb4KSharesIconViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item ) + { + Smb4KCore::mounter()->unmountShare( item->shareObject(), true ); + } +} + + +void Smb4KSharesIconViewPart::slotUnmountAllShares() +{ + Smb4KCore::mounter()->unmountAllShares(); +} + + +void Smb4KSharesIconViewPart::slotSynchronize() +{ + Smb4KSharesIconViewItem *item = static_cast( m_widget->currentItem() ); + Smb4KSynchronizationDialog *dlg = static_cast( m_widget->child( "SynchronizationDialog", "Smb4KSynchronizationDialog", true ) ); + + if ( item && !item->shareObject()->isBroken() && !dlg ) + { + dlg = new Smb4KSynchronizationDialog( item->shareObject(), m_widget, "SynchronizationDialog" ); + + dlg->show(); + } +} + +void Smb4KSharesIconViewPart::slotKonsole() +{ + Smb4KSharesIconViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item && !item->shareObject()->isBroken() ) + { + Smb4KCore::open( item->shareObject(), Smb4KCore::Konsole ); + } +} + + +void Smb4KSharesIconViewPart::slotFilemanager() +{ + Smb4KSharesIconViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item ) + { + // Workaround: The item is not selected if you execute it, so + // we have to do it here: +// item->setSelected( true ); + + if ( !item->shareObject()->isBroken() ) + { + Smb4KCore::open( item->shareObject(), Smb4KCore::Konqueror ); + } + } +} + + +void Smb4KSharesIconViewPart::slotSynchronizationState( int state ) +{ + switch ( state ) + { + case SYNCHRONIZER_START: + { + actionCollection()->action( "synchronize_action" )->setEnabled( false ); + + break; + } + case SYNCHRONIZER_STOP: + { + actionCollection()->action( "synchronize_action" )->setEnabled( true ); + + break; + } + default: + { + break; + } + } +} + + + +///////////////////////////////////////////////////////////////////////////// +// FACTORY STUFF +///////////////////////////////////////////////////////////////////////////// + +Smb4KSharesIconViewPartFactory::Smb4KSharesIconViewPartFactory() +: KParts::Factory() +{ +} + + +Smb4KSharesIconViewPartFactory::~Smb4KSharesIconViewPartFactory() +{ + delete m_instance; + delete m_about; + + m_instance = 0L; +} + + +KParts::Part *Smb4KSharesIconViewPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, +QObject *parent, const char *name, const char *, const QStringList & ) +{ + Smb4KSharesIconViewPart *obj = new Smb4KSharesIconViewPart( parentWidget, widgetName, parent, name ); + + // See if we are to be read-write or not +// if (QCString(classname) == "KParts::ReadOnlyPart") +// { +// obj->setReadWrite(false); +// } + + return obj; +} + + +KInstance *Smb4KSharesIconViewPartFactory::instance() +{ + if( !m_instance ) + { + m_about = new KAboutData( "smb4ksharesiconviewpart", I18N_NOOP( "Smb4KSharesIconViewPart" ), "1.0" ); + m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de"); + m_about->setLicense( KAboutData::License_GPL ); + m_instance = new KInstance( m_about ); + } + + return m_instance; +} + + +///////////////////////////////////////////////////////////////////////////// +// INIT +///////////////////////////////////////////////////////////////////////////// + +extern "C" +{ + void *init_libsmb4ksharesiconview() + { + KGlobal::locale()->insertCatalogue( "smb4k" ); + return new Smb4KSharesIconViewPartFactory; + } +} + + +#include "smb4ksharesiconview_part.moc" diff --git a/smb4k/iconview/smb4ksharesiconview_part.h b/smb4k/iconview/smb4ksharesiconview_part.h new file mode 100644 index 0000000..f9d482b --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconview_part.h @@ -0,0 +1,232 @@ +/*************************************************************************** + smb4ksharesview_part - This Part includes the shares icon view + of Smb4K. + ------------------- + begin : Mo Dez 4 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESICONVIEW_PART_H +#define SMB4KSHARESICONVIEW_PART_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +// applications specific includes +#include "smb4ksharesiconview.h" + +/** + * This is one of the parts of Smb4K. It contains the shares icon + * view. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesIconViewPart : public KParts::Part +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parentWidget The parent widget + * + * @param widgetName The name the widget should have + * + * @param parent The parent object + * + * @param name The name this object should have + */ + Smb4KSharesIconViewPart( QWidget *parentWidget = 0, const char *widgetName = 0, + QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + virtual ~Smb4KSharesIconViewPart(); + + protected: + /** + * Reimplemented from KParts::Part. + */ + void customEvent( QCustomEvent *e ); + + protected slots: + /** + * Opens a context menu over the icon view item @p item at position + * @p pos if requested. + * + * @param item The icon view item or NULL if the user clicked + * somewhere else. + * + * @param pos The position where the user clicked. + */ + void slotContextMenuRequested( QIconViewItem *item, const QPoint & pos ); + + /** + * This slot is called when the selection in the icon view changed. It + * enables or disables the actions according to known options/states. + * Please note that it won't be invoked when the user clicked on the + * viewport. Use slotMouseButtonPressed() to also catch that event. + * + * @param item The icon view item that was selected + */ + void slotSelectionChanged( QIconViewItem *item ); + + /** + * This slot is called when the user presses any mouse button somewhere + * in the icon view. It enables or disables the actions according to known + * options/states. + * + * @param item The icon view item that was clicked or NULL if the + * user clicked onto the viewport. + */ + void slotMouseButtonPressed( QIconViewItem *item ); + + /** + * This slot is called by the Smb4KMounter::updated() signal and updates + * the icon view according to the list that is returned by Smb4KMounter::getShares(). + */ + void slotMountedShares(); + + /** + * This slot is connected to the 'Unmount action'. You will be able to + * unmount a certain share when activating this slot. + */ + void slotUnmountShare(); + + /** + * This slot is connected to the 'Force Unmounting' action and is, thus, + * only useful under Linux, because only there the possibility for a forced + * (i.e. lazy) unmount exists. + * + * When activating this slot, the selected share will be unmounted, even if + * it is not accessible or the server already went offline. + */ + void slotForceUnmountShare(); + + /** + * This slot is connected to the 'Unmount All' action. All shares - either of + * the user or that are present on the system (depending on the settings the + * user chose) - will be unmounted. Please note that Smb4KMounter::unmountAllShares() + * is invoked directly. + */ + void slotUnmountAllShares(); + + /** + * This slot is connected to the 'Synchronize' action. The current item will be + * synchronized with a local copy (or vice versa) if you activate it. + */ + void slotSynchronize(); + + /** + * This slot is connected to the 'Konsole' action. The mount point of the current + * share item will be opened in Konsole. + */ + void slotKonsole(); + + /** + * This slot is connected to the 'Konqueror' action. The contents of the current + * share item will be opened in the file manager. + */ + void slotFilemanager(); + + /** + * This slot is called by the synchronizer whenever the state of the synchronization + * process changed. + * + * @param state The state the synchronizer is in. + */ + void slotSynchronizationState( int state ); + + private: + /** + * Set up the actions + */ + void setupActions(); + + /** + * Load settings for the widget or the actions. + */ + void loadSettings(); + + /** + * The icon view. + */ + Smb4KSharesIconView *m_widget; + + /** + * The action menu. + */ + KActionMenu *m_menu; +}; + + +class KInstance; +class KAboutData; + +class Smb4KSharesIconViewPartFactory : public KParts::Factory +{ + Q_OBJECT + + public: + /** + * The constructor + */ + Smb4KSharesIconViewPartFactory(); + + /** + * The destructor + */ + virtual ~Smb4KSharesIconViewPartFactory(); + + /** + * Reimplemented from KParts::Factory + */ + virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ); + + /** + * The instance + */ + static KInstance *instance(); + + private: + /** + * The factory's instance. + */ + static KInstance *m_instance; + + /** + * The factory's KAboutData object + */ + static KAboutData *m_about; +}; + + +#endif diff --git a/smb4k/iconview/smb4ksharesiconview_part.rc b/smb4k/iconview/smb4ksharesiconview_part.rc new file mode 100644 index 0000000..dd82e5e --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconview_part.rc @@ -0,0 +1,25 @@ + + + + &Shares + + + + + + + + + + + + + + + + + + + + + diff --git a/smb4k/iconview/smb4ksharesiconviewitem.cpp b/smb4k/iconview/smb4ksharesiconviewitem.cpp new file mode 100644 index 0000000..c54a734 --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconviewitem.cpp @@ -0,0 +1,148 @@ +/*************************************************************************** + smb4ksharesiconviewitem - The items for Smb4K's shares icon view. + ------------------- + begin : Di Dez 5 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4ksharesiconviewitem.h" +#include "smb4ksharesiconview.h" + +Smb4KSharesIconViewItem::Smb4KSharesIconViewItem( Smb4KShare *share, bool mountpoint, + Smb4KSharesIconView *parent ) +: KIconViewItem( parent, QString::null ), m_share( *share ), m_mountpoint( mountpoint ), + m_initial_setup( false ) +{ + setDropEnabled( true ); + setDragEnabled( true ); + + m_loader = new KIconLoader(); + + setupItem( m_share, m_mountpoint ); +} + + +Smb4KSharesIconViewItem::~Smb4KSharesIconViewItem() +{ + // Do not touch the Smb4KShare object! + delete m_loader; +} + + +void Smb4KSharesIconViewItem::paintItem( QPainter *p, const QColorGroup &cg ) +{ + // Set the color of the item text: + QColorGroup colorgrp( cg ); + + if ( m_share.isForeign() ) + { + colorgrp.setColor( QColorGroup::Text, Qt::gray ); + } + + QIconViewItem::paintItem( p, colorgrp ); +} + + +bool Smb4KSharesIconViewItem::acceptDrop( const QMimeSource *source ) const +{ + if ( source->provides( "text/plain" ) ) + { + return true; + } + + return false; +} + + +void Smb4KSharesIconViewItem::setupItem( const Smb4KShare &share, bool mountpoint ) +{ + // Only do something here if either the item hasn't been set up + // yet, or share and mountpoint changed, respectively. + if ( !m_initial_setup || !m_share.equals( share ) || m_mountpoint != mountpoint ) + { + if ( !m_initial_setup || m_share.isBroken() != share.isBroken() ) + { + int icon_state = m_share.isForeign() ? KIcon::DisabledState : KIcon::DefaultState; + + if ( m_share.isBroken() ) + { + QImage over = m_loader->loadIcon( "button_cancel", KIcon::Desktop, + 0, icon_state, 0L, false ).convertToImage(); + QImage src = m_loader->loadIcon( "hdd_mount", KIcon::Desktop, + 0, icon_state, 0L, false ).convertToImage(); + + KIconEffect e; + e.semiTransparent( over ); + e.overlay( src, over ); + + m_pixmap = QPixmap( src ); + } + else + { + m_pixmap = m_loader->loadIcon( "hdd_mount", KIcon::Desktop, + 0, icon_state, 0L, false ); + } + + setPixmap( m_pixmap ); + } + else + { + // Do nothing + } + + if ( !m_initial_setup || m_mountpoint != mountpoint ) + { + setText( (m_mountpoint ? m_share.path() : m_share.name()) ); + } + else + { + // Do nothing + } + + m_initial_setup = true; + m_share = share; + m_mountpoint = mountpoint; + } + else + { + // Do nothing + } +} + + +bool Smb4KSharesIconViewItem::sameShareObject( Smb4KShare *share ) +{ + return m_share.equals( *share ); +} + + +void Smb4KSharesIconViewItem::replaceShareObject( Smb4KShare *share ) +{ + setupItem( *share, m_mountpoint ); +} diff --git a/smb4k/iconview/smb4ksharesiconviewitem.h b/smb4k/iconview/smb4ksharesiconviewitem.h new file mode 100644 index 0000000..c18360f --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconviewitem.h @@ -0,0 +1,173 @@ +/*************************************************************************** + smb4ksharesiconviewitem - The items for Smb4K's shares icon view. + ------------------- + begin : Di Dez 5 2006 + copyright : (C) 2006 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESICONVIEWITEM_H +#define SMB4KSHARESICONVIEWITEM_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include +#include + +// application specific includes +#include "../core/smb4kshare.h" + +// forward declarations +class Smb4KSharesIconView; + +/** + * This class provides the items for the shares icon view + * of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesIconViewItem : public KIconViewItem +{ + public: + /** + * The constructor. + * + * @param share The Smb4KShare object that represents the share. + * + * @param mountpoint Tells the item if the mount point instead of the + * share name should be shown. Default is FALSE. + * + * @param parent The parent widget of this item. + */ + Smb4KSharesIconViewItem( Smb4KShare *share, + bool mountpoint = false, + Smb4KSharesIconView *parent = 0 ); + + /** + * The destructor + */ + ~Smb4KSharesIconViewItem(); + + /** + * This function compares the encapsulated Smb4KShare object with @p item + * and returns TRUE if they contain equal values. + * + * @param item A Smb4KShare object that should be compared + * + * @returns TRUE if @p item has the same values stored as the + * encapsulated Smb4KShare object. + */ + bool sameShareObject( Smb4KShare *share ); + + /** + * Replace the encapsulated Smb4KShare object. This function just passes + * the share object to setupItem() which does all the work. + * + * @param share The new Smb4KShare object + */ + void replaceShareObject( Smb4KShare *share ); + + /** + * Returns a pointer to the share object that's represented by this item. + * You have to use it to access its data. + * + * @returns a pointer to a Smb4KShare object. + */ + Smb4KShare *shareObject() { return &m_share; } + + /** + * This function returns the desktop pixmap of this item. + * + * @returns the destop pixmap of this item. + */ + const QPixmap &desktopPixmap() { return m_pixmap; } + + protected: + /** + * Reimplemented from QIconViewItem. + * + * This function paints the icon text and uses Smb4KShare::isForeign() to + * determine the color (TRUE: gray, FALSE: the default color). + * + * @param p The painter + * + * @param cg The color group + */ + void paintItem( QPainter *p, + const QColorGroup &cg ); + + /** + * Reimplemented from QIconViewItem. + * + * This function accepts or denies drops according to the contents of @p source. + * + * @param source The mime source + */ + bool acceptDrop( const QMimeSource *source ) const; + + private: + /** + * Set up the icon and text of the item with resepect to @p share and @p mountpoint. + * + * @param share The Smb4KShare object. + * + * @param mountpoint If TRUE, the mount point will be shown instead of the + * share name. + */ + void setupItem( const Smb4KShare &share, + bool mountpoint = false ); + + /** + * The Smb4KShare object representing the share. + */ + Smb4KShare m_share; + + /** + * Tells us if the mount point instead of the share + * name should be shown. + */ + bool m_mountpoint; + + /** + * Tells us that the initial setup already happened. + */ + bool m_initial_setup; + + /** + * The icon loader for this item. + */ + KIconLoader *m_loader; + + /** + * The desktop pixmap + */ + QPixmap m_pixmap; +}; + +#endif + diff --git a/smb4k/iconview/smb4ksharesiconviewtooltip.cpp b/smb4k/iconview/smb4ksharesiconviewtooltip.cpp new file mode 100644 index 0000000..7f33fce --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconviewtooltip.cpp @@ -0,0 +1,429 @@ +/*************************************************************************** + smb4ksharesiconviewtooltip - Tool tip for the shares icon view. + ------------------- + begin : Do Jan 4 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4ksharesiconviewtooltip.h" +#include "smb4ksharesiconviewitem.h" + + +Smb4KSharesIconViewToolTip::Smb4KSharesIconViewToolTip( Smb4KSharesIconViewItem *item ) +: QLabel( 0, "SharesIconViewToolTip", WStyle_StaysOnTop | WStyle_Customize | +WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item ) +{ + setPalette( QToolTip::palette() ); + setLineWidth( 1 ); + setMidLineWidth( 1 ); + setFrameShape( Box ); + setFrameShadow( Plain ); + setMouseTracking( true ); + + m_layout = new QGridLayout( this ); + m_layout->setMargin( 10 ); + m_layout->setSpacing( 3 ); + + m_is_set_up = false; + + m_free = NULL; + m_used = NULL; + m_total = NULL; + m_usage = NULL; + m_pixmap = NULL; + + // We will set up the tip in the showTip() function. +} + + +Smb4KSharesIconViewToolTip::~Smb4KSharesIconViewToolTip() +{ + // Never touch the Smb4KSharesIconViewItem object here! +} + + +void Smb4KSharesIconViewToolTip::showTip( const QPoint &pos ) +{ + if ( !m_item || isShown() ) + { + return; + } + + setupTip(); + + adjustSize(); + + QDesktopWidget *d = QApplication::desktop(); + QPoint p( pos ); + + if ( p.x() + width() > d->width() ) + { + p.setX( p.x() - width() - 5 ); + } + else + { + p.setX( p.x() + 5 ); + } + + if ( p.y() + height() > d->height() ) + { + p.setY( p.y() - height() - 5 ); + } + else + { + p.setY( p.y() + 5 ); + } + + setGeometry( p.x(), p.y(), width(), height() ); + polish(); + show(); + QTimer::singleShot( 10000, this, SLOT( slotHideToolTip() ) ); +} + + +void Smb4KSharesIconViewToolTip::setupTip() +{ + if ( !m_item ) + { + return; + } + + m_layout->addWidget( new QLabel( i18n( "Share:" ), this ), 0, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->name(), this ), 0, 2, 0 ); + m_layout->addWidget( new QLabel( i18n( "Mount point:" ), this ), 1, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->path(), this ), 1, 2, 0 ); + + if ( QString::compare( m_item->shareObject()->filesystem(), "smbfs" ) == 0 ) + { + m_layout->addWidget( new QLabel( "Owner:", this ), 2, 1, 0 ); + m_layout->addWidget( new QLabel( QString( "%1 - %2" ).arg( m_item->shareObject()->user(), m_item->shareObject()->group() ), this ), 2, 2, 0 ); + } + else + { + m_layout->addWidget( new QLabel( "Login:", this ), 2, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->cifsLogin(), this ), 2, 2, 0 ); + } + + m_layout->addWidget( new QLabel( i18n( "File system:" ), this ), 3, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->filesystem().upper(), this ), 3, 2, 0 ); + + QFrame *line = new QFrame( this ); + line->setLineWidth( 1 ); + line->setMidLineWidth( 0 ); + line->setFixedWidth( 100 ); + line->setFrameShape( QFrame::HLine ); + line->setFrameShadow( QFrame::Plain ); + + m_layout->addMultiCellWidget( line, 4, 4, 1, 2, Qt::AlignCenter ); + + // Prepare the disk usage stuff. + if ( !m_item->shareObject()->isBroken() ) + { + QString total, free, used, total_dim, free_dim, used_dim; + + if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 ) + { + double tmp_used = (m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace()) / 1024; + used_dim = "MB"; + + if ( tmp_used >= 1024 ) + { + tmp_used = tmp_used / 1024; + used_dim = "GB"; + } + + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + else + { + used_dim = "kB"; + double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace(); + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + + if ( m_item->shareObject()->freeDiskSpace() >= 1024 ) + { + double tmp_free = m_item->shareObject()->freeDiskSpace() / 1024; + free_dim = "MB"; + + if ( tmp_free >= 1024 ) + { + tmp_free = tmp_free / 1024; + free_dim = "GB"; + } + + free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 ); + } + else + { + free_dim = "kB"; + free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 ); + } + + if ( m_item->shareObject()->totalDiskSpace() >= 1024 ) + { + double tmp_total = m_item->shareObject()->totalDiskSpace() / 1024; + total_dim = "MB"; + + if ( tmp_total >= 1024 ) + { + tmp_total = tmp_total / 1024; + total_dim = "GB"; + } + + total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 ); + } + else + { + total_dim = "kB"; + total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 ); + } + + m_layout->addWidget( new QLabel( i18n( "Free:" ), this, "FreeLabel" ), 5, 1, 0 ); + m_free = new QLabel( QString( "%1 %2" ).arg( free, free_dim ), this ); + m_layout->addWidget( m_free, 5, 2, 0 ); + + m_layout->addWidget( new QLabel( i18n( "Used:" ), this, "UsedLabel" ), 6, 1, 0 ); + m_used = new QLabel( QString( "%1 %2" ).arg( used, used_dim ), this ); + m_layout->addWidget( m_used, 6, 2, 0 ); + + m_layout->addWidget( new QLabel( i18n( "Total:" ), this, "TotalLabel" ), 7, 1, 0 ); + m_total = new QLabel( QString( "%1 %2" ).arg( total, total_dim ), this ); + m_layout->addWidget( m_total, 7, 2, 0 ); + + m_layout->addWidget( new QLabel( i18n( "Usage:" ), this, "UsageLabel" ), 8, 1, 0 ); + m_usage = new QLabel( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ), this ); + m_layout->addWidget( m_usage, 8, 2, 0 ); + } + else + { + QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this ); + + QFont font; + font.setItalic( true ); + + error->setFont( font ); + + m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter ); + } + + m_pixmap = new QLabel( this ); + m_pixmap->setPixmap( m_item->desktopPixmap() ); + + m_layout->addMultiCellWidget( m_pixmap, 0, m_layout->numRows(), 0, 0, Qt::AlignCenter ); + + m_is_set_up = true; +} + + +void Smb4KSharesIconViewToolTip::update() +{ + if ( !m_is_set_up ) + { + return; + } + + // Only change the variable entries: + if ( !m_item->shareObject()->isBroken() ) + { + QString total, free, used, total_dim, free_dim, used_dim; + + if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 ) + { + double tmp_used = (m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace()) / 1024; + used_dim = "MB"; + + if ( tmp_used >= 1024 ) + { + tmp_used = tmp_used / 1024; + used_dim = "GB"; + } + + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + else + { + used_dim = "kB"; + double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace(); + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + + if ( m_item->shareObject()->freeDiskSpace() >= 1024 ) + { + double tmp_free = m_item->shareObject()->freeDiskSpace() / 1024; + free_dim = "MB"; + + if ( tmp_free >= 1024 ) + { + tmp_free = tmp_free / 1024; + free_dim = "GB"; + } + + free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 ); + } + else + { + free_dim = "kB"; + free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 ); + } + + if ( m_item->shareObject()->totalDiskSpace() >= 1024 ) + { + double tmp_total = m_item->shareObject()->totalDiskSpace() / 1024; + total_dim = "MB"; + + if ( tmp_total >= 1024 ) + { + tmp_total = tmp_total / 1024; + total_dim = "GB"; + } + + total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 ); + } + else + { + total_dim = "kB"; + total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 ); + } + + m_free->setText( QString( "%1 %2" ).arg( free, free_dim ) ); + m_used->setText( QString( "%1 %2" ).arg( used, used_dim ) ); + m_total->setText( QString( "%1 %2" ).arg( total, total_dim ) ); + m_usage->setText( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ) ); + } + else + { + QLabel *free_label = static_cast( child( "FreeLabel", "QLabel" ) ); + + if ( free_label ) + { + m_layout->remove( free_label ); + delete free_label; + } + + if ( m_free ) + { + m_layout->remove( m_free ); + delete m_free; + m_free = NULL; + } + + QLabel *used_label = static_cast( child( "UsedLabel", "QLabel" ) ); + + if ( used_label ) + { + m_layout->remove( used_label ); + delete used_label; + } + + if ( m_used ) + { + m_layout->remove( m_used ); + delete m_used; + m_used = NULL; + } + + QLabel *total_label = static_cast( child( "TotalLabel", "QLabel" ) ); + + if ( total_label ) + { + m_layout->remove( total_label ); + delete total_label; + } + + if ( m_total ) + { + m_layout->remove( m_total ); + delete m_total; + m_total = NULL; + } + + QLabel *usage_label = static_cast( child( "UsageLabel", "QLabel" ) ); + + if ( usage_label ) + { + m_layout->remove( usage_label ); + delete usage_label; + } + + if ( m_usage ) + { + m_layout->remove( m_usage ); + delete m_usage; + m_usage = NULL; + } + + QFont font; + font.setItalic( true ); + + QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this ); + error->setFont( font ); + error->show(); + + m_layout->remove( m_pixmap ); + m_pixmap->setPixmap( m_item->desktopPixmap() ); + + m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter ); + m_layout->addMultiCellWidget( m_pixmap, 0, 5, 0, 0, Qt::AlignCenter ); + } + + adjustSize(); +} + + +void Smb4KSharesIconViewToolTip::mousePressEvent( QMouseEvent *e ) +{ + hide(); + QLabel::mousePressEvent( e ); +} + + +void Smb4KSharesIconViewToolTip::leaveEvent( QEvent *e ) +{ + hide(); + QLabel::leaveEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSharesIconViewToolTip::slotHideToolTip() +{ + if ( isShown() ) + { + hide(); + } +} + +#include "smb4ksharesiconviewtooltip.moc" diff --git a/smb4k/iconview/smb4ksharesiconviewtooltip.h b/smb4k/iconview/smb4ksharesiconviewtooltip.h new file mode 100644 index 0000000..f8b1c99 --- /dev/null +++ b/smb4k/iconview/smb4ksharesiconviewtooltip.h @@ -0,0 +1,160 @@ +/*************************************************************************** + smb4ksharesiconviewtooltip - Tool tip for the shares icon view. + ------------------- + begin : Do Jan 4 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESICONVIEWTOOLTIP_H +#define SMB4KSHARESICONVIEWTOOLTIP_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// Forward declarations: +class Smb4KSharesIconViewItem; + +/** + * This class provides the tool tip for the shares icon view + * of Smb4K. It shows information about the associated share. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesIconViewToolTip : public QLabel +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * Please note that the parent of the tool tip will be '0' and + * not the parent widget of @p item. Thus, you have to delete the + * tool tip object in the destructor of the parent widget. + * + * @param item The item for which the tool tip should be shown. + */ + Smb4KSharesIconViewToolTip( Smb4KSharesIconViewItem *item ); + + /** + * The destructor + */ + ~Smb4KSharesIconViewToolTip(); + + /** + * Show the tool tip. Please note that the tool tip will not be + * shown exactly at position @p pos but with a displacement of 5 + * pixels in x- and y-direction. + * + * @param pos The global position of the mouse pointer. + */ + void showTip( const QPoint &pos ); + + /** + * The shares icon view item for which the tool tip should be shown. + * + * @returns a pointer to a Smb4KSharesIconViewItem object. + */ + Smb4KSharesIconViewItem *item() { return m_item; } + + /** + * Update the tool tip by rereading the contents of the shareObject() + * provided by the Smb4KSharesIconViewItem. This function only changes + * those entries that might have changed such as the free and used disk + * space and the usage. + */ + void update(); + + protected: + /** + * Reimplemented from QLabel. + */ + void mousePressEvent( QMouseEvent *e ); + + /** + * Reimplemented from QLabel. + */ + void leaveEvent( QEvent *e ); + + protected slots: + /** + * This slot hides the tool tip after 10 sec. + */ + void slotHideToolTip(); + + private: + /** + * The item for which the tool tip should be shown + */ + Smb4KSharesIconViewItem *m_item; + + /** + * The layout of the tool tip. + */ + QGridLayout *m_layout; + + /** + * This function sets up the tool tip. + */ + void setupTip(); + + /** + * Tells us if the tool tip has already been set up. + */ + bool m_is_set_up; + + /** + * This label holds the variable value of the free + * space left on the share. + */ + QLabel *m_free; + + /** + * This label holds the variable value of the used + * space on the share. + */ + QLabel *m_used; + + /** + * This label holds the value of the total space + * available on the share. + */ + QLabel *m_total; + + /** + * This label holds the variable value of the usage + */ + QLabel *m_usage; + + /** + * This label holds the pixmap. + */ + QLabel *m_pixmap; +}; + +#endif diff --git a/smb4k/listview/Makefile.am b/smb4k/listview/Makefile.am new file mode 100644 index 0000000..385f7ed --- /dev/null +++ b/smb4k/listview/Makefile.am @@ -0,0 +1,14 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = libsmb4kshareslistview.la +libsmb4kshareslistview_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(top_builddir)/smb4k/dialogs/libsmb4kdialogs.la $(LIB_KIO) $(LIB_KDECORE) $(LIB_KDEUI) $(KDE_PLUGIN) $(LIB_KPARTS) \ + $(LIB_QT) + +partrcdir = $(kde_datadir)/smb4kshareslistviewpart +partrc_DATA = smb4kshareslistview_part.rc +libsmb4kshareslistview_la_SOURCES = smb4kshareslistview.cpp \ + smb4kshareslistview_part.cpp smb4kshareslistviewitem.cpp smb4kshareslistviewtooltip.cpp +noinst_HEADERS = smb4kshareslistview.h smb4kshareslistview_part.h \ + smb4kshareslistviewitem.h smb4kshareslistviewtooltip.h diff --git a/smb4k/listview/smb4kshareslistview.cpp b/smb4k/listview/smb4kshareslistview.cpp new file mode 100644 index 0000000..8efc550 --- /dev/null +++ b/smb4k/listview/smb4kshareslistview.cpp @@ -0,0 +1,275 @@ +/*************************************************************************** + smb4kshareslistview - This is the shares list view of Smb4K. + ------------------- + begin : Sa Jun 30 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4kshareslistview.h" +#include "smb4kshareslistviewitem.h" +#include "smb4kshareslistviewtooltip.h" +#include "../core/smb4ksettings.h" + +Smb4KSharesListView::Smb4KSharesListView( QWidget *parent, const char *name ) +: KListView( parent, name ) +{ + setSelectionModeExt( KListView::Single ); + setAllColumnsShowFocus( false ); + setItemsMovable( false ); + setAcceptDrops( true ); + + // Set up columns + addColumn( i18n( "Item" ) ); + addColumn( i18n( "Owner" ) ); +#ifndef __FreeBSD__ + addColumn( i18n( "Login" ) ); +#endif + addColumn( i18n( "File System" ) ); + addColumn( i18n( "Free" ) ); + addColumn( i18n( "Used" ) ); + addColumn( i18n( "Total" ) ); + addColumn( i18n( "Usage" ) ); + + // Set alignment + setColumnAlignment( Free, Qt::AlignRight ); + setColumnAlignment( Used, Qt::AlignRight ); + setColumnAlignment( Total, Qt::AlignRight ); + setColumnAlignment( Usage, Qt::AlignRight ); + + m_tooltip = NULL; + + // Connections: + connect( this, SIGNAL( pressed( QListViewItem * ) ), + this, SLOT( slotPressed( QListViewItem * ) ) ); +} + + +Smb4KSharesListView::~Smb4KSharesListView() +{ + if ( m_tooltip ) + { + delete m_tooltip; + } +} + + +void Smb4KSharesListView::updateToolTip() +{ + if ( !m_tooltip ) + { + return; + } + + m_tooltip->update(); +} + + +KURLDrag *Smb4KSharesListView::dragObject() +{ + // Get the KURL of the item that is to be dragged: + KURL url = KURL( static_cast( currentItem() )->shareObject()->canonicalPath() ); + + KURLDrag *drag = new KURLDrag( KURL::List::List( url ), this ); + drag->setPixmap( DesktopIcon( "folder" ) ); +// drag->dragCopy(); + + return drag; +} + + +void Smb4KSharesListView::startDrag() +{ + if ( !Smb4KSettings::enableDragSupport() ) + { + return; + } + + KListView::startDrag(); +} + + +void Smb4KSharesListView::contentsDragEnterEvent( QDragEnterEvent *e ) +{ + e->accept( Smb4KSettings::enableDropSupport() ); +} + + +void Smb4KSharesListView::contentsDragMoveEvent( QDragMoveEvent *e ) +{ + QListViewItem *item = itemAt( contentsToViewport( e->pos() ) ); + + e->accept( Smb4KSettings::enableDropSupport() && item ); +} + + +void Smb4KSharesListView::contentsDropEvent( QDropEvent *e ) +{ + QListViewItem *item = itemAt( contentsToViewport( e->pos() ) ); + KURL::List src; + + // Do we have to stop here? + if ( !Smb4KSettings::enableDropSupport() || + !item || + !KURLDrag::decode( e, src ) ) + { + e->ignore(); + + return; + } + + KURL dest; + dest.setPath( static_cast( item )->shareObject()->canonicalPath() ); + + // Deny dropping if we dropped something on itself. + // This was inspired by KonqOperations::doDrop() function. + for ( KURL::List::Iterator it = src.begin(); it != src.end(); ++it ) + { + if ( dest.equals( *it, true ) ) + { + if ( e->source() == this || e->source()->parent() == this ) + { + e->ignore(); + + return; + } + } + } + + // We only allow copying: + KIO::CopyJob *job = KIO::copy( src, dest, true ); + job->setAutoErrorHandlingEnabled( true, NULL ); +#if KDE_VERSION_MAJOR >= 3 && KDE_VERSION_MINOR >= 5 + job->setAutoWarningHandlingEnabled( true ); +#endif +} + + +void Smb4KSharesListView::contentsMouseMoveEvent( QMouseEvent *e ) +{ + m_pos = e->globalPos(); + + Smb4KSharesListViewItem *item = static_cast( itemAt( contentsToViewport( e->pos() ) ) ); + + if ( item ) + { + if ( m_tooltip ) + { + // Check if tool tip is still valid: + if ( m_tooltip->item() != item ) + { + delete m_tooltip; + + if ( hasMouse() && Smb4KSettings::showShareToolTip() ) + { + m_tooltip = new Smb4KSharesListViewToolTip( item ); + + QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) ); + } + else + { + m_tooltip = NULL; + } + } + else + { + // Do nothing + } + + } + else + { + // Create new tool tip: + if ( hasMouse() && Smb4KSettings::showShareToolTip() ) + { + m_tooltip = new Smb4KSharesListViewToolTip( item ); + + QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) ); + } + else + { + // Do nothing + } + } + } + else + { + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + } + + KListView::contentsMouseMoveEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSharesListView::slotPressed( QListViewItem *item ) +{ + if ( m_tooltip ) + { + delete m_tooltip; + m_tooltip = NULL; + } + + if ( !item ) + { + // Clear the selection if the user clicked onto the + // viewport: + clearSelection(); + } + else + { + // Do nothing + } +} + + +void Smb4KSharesListView::slotShowToolTip() +{ + if ( m_tooltip && hasMouse() && Smb4KSettings::showShareToolTip() && + (m_tooltip->item() == static_cast( itemAt( viewport()->mapFromGlobal( m_pos ) ) )) ) + { + m_tooltip->showTip( m_pos ); + } + else + { + delete m_tooltip; + m_tooltip = NULL; + } +} + +#include "smb4kshareslistview.moc" diff --git a/smb4k/listview/smb4kshareslistview.h b/smb4k/listview/smb4kshareslistview.h new file mode 100644 index 0000000..df1c265 --- /dev/null +++ b/smb4k/listview/smb4kshareslistview.h @@ -0,0 +1,157 @@ +/*************************************************************************** + smb4kshareslistview - This is the shares list view of Smb4K. + ------------------- + begin : Sa Jun 30 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESLISTVIEW_H +#define SMB4KSHARESLISTVIEW_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +// forward declarations +class Smb4KSharesListViewToolTip; + +/** + * This widget class provides the shares list view of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesListView : public KListView +{ + Q_OBJECT + + public: + /** + * The constructor + * + * @param parent The parent widget + * + * @param name The name of this object + */ + Smb4KSharesListView( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor + */ + ~Smb4KSharesListView(); + + /** + * Enumeration for the columns. + */ +#ifndef __FreeBSD__ + enum Columns { Item = 0, + Owner = 1, + Login = 2, + FileSystem = 3, + Free = 4, + Used = 5, + Total = 6, + Usage = 7 }; +#else + enum Columns { Item = 0, + Owner = 1, + FileSystem = 2, + Free = 3, + Used = 4, + Total = 5, + Usage = 6 }; +#endif + + /** + * Update the tool tip if it exists. This function just executes + * Smb4KSharesListViewToolTip::update(). + */ + void updateToolTip(); + + protected: + /** + * Reimplemented (sort of) from QListView to enable dragging. As QDragObject + * a KURLDrag will be returned. + * + * @returns a KURLDrag object. + */ + KURLDrag *dragObject(); + + /** + * Reimplemented from QListView to allow some actions to be carried + * out before the drag begins. + */ + void startDrag(); + + /** + * Reimplemented from QListView. + */ + void contentsDragEnterEvent( QDragEnterEvent * ); + + /** + * Reimplemented from QListView. + */ + void contentsDragMoveEvent( QDragMoveEvent *e ); + + /** + * Reimplemented from QListView. + */ + void contentsDropEvent( QDropEvent *e ); + + /** + * Reimplemented from QListView. This function is used to + * show the tooltips. + */ + void contentsMouseMoveEvent( QMouseEvent *e ); + + protected slots: + /** + * This slot is connected to KListView::pressed() and clears the selection + * if the user clicked on the viewport. + * + * @param item The QIconViewItem that the user clicked or NULL + * if he/she pressed a mouse button on the viewport. + */ + void slotPressed( QListViewItem *item ); + + /** + * This slot shows the tool tip for an icon view item. + */ + void slotShowToolTip(); + + private: + /** + * The current global mouse position + */ + QPoint m_pos; + + /** + * The tool tip + */ + Smb4KSharesListViewToolTip *m_tooltip; +}; + +#endif + diff --git a/smb4k/listview/smb4kshareslistview_part.cpp b/smb4k/listview/smb4kshareslistview_part.cpp new file mode 100644 index 0000000..723042a --- /dev/null +++ b/smb4k/listview/smb4kshareslistview_part.cpp @@ -0,0 +1,700 @@ +/*************************************************************************** + smb4kshareslistview_part - This Part includes the shares list view + of Smb4K. + ------------------- + begin : Sa Jun 30 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4kshareslistview_part.h" +#include "smb4kshareslistview.h" +#include "smb4kshareslistviewitem.h" +#include "../dialogs/smb4ksynchronizationdialog.h" +#include "../core/smb4kshare.h" +#include "../core/smb4kcore.h" +#include "../core/smb4ksettings.h" + + +KInstance *Smb4KSharesListViewPartFactory::m_instance = 0L; +KAboutData *Smb4KSharesListViewPartFactory::m_about = 0L; + + +Smb4KSharesListViewPart::Smb4KSharesListViewPart( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name ) +: KParts::Part( parent, name ) +{ + // First of all We need an instance: + setInstance( Smb4KSharesListViewPartFactory::instance() ); + + // Set the XML file: + setXMLFile( "smb4kshareslistview_part.rc" ); + + // Set the widget of this part: + m_widget = new Smb4KSharesListView( parentWidget, widgetName ); + setWidget( m_widget ); + + // Set up the actions. + // Do not put this before setWidget() or the shortcuts + // will not be shown. + setupActions(); + + // Import the shares: + slotMountedShares(); + + // Load settings: + loadSettings(); + + // Add some connections: + connect( Smb4KCore::mounter(), SIGNAL( updated() ), + this, SLOT( slotMountedShares() ) ); + + connect( Smb4KCore::synchronizer(), SIGNAL( state( int ) ), + this, SLOT( slotSynchronizationState( int ) ) ); + + connect( m_widget, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint & , int) ), + this, SLOT( slotContextMenuRequested( QListViewItem *, const QPoint &, int ) ) ); + + connect( m_widget, SIGNAL( selectionChanged( QListViewItem * ) ), + this, SLOT( slotSelectionChanged( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( pressed( QListViewItem * ) ), + this, SLOT( slotMouseButtonPressed( QListViewItem * ) ) ); + + connect( m_widget, SIGNAL( executed( QListViewItem * ) ), + this, SLOT( slotFilemanager() ) ); +} + + +Smb4KSharesListViewPart::~Smb4KSharesListViewPart() +{ +} + + +void Smb4KSharesListViewPart::setupActions() +{ + // Create the actions: + KAction *unmount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut( CTRL+Key_U ), + this, SLOT( slotUnmountShare() ), + actionCollection(), "unmount_action" ); +#ifdef __linux__ + KAction *force = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut( CTRL+Key_F ), + this, SLOT( slotForceUnmountShare() ), + actionCollection(), "force_unmount_action" ); +#endif + KAction *all = new KAction( i18n( "U&nmount All" ), "gear", KShortcut( CTRL+Key_N ), + this, SLOT( slotUnmountAllShares() ), + actionCollection(), "unmount_all_action" ); + KAction *sync = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut( CTRL+Key_Y ), + this, SLOT( slotSynchronize() ), + actionCollection(), "synchronize_action" ); + KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut( CTRL+Key_L ), + this, SLOT( slotKonsole() ), + actionCollection(), "konsole_action" ); + KAction *konq = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut( CTRL+Key_K ), + this, SLOT( slotFilemanager() ), + actionCollection(), "filemanager_action" ); + + // Disable all actions for now: + unmount->setEnabled( false ); +#ifdef __linux__ + force->setEnabled( false ); +#endif + all->setEnabled( false ); + sync->setEnabled( false ); + konsole->setEnabled( false ); + konq->setEnabled( false ); + + // Insert the actions into the menu: + m_menu = new KActionMenu( this, "SharesListViewMenu" ); + m_menu->popupMenu()->insertTitle( SmallIcon( "hdd_mount" ), i18n( "Shares" ), 0 ); + m_menu->insert( unmount, -1 ); +#ifdef __linux__ + m_menu->insert( force, -1 ); +#endif + m_menu->insert( all, -1 ); + m_menu->popupMenu()->insertSeparator( -1 ); + m_menu->insert( sync, -1 ); + m_menu->popupMenu()->insertSeparator( -1 ); + m_menu->insert( konsole, -1 ); + m_menu->insert( konq, -1 ); +} + + +void Smb4KSharesListViewPart::loadSettings() +{ +#ifdef __linux__ + actionCollection()->action( "force_unmount_action" )->setEnabled( Smb4KSettings::useForceUnmount() ); +#endif + + m_widget->setColumnWidth( Smb4KSharesListView::Item, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Item, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Item ); + + if ( Smb4KSettings::showOwner() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::Owner, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Owner, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Owner ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::Owner, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Owner, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Owner ); + } + +#ifndef __FreeBSD__ + if ( Smb4KSettings::showLogin() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::Login, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Login, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Login ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::Login, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Login, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Login ); + } +#endif + + if ( Smb4KSettings::showFileSystem() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::FileSystem, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::FileSystem, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::FileSystem ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::FileSystem, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::FileSystem, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::FileSystem ); + } + + if ( Smb4KSettings::showFreeDiskSpace() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::Free, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Free, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Free ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::Free, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Free, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Free ); + } + + if ( Smb4KSettings::showUsedDiskSpace() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::Used, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Used, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Used ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::Used, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Used, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Used ); + } + + if ( Smb4KSettings::showTotalDiskSpace() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::Total, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Total, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Total ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::Total, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Total, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Total ); + } + + if ( Smb4KSettings::showDiskUsage() ) + { + m_widget->setColumnWidth( Smb4KSharesListView::Usage, 10 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Usage, QListView::Maximum ); + m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Usage ); + } + else + { + m_widget->setColumnWidth( Smb4KSharesListView::Usage, 0 ); + m_widget->setColumnWidthMode( Smb4KSharesListView::Usage, QListView::Manual ); + m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Usage ); + } + + // Change the text of the share (first column): + QListViewItemIterator it( m_widget ); + Smb4KSharesListViewItem *item = NULL; + + while( it.current() ) + { + item = static_cast( it.current() ); + + if ( item ) + { + item->setText( 0, (Smb4KSettings::showMountPoint() ? + item->shareObject()->path() : + item->shareObject()->name()) ); + } + + ++it; + } + + // Enable/disable support for dropping: + m_widget->setAcceptDrops( Smb4KSettings::enableDropSupport() ); + + // Load or remove all foreign shares. The easiest way to do this + // is to invoke slotMountedShares(): + slotMountedShares(); + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } +} + + +void Smb4KSharesListViewPart::customEvent( QCustomEvent *e ) +{ + switch ( e->type() ) + { + case EVENT_LOAD_SETTINGS: + { + loadSettings(); + slotMountedShares(); + + break; + } + case EVENT_SET_FOCUS: + { + KListView *view = static_cast( m_widget ); + + if ( view->childCount() != 0 ) + { + view->setSelected( !view->currentItem() ? + view->firstChild() : + view->currentItem(), true ); + } + + view->setFocus(); + + break; + } + default: + { + break; + } + } + + KParts::Part::customEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS (Smb4KSharesListViewPart) +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSharesListViewPart::slotContextMenuRequested( QListViewItem *item, const QPoint &pos, int /*col*/ ) +{ + if ( item ) + { + m_menu->popupMenu()->changeTitle( 0, SmallIcon( "hdd_mount" ), + static_cast( item )->shareObject()->name() ); + } + else + { + m_menu->popupMenu()->changeTitle( 0, SmallIcon( "hdd_mount" ), i18n( "Shares" ) ); + } + + m_menu->popupMenu()->exec( pos, 0 ); +} + + +void Smb4KSharesListViewPart::slotSelectionChanged( QListViewItem *item ) +{ + // NOTE: Here we only enable or disable the KActions. All other things + // are done in the Smb4KSharesListView class. + + // This slot is used to enable or disable the actions when the user + // changes the item in the list view. This slot won't be called when + // the user clicks on the view port! + if ( item ) + { + actionCollection()->action( "unmount_action" )->setEnabled( true ); +#ifdef __linux__ + actionCollection()->action( "force_unmount_action" )->setEnabled( Smb4KSettings::useForceUnmount() ); +#endif + actionCollection()->action( "unmount_all_action" )->setEnabled( true ); + + Smb4KShare *share = static_cast( item )->shareObject(); + + if ( !share->isBroken() ) + { + actionCollection()->action( "konsole_action" )->setEnabled( !Smb4KSettings::konsole().isEmpty() ); + actionCollection()->action( "filemanager_action" )->setEnabled( true ); + actionCollection()->action( "synchronize_action" )->setEnabled( !Smb4KSettings::rsync().isEmpty() && + !Smb4KCore::synchronizer()->isRunning() ); + } + else + { + actionCollection()->action( "konsole_action" )->setEnabled( false ); + actionCollection()->action( "filemanager_action" )->setEnabled( false ); + actionCollection()->action( "synchronize_action" )->setEnabled( false ); + } + } + else + { + // Smb4KSharesListViewPart::slotMouseButtonPressed() + } +} + + +void Smb4KSharesListViewPart::slotMouseButtonPressed( QListViewItem *item ) +{ + // NOTE: Here we only enable or disable the KActions. All other things + // are done in the Smb4KSharesListView class. + + // Here we do all the stuff that cannot be done in + // Smb4KSharesListViewPart::slotSelectionChanged() + if ( !item ) + { + actionCollection()->action( "unmount_action" )->setEnabled( false ); +#ifdef __linux__ + actionCollection()->action( "force_unmount_action" )->setEnabled( false ); +#endif + actionCollection()->action( "unmount_all_action" )->setEnabled( (m_widget->childCount() > 0) ); + actionCollection()->action( "konsole_action" )->setEnabled( false ); + actionCollection()->action( "filemanager_action" )->setEnabled( false ); + actionCollection()->action( "synchronize_action" )->setEnabled( false ); + } + else + { + // See Smb4KSharesListViewPart::slotSelectionChanged() + } +} + + +void Smb4KSharesListViewPart::slotMountedShares() +{ + // Get the list of shares: + QValueList list = Smb4KCore::mounter()->getShares(); + + // Update the view: + if ( !list.isEmpty() ) + { + // Remove all obsolete items: + QListViewItemIterator it( m_widget ); + Smb4KSharesListViewItem *item = NULL; + + while ( it.current() ) + { + item = static_cast( it.current() ); + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( item->shareObject()->path() ); + + if( !share || (item->shareObject()->isForeign() && !Smb4KSettings::showAllShares()) ) + { + delete item; + item = NULL; + } + + ++it; + } + + // Now process the entries in the list: + bool already_in_view = false; + + for ( QValueListConstIterator it = list.begin(); it != list.end(); ++it ) + { + // Check, whether the share is already in the list. Look for the + // mount point. + for ( Smb4KSharesListViewItem *item = static_cast( m_widget->firstChild() ); + item; item = static_cast( item->nextSibling() ) ) + { + if ( QString::compare( item->shareObject()->path(), (*it)->path() ) == 0 || + QString::compare( item->shareObject()->canonicalPath(), (*it)->canonicalPath() ) == 0 ) + { + // Replace the share object if something changed: + if ( !item->sameShareObject( *it ) ) + { + item->replaceShareObject( *it ); + } + + already_in_view = true; + + break; + } + else + { + continue; + } + } + + if ( !already_in_view ) + { + if ( !Smb4KSettings::showAllShares() && (*it)->isForeign() ) + { + // If the user does not want to have foreign shares + // displayed continue. + continue; + } + else + { + // Put the new item into the list view: + (void) new Smb4KSharesListViewItem( *it, Smb4KSettings::showMountPoint(), m_widget ); + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } + + continue; + } + } + + already_in_view = false; + } + + m_widget->sort(); + } + else + { + if ( m_widget->childCount() != 0 ) + { + m_widget->clear(); + + // Adjust the columns: + for ( int col = 0; col < m_widget->columns(); col++ ) + { + if ( m_widget->columnWidth( col ) != 0 ) + { + m_widget->adjustColumn( col ); + } + } + } + } + + // Update the tool tip, if it exists: + if ( m_widget->childCount() != 0 ) + { + m_widget->updateToolTip(); + } + + // Enable/disable the actions: + QListViewItem *item = m_widget->currentItem(); + bool have_selected_item = (item && item->isSelected()); + + actionCollection()->action( "unmount_action" )->setEnabled( have_selected_item ); +#ifdef __linux__ + if ( Smb4KSettings::useForceUnmount() ) + { + actionCollection()->action( "force_unmount_action" )->setEnabled( have_selected_item ); + } + else + { + actionCollection()->action( "force_unmount_action" )->setEnabled( false ); + } +#endif + actionCollection()->action( "unmount_all_action" )->setEnabled( (m_widget->childCount() > 0) ); + actionCollection()->action( "konsole_action" )->setEnabled( !Smb4KSettings::konsole().isEmpty() && have_selected_item ); + actionCollection()->action( "filemanager_action" )->setEnabled( have_selected_item ); + actionCollection()->action( "synchronize_action" )->setEnabled( !Smb4KSettings::rsync().isEmpty() && + !Smb4KCore::synchronizer()->isRunning() && + have_selected_item ); +} + + +void Smb4KSharesListViewPart::slotUnmountShare() +{ + Smb4KSharesListViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item ) + { + Smb4KCore::mounter()->unmountShare( item->shareObject(), false ); + } +} + + +void Smb4KSharesListViewPart::slotForceUnmountShare() +{ + Smb4KSharesListViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item ) + { + Smb4KCore::mounter()->unmountShare( item->shareObject(), true ); + } +} + + +void Smb4KSharesListViewPart::slotUnmountAllShares() +{ + Smb4KCore::mounter()->unmountAllShares(); +} + + +void Smb4KSharesListViewPart::slotSynchronize() +{ + Smb4KSharesListViewItem *item = static_cast( m_widget->currentItem() ); + Smb4KSynchronizationDialog *dlg = static_cast( m_widget->child( "SynchronizationDialog", "Smb4KSynchronizationDialog", true ) ); + + if ( item && !item->shareObject()->isBroken() && !dlg ) + { + dlg = new Smb4KSynchronizationDialog( item->shareObject(), m_widget, "SynchronizationDialog" ); + + dlg->show(); + } +} + +void Smb4KSharesListViewPart::slotKonsole() +{ + Smb4KSharesListViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item && !item->shareObject()->isBroken() ) + { + Smb4KCore::open( item->shareObject(), Smb4KCore::Konsole ); + } +} + + +void Smb4KSharesListViewPart::slotFilemanager() +{ + Smb4KSharesListViewItem *item = static_cast( m_widget->currentItem() ); + + if ( item && !item->shareObject()->isBroken() ) + { + Smb4KCore::open( item->shareObject(), Smb4KCore::Konqueror ); + } +} + + +void Smb4KSharesListViewPart::slotSynchronizationState( int state ) +{ + switch ( state ) + { + case SYNCHRONIZER_START: + { + actionCollection()->action( "synchronize_action" )->setEnabled( false ); + + break; + } + case SYNCHRONIZER_STOP: + { + actionCollection()->action( "synchronize_action" )->setEnabled( true ); + + break; + } + default: + { + break; + } + } +} + + + +///////////////////////////////////////////////////////////////////////////// +// FACTORY STUFF +///////////////////////////////////////////////////////////////////////////// + +Smb4KSharesListViewPartFactory::Smb4KSharesListViewPartFactory() +: KParts::Factory() +{ +} + + +Smb4KSharesListViewPartFactory::~Smb4KSharesListViewPartFactory() +{ + delete m_instance; + delete m_about; + + m_instance = 0L; +} + + +KParts::Part *Smb4KSharesListViewPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, +QObject *parent, const char *name, const char *, const QStringList & ) +{ + Smb4KSharesListViewPart *obj = new Smb4KSharesListViewPart( parentWidget, widgetName, parent, name ); + + // See if we are to be read-write or not +// if (QCString(classname) == "KParts::ReadOnlyPart") +// { +// obj->setReadWrite(false); +// } + + return obj; +} + + +KInstance *Smb4KSharesListViewPartFactory::instance() +{ + if( !m_instance ) + { + m_about = new KAboutData( "smb4kshareslistviewpart", I18N_NOOP( "Smb4KSharesListViewPart" ), "1.0" ); + m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de"); + m_about->setLicense( KAboutData::License_GPL ); + m_instance = new KInstance( m_about ); + } + + return m_instance; +} + + +///////////////////////////////////////////////////////////////////////////// +// INIT +///////////////////////////////////////////////////////////////////////////// + +extern "C" +{ + void *init_libsmb4kshareslistview() + { + KGlobal::locale()->insertCatalogue( "smb4k" ); + return new Smb4KSharesListViewPartFactory; + } +} + + +#include "smb4kshareslistview_part.moc" diff --git a/smb4k/listview/smb4kshareslistview_part.h b/smb4k/listview/smb4kshareslistview_part.h new file mode 100644 index 0000000..858193e --- /dev/null +++ b/smb4k/listview/smb4kshareslistview_part.h @@ -0,0 +1,234 @@ +/*************************************************************************** + smb4kshareslistview_part -This Part includes the shares list view + of Smb4K. + ------------------- + begin : Sa Jun 30 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESLISTVIEW_PART_H +#define SMB4KSHARESLISTVIEW_PART_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +// applications specific includes +#include "smb4kshareslistview.h" + +/** + * This is one of the parts of Smb4K. It contains the shares list + * view. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesListViewPart : public KParts::Part +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parentWidget The parent widget + * + * @param widgetName The name the widget should have + * + * @param parent The parent object + * + * @param name The name this object should have + */ + Smb4KSharesListViewPart( QWidget *parentWidget = 0, const char *widgetName = 0, + QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + virtual ~Smb4KSharesListViewPart(); + + protected: + /** + * Reimplemented from KParts::Part. + */ + void customEvent( QCustomEvent *e ); + + protected slots: + /** + * Opens a context menu over the list view item @p item at position + * @p pos if requested. + * + * @param item The list view item or NULL if the user clicked + * somewhere else. + * + * @param pos The position where the user clicked. + * + * @param col The column where the context menu should be show. + */ + void slotContextMenuRequested( QListViewItem *item, const QPoint & pos, int col ); + + /** + * This slot is called when the selection in the list view changed. It + * enables or disables the actions according to known options/states. + * Please note that it won't be invoked when the user clicked on the + * viewport. Use slotMouseButtonPressed() to also catch that event. + * + * @param item The list view item that was selected + */ + void slotSelectionChanged( QListViewItem *item ); + + /** + * This slot is called when the user presses any mouse button somewhere + * in the list view. It enables or disables the actions according to known + * options/states. + * + * @param item The icon view item that was clicked or NULL if the + * user clicked onto the viewport. + */ + void slotMouseButtonPressed( QListViewItem *item ); + + /** + * This slot is called by the Smb4KMounter::updated() signal and updates + * the list view according to the list that is returned by Smb4KMounter::getShares(). + */ + void slotMountedShares(); + + /** + * This slot is connected to the 'Unmount action'. You will be able to + * unmount a certain share when activating this slot. + */ + void slotUnmountShare(); + + /** + * This slot is connected to the 'Force Unmounting' action and is, thus, + * only useful under Linux, because only there the possibility for a forced + * (i.e. lazy) unmount exists. + * + * When activating this slot, the selected share will be unmounted, even if + * it is not accessible or the server already went offline. + */ + void slotForceUnmountShare(); + + /** + * This slot is connected to the 'Unmount All' action. All shares - either of + * the user or that are present on the system (depending on the settings the + * user chose) - will be unmounted. Please note that Smb4KMounter::unmountAllShares() + * is invoked directly. + */ + void slotUnmountAllShares(); + + /** + * This slot is connected to the 'Synchronize' action. The current item will be + * synchronized with a local copy (or vice versa) if you activate it. + */ + void slotSynchronize(); + + /** + * This slot is connected to the 'Konsole' action. The mount point of the current + * share item will be opened in Konsole. + */ + void slotKonsole(); + + /** + * This slot is connected to the 'Konqueror' action. The contents of the current + * share item will be opened in the file manager. + */ + void slotFilemanager(); + + /** + * This slot is called by the synchronizer whenever the state of the synchronization + * process changed. + * + * @param state The state the synchronizer is in. + */ + void slotSynchronizationState( int state ); + + private: + /** + * Set up the actions + */ + void setupActions(); + + /** + * Load settings for the widget or the actions. + */ + void loadSettings(); + + /** + * The icon view. + */ + Smb4KSharesListView *m_widget; + + /** + * The action menu. + */ + KActionMenu *m_menu; +}; + + +class KInstance; +class KAboutData; + +class Smb4KSharesListViewPartFactory : public KParts::Factory +{ + Q_OBJECT + + public: + /** + * The constructor + */ + Smb4KSharesListViewPartFactory(); + + /** + * The destructor + */ + virtual ~Smb4KSharesListViewPartFactory(); + + /** + * Reimplemented from KParts::Factory + */ + virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ); + + /** + * The instance + */ + static KInstance *instance(); + + private: + /** + * The factory's instance. + */ + static KInstance *m_instance; + + /** + * The factory's KAboutData object + */ + static KAboutData *m_about; +}; + + +#endif diff --git a/smb4k/listview/smb4kshareslistview_part.rc b/smb4k/listview/smb4kshareslistview_part.rc new file mode 100644 index 0000000..a030146 --- /dev/null +++ b/smb4k/listview/smb4kshareslistview_part.rc @@ -0,0 +1,25 @@ + + + + &Shares + + + + + + + + + + + + + + + + + + + + + diff --git a/smb4k/listview/smb4kshareslistviewitem.cpp b/smb4k/listview/smb4kshareslistviewitem.cpp new file mode 100644 index 0000000..327f9fb --- /dev/null +++ b/smb4k/listview/smb4kshareslistviewitem.cpp @@ -0,0 +1,353 @@ +/*************************************************************************** + smb4kshareslistviewitem - The shares list view item class of Smb4K. + ------------------- + begin : Sa Jun 30 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4kshareslistviewitem.h" +#include "smb4kshareslistview.h" + + +Smb4KSharesListViewItem::Smb4KSharesListViewItem( Smb4KShare *share, bool mountpoint, + Smb4KSharesListView *parent ) +: KListViewItem( parent ), m_share( *share ), m_mountpoint( mountpoint ), + m_initial_setup( true ) +{ + setDropEnabled( true ); + setDragEnabled( true ); + + m_loader = new KIconLoader(); + + setupItem( m_share, m_mountpoint ); +} + + +Smb4KSharesListViewItem::~Smb4KSharesListViewItem() +{ + // Do not touch the Smb4KShare object! + delete m_loader; +} + + +void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoint ) +{ + // Only do something here if either the item hasn't been set up + // yet, or share and mountpoint changed, respectively. + if ( m_initial_setup || !m_share.equals( share ) || m_mountpoint != mountpoint ) + { + if ( m_initial_setup || m_share.isBroken() != share.isBroken() ) + { + QPixmap pix; + + int icon_state = m_share.isForeign() ? KIcon::DisabledState : KIcon::DefaultState; + + if ( m_share.isBroken() ) + { + QImage over = m_loader->loadIcon( "button_cancel", KIcon::Small, + 0, icon_state, 0L, false ).convertToImage(); + QImage src = m_loader->loadIcon( "hdd_mount", KIcon::Small, + 0, icon_state, 0L, false ).convertToImage(); + + QImage over_desk = m_loader->loadIcon( "button_cancel", KIcon::Desktop, + 0, icon_state, 0L, false ).convertToImage(); + QImage src_desk = m_loader->loadIcon( "hdd_mount", KIcon::Desktop, + 0, icon_state, 0L, false ).convertToImage(); + + KIconEffect e; + e.semiTransparent( over ); + e.overlay( src, over ); + e.semiTransparent( over_desk ); + e.overlay( src_desk, over_desk ); + + pix = QPixmap( src ); + m_desktop_pixmap = QPixmap( src_desk ); + } + else + { + pix = m_loader->loadIcon( "hdd_mount", KIcon::Small, + 0, icon_state, 0L, false ); + + m_desktop_pixmap = m_loader->loadIcon( "hdd_mount", KIcon::Desktop, + 0, icon_state, 0L, false ); + } + + setPixmap( Item, pix ); + } + else + { + // Do nothing + } + + if ( !m_initial_setup ) + { + if ( m_mountpoint != mountpoint ) + { + setText( Item, (m_mountpoint ? m_share.path() : m_share.name()) ); + } + + // The file system, owner and login won't change + + QString total, free, used, total_dim, free_dim, used_dim; + + if ( shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace() > 1024 ) + { + double tmp_used = (shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace()) / 1024; + used_dim = "MB"; + + if ( tmp_used >= 1024 ) + { + tmp_used = tmp_used / 1024; + used_dim = "GB"; + } + + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + else + { + used_dim = "kB"; + double tmp_used = shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace(); + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + + if ( shareObject()->freeDiskSpace() >= 1024 ) + { + double tmp_free = shareObject()->freeDiskSpace() / 1024; + free_dim = "MB"; + + if ( tmp_free >= 1024 ) + { + tmp_free = tmp_free / 1024; + free_dim = "GB"; + } + + free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 ); + } + else + { + free_dim = "kB"; + free = QString( "%1" ).arg( shareObject()->freeDiskSpace(), 0, 'f', 1 ); + } + + if ( shareObject()->totalDiskSpace() >= 1024 ) + { + double tmp_total = shareObject()->totalDiskSpace() / 1024; + total_dim = "MB"; + + if ( tmp_total >= 1024 ) + { + tmp_total = tmp_total / 1024; + total_dim = "GB"; + } + + total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 ); + } + else + { + total_dim = "kB"; + total = QString( "%1" ).arg( shareObject()->totalDiskSpace(), 0, 'f', 1 ); + } + + setText( Free, QString( "%1 %2" ).arg( free, free_dim ) ); + setText( Used, QString( "%1 %2" ).arg( used, used_dim ) ); + setText( Total, QString( "%1 %2" ).arg( total, total_dim ) ); + } + else + { + setText( Item, (m_mountpoint ? m_share.path() : m_share.name()) ); + + setText( Owner, QString::compare( m_share.filesystem(), "smbfs" ) == 0 ? + QString( "%1 - %2" ).arg( m_share.user() ).arg( m_share.group() ) : + QString::null ); +#ifndef __FreeBSD__ + setText( Login, QString::compare( m_share.filesystem(), "cifs" ) == 0 ? + m_share.cifsLogin() : + QString::null ); +#endif + setText( FileSystem, m_share.filesystem().upper() ); + + QString total, free, used, total_dim, free_dim, used_dim; + + if ( shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace() > 1024 ) + { + double tmp_used = (shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace()) / 1024; + used_dim = "MB"; + + if ( tmp_used >= 1024 ) + { + tmp_used = tmp_used / 1024; + used_dim = "GB"; + } + + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + else + { + used_dim = "kB"; + double tmp_used = shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace(); + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + + if ( shareObject()->freeDiskSpace() >= 1024 ) + { + double tmp_free = shareObject()->freeDiskSpace() / 1024; + free_dim = "MB"; + + if ( tmp_free >= 1024 ) + { + tmp_free = tmp_free / 1024; + free_dim = "GB"; + } + + free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 ); + } + else + { + free_dim = "kB"; + free = QString( "%1" ).arg( shareObject()->freeDiskSpace(), 0, 'f', 1 ); + } + + if ( shareObject()->totalDiskSpace() >= 1024 ) + { + double tmp_total = shareObject()->totalDiskSpace() / 1024; + total_dim = "MB"; + + if ( tmp_total >= 1024 ) + { + tmp_total = tmp_total / 1024; + total_dim = "GB"; + } + + total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 ); + } + else + { + total_dim = "kB"; + total = QString( "%1" ).arg( shareObject()->totalDiskSpace(), 0, 'f', 1 ); + } + + setText( Free, QString( "%1 %2" ).arg( free, free_dim ) ); + setText( Used, QString( "%1 %2" ).arg( used, used_dim ) ); + setText( Total, QString( "%1 %2" ).arg( total, total_dim ) ); + } + + m_initial_setup = false; + m_share = share; + m_mountpoint = mountpoint; + } + else + { + // Do nothing + } +} + + +bool Smb4KSharesListViewItem::sameShareObject( Smb4KShare *share ) +{ + return m_share.equals( *share ); +} + + +void Smb4KSharesListViewItem::replaceShareObject( Smb4KShare *share ) +{ + setupItem( *share, m_mountpoint ); +} + + +void Smb4KSharesListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int col, int width, int align ) +{ + // Set the color of the item text: + QColorGroup colorgrp( cg ); + + if ( m_share.isForeign() ) + { + colorgrp.setColor( QColorGroup::Text, Qt::gray ); + } + + if ( col != Usage ) + { + KListViewItem::paintCell( p, colorgrp, col, width, align ); + + return; + } + + // Draw the usage: + // This code was inspired by KAudioCreator. + p->setPen( colorgrp.base() ); + p->drawRect( 0, 0, width, height() ); + + if ( isSelected() ) + { + p->fillRect( 1, 1, width-2, height()-2, colorgrp.highlight() ); + } + else + { + p->fillRect( 1, 1, width-2, height()-2, colorgrp.base() ); + } + + if ( !m_share.isBroken() ) + { + int percent = (int)(((double)(width-2)) * (m_share.percentage()/100)); + + p->fillRect( 1, 1, percent, height()-2, !m_share.isForeign() ? Qt::red : Qt::red.light( 175 ) ); + p->fillRect( percent+1, 1, width-percent-2, height()-2, !m_share.isForeign() ? Qt::green : Qt::green.light( 175 ) ); + + p->setPen( !m_share.isForeign() ? colorgrp.foreground() : Qt::gray ); + p->drawRect( 1, 1, width-2, height()-2 ); + + // Show the text: + p->setPen( colorgrp.text() ); + + // if ( isSelected() ) + // { + // p->setPen( colorgrp.highlightedText() ); + // } + + p->drawText( 0, 0, width-1, height()-1, Qt::AlignCenter, QString( "%1 \%" ).arg( m_share.percentage(), 0, 'f', 1 ) ); + } + else + { + p->fillRect( 1, 1, width-2, height()-2, colorgrp.base() ); + + p->setPen( !m_share.isForeign() ? colorgrp.foreground() : Qt::gray ); + p->drawRect( 1, 1, width-2, height()-2 ); + } +} + + +bool Smb4KSharesListViewItem::acceptDrop( const QMimeSource *source ) const +{ + if ( source->provides( "text/plain" ) ) + { + return true; + } + + return false; +} diff --git a/smb4k/listview/smb4kshareslistviewitem.h b/smb4k/listview/smb4kshareslistviewitem.h new file mode 100644 index 0000000..4b5ddc3 --- /dev/null +++ b/smb4k/listview/smb4kshareslistviewitem.h @@ -0,0 +1,203 @@ +/*************************************************************************** + smb4kshareslistviewitem - The shares list view item class of Smb4K. + ------------------- + begin : Sa Jun 30 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESLISTVIEWITEM_H +#define SMB4KSHARESLISTVIEWITEM_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include +#include + +// application specific includes +#include "../core/smb4kshare.h" + +// forward declarations +class Smb4KSharesListView; + +/** + * This class provides the items for the shares icon view + * of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesListViewItem : public KListViewItem +{ + public: + /** + * The constructor. + * + * @param share The Smb4KShare object that represents the share. + * + * @param mountpoint Tells the item if the mount point instead of the + * share name should be shown. Default is FALSE. + * + * @param parent The parent widget of this item. + */ + Smb4KSharesListViewItem( Smb4KShare *share, + bool mountpoint = false, + Smb4KSharesListView *parent = 0 ); + + /** + * The destructor + */ + ~Smb4KSharesListViewItem(); + + /** + * This function compares the encapsulated Smb4KShare object with @p item + * and returns TRUE if they contain equal values. + * + * @param item A Smb4KShare object that should be compared + * + * @returns TRUE if @p item has the same values stored as the + * encapsulated Smb4KShare object. + */ + bool sameShareObject( Smb4KShare *share ); + + /** + * Replace the encapsulated Smb4KShare object. This function just passes + * the share object to setupItem() which does all the work. + * + * @param share The new Smb4KShare object + */ + void replaceShareObject( Smb4KShare *share ); + + /** + * Returns a pointer to the share object that's represented by this item. + * You have to use it to access its data. + * + * @returns a pointer to a Smb4KShare object. + */ + Smb4KShare *shareObject() { return &m_share; } + + /** + * Enumeration for the columns. + */ +#ifndef __FreeBSD__ + enum Columns { Item = 0, + Owner = 1, + Login = 2, + FileSystem = 3, + Free = 4, + Used = 5, + Total = 6, + Usage = 7 }; +#else + enum Columns { Item = 0, + Owner = 1, + FileSystem = 2, + Free = 3, + Used = 4, + Total = 5, + Usage = 6 }; +#endif + + /** + * This function returns the desktop pixmap of this item. + * + * @returns the destop pixmap of this item. + */ + const QPixmap &desktopPixmap() { return m_desktop_pixmap; } + + protected: + /** + * Reimplemented from KListViewItem. + * + * This function paints the icon text and the usage. It uses Smb4KShare::isForeign() to + * determine the color of the icon text (TRUE: gray, FALSE: the default color). + * + * @param p The painter + * + * @param cg The color group + * + * @param column The column of the list view + * + * @param width The width of the area that will be painted. + * + * @param alignment The alignment of the column that will be used. + */ + void paintCell( QPainter *p, + const QColorGroup &cg, + int column, + int width, + int alignment ); + + /** + * Reimplemented from KListViewItem. + * + * This function accepts or denies drops according to the contents of @p source. + * + * @param source The mime source + */ + bool acceptDrop( const QMimeSource *source ) const; + + private: + /** + * Set up the icon and text of the item with respect to @p share and @p mountpoint. + * + * @param share The Smb4KShare object. + * + * @param mountpoint If TRUE, the mount point will be shown instead of the + * share name. + */ + void setupItem( const Smb4KShare &share, + bool mountpoint = false ); + + /** + * The Smb4KShare object representing the share. + */ + Smb4KShare m_share; + + /** + * Tells us if the mount point instead of the share + * name should be shown. + */ + bool m_mountpoint; + + /** + * Tells us that the initial setup already happened. + */ + bool m_initial_setup; + + /** + * The icon loader for this item. + */ + KIconLoader *m_loader; + + /** + * The desktop pixmap + */ + QPixmap m_desktop_pixmap; +}; + +#endif diff --git a/smb4k/listview/smb4kshareslistviewtooltip.cpp b/smb4k/listview/smb4kshareslistviewtooltip.cpp new file mode 100644 index 0000000..110f412 --- /dev/null +++ b/smb4k/listview/smb4kshareslistviewtooltip.cpp @@ -0,0 +1,429 @@ +/*************************************************************************** + smb4kshareslistviewtooltip - Tool tip for the shares list view. + ------------------- + begin : So Jul 8 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE includes +#include +#include + +// application specific includes +#include "smb4kshareslistviewtooltip.h" +#include "smb4kshareslistviewitem.h" + + +Smb4KSharesListViewToolTip::Smb4KSharesListViewToolTip( Smb4KSharesListViewItem *item ) +: QLabel( 0, "SharesListViewToolTip", WStyle_StaysOnTop | WStyle_Customize | +WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item ) +{ + setPalette( QToolTip::palette() ); + setLineWidth( 1 ); + setMidLineWidth( 1 ); + setFrameShape( Box ); + setFrameShadow( Plain ); + setMouseTracking( true ); + + m_layout = new QGridLayout( this ); + m_layout->setMargin( 10 ); + m_layout->setSpacing( 3 ); + + m_is_set_up = false; + + m_free = NULL; + m_used = NULL; + m_total = NULL; + m_usage = NULL; + m_pixmap = NULL; + + // We will set up the tip in the showTip() function. +} + + +Smb4KSharesListViewToolTip::~Smb4KSharesListViewToolTip() +{ + // Never touch the Smb4KSharesListViewItem object here! +} + + +void Smb4KSharesListViewToolTip::showTip( const QPoint &pos ) +{ + if ( !m_item || isShown() ) + { + return; + } + + setupTip(); + + adjustSize(); + + QDesktopWidget *d = QApplication::desktop(); + QPoint p( pos ); + + if ( p.x() + width() > d->width() ) + { + p.setX( p.x() - width() - 5 ); + } + else + { + p.setX( p.x() + 5 ); + } + + if ( p.y() + height() > d->height() ) + { + p.setY( p.y() - height() - 5 ); + } + else + { + p.setY( p.y() + 5 ); + } + + setGeometry( p.x(), p.y(), width(), height() ); + polish(); + show(); + QTimer::singleShot( 10000, this, SLOT( slotHideToolTip() ) ); +} + + +void Smb4KSharesListViewToolTip::setupTip() +{ + if ( !m_item ) + { + return; + } + + m_layout->addWidget( new QLabel( i18n( "Share:" ), this ), 0, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->name(), this ), 0, 2, 0 ); + m_layout->addWidget( new QLabel( i18n( "Mount point:" ), this ), 1, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->path(), this ), 1, 2, 0 ); + + if ( QString::compare( m_item->shareObject()->filesystem(), "smbfs" ) == 0 ) + { + m_layout->addWidget( new QLabel( "Owner:", this ), 2, 1, 0 ); + m_layout->addWidget( new QLabel( QString( "%1 - %2" ).arg( m_item->shareObject()->user(), m_item->shareObject()->group() ), this ), 2, 2, 0 ); + } + else + { + m_layout->addWidget( new QLabel( "Login:", this ), 2, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->cifsLogin(), this ), 2, 2, 0 ); + } + + m_layout->addWidget( new QLabel( i18n( "File system:" ), this ), 3, 1, 0 ); + m_layout->addWidget( new QLabel( m_item->shareObject()->filesystem().upper(), this ), 3, 2, 0 ); + + QFrame *line = new QFrame( this ); + line->setLineWidth( 1 ); + line->setMidLineWidth( 0 ); + line->setFixedWidth( 100 ); + line->setFrameShape( QFrame::HLine ); + line->setFrameShadow( QFrame::Plain ); + + m_layout->addMultiCellWidget( line, 4, 4, 1, 2, Qt::AlignCenter ); + + // Prepare the disk usage stuff. + if ( !m_item->shareObject()->isBroken() ) + { + QString total, free, used, total_dim, free_dim, used_dim; + + if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 ) + { + double tmp_used = (m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace()) / 1024; + used_dim = "MB"; + + if ( tmp_used >= 1024 ) + { + tmp_used = tmp_used / 1024; + used_dim = "GB"; + } + + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + else + { + used_dim = "kB"; + double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace(); + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + + if ( m_item->shareObject()->freeDiskSpace() >= 1024 ) + { + double tmp_free = m_item->shareObject()->freeDiskSpace() / 1024; + free_dim = "MB"; + + if ( tmp_free >= 1024 ) + { + tmp_free = tmp_free / 1024; + free_dim = "GB"; + } + + free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 ); + } + else + { + free_dim = "kB"; + free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 ); + } + + if ( m_item->shareObject()->totalDiskSpace() >= 1024 ) + { + double tmp_total = m_item->shareObject()->totalDiskSpace() / 1024; + total_dim = "MB"; + + if ( tmp_total >= 1024 ) + { + tmp_total = tmp_total / 1024; + total_dim = "GB"; + } + + total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 ); + } + else + { + total_dim = "kB"; + total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 ); + } + + m_layout->addWidget( new QLabel( i18n( "Free:" ), this, "FreeLabel" ), 5, 1, 0 ); + m_free = new QLabel( QString( "%1 %2" ).arg( free, free_dim ), this ); + m_layout->addWidget( m_free, 5, 2, 0 ); + + m_layout->addWidget( new QLabel( i18n( "Used:" ), this, "UsedLabel" ), 6, 1, 0 ); + m_used = new QLabel( QString( "%1 %2" ).arg( used, used_dim ), this ); + m_layout->addWidget( m_used, 6, 2, 0 ); + + m_layout->addWidget( new QLabel( i18n( "Total:" ), this, "TotalLabel" ), 7, 1, 0 ); + m_total = new QLabel( QString( "%1 %2" ).arg( total, total_dim ), this ); + m_layout->addWidget( m_total, 7, 2, 0 ); + + m_layout->addWidget( new QLabel( i18n( "Usage:" ), this, "UsageLabel" ), 8, 1, 0 ); + m_usage = new QLabel( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ), this ); + m_layout->addWidget( m_usage, 8, 2, 0 ); + } + else + { + QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this ); + + QFont font; + font.setItalic( true ); + + error->setFont( font ); + + m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter ); + } + + m_pixmap = new QLabel( this ); + m_pixmap->setPixmap( m_item->desktopPixmap() ); + + m_layout->addMultiCellWidget( m_pixmap, 0, m_layout->numRows(), 0, 0, Qt::AlignCenter ); + + m_is_set_up = true; +} + + +void Smb4KSharesListViewToolTip::update() +{ + if ( !m_is_set_up ) + { + return; + } + + // Only change the variable entries: + if ( !m_item->shareObject()->isBroken() ) + { + QString total, free, used, total_dim, free_dim, used_dim; + + if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 ) + { + double tmp_used = (m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace()) / 1024; + used_dim = "MB"; + + if ( tmp_used >= 1024 ) + { + tmp_used = tmp_used / 1024; + used_dim = "GB"; + } + + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + else + { + used_dim = "kB"; + double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace(); + used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 ); + } + + if ( m_item->shareObject()->freeDiskSpace() >= 1024 ) + { + double tmp_free = m_item->shareObject()->freeDiskSpace() / 1024; + free_dim = "MB"; + + if ( tmp_free >= 1024 ) + { + tmp_free = tmp_free / 1024; + free_dim = "GB"; + } + + free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 ); + } + else + { + free_dim = "kB"; + free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 ); + } + + if ( m_item->shareObject()->totalDiskSpace() >= 1024 ) + { + double tmp_total = m_item->shareObject()->totalDiskSpace() / 1024; + total_dim = "MB"; + + if ( tmp_total >= 1024 ) + { + tmp_total = tmp_total / 1024; + total_dim = "GB"; + } + + total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 ); + } + else + { + total_dim = "kB"; + total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 ); + } + + m_free->setText( QString( "%1 %2" ).arg( free, free_dim ) ); + m_used->setText( QString( "%1 %2" ).arg( used, used_dim ) ); + m_total->setText( QString( "%1 %2" ).arg( total, total_dim ) ); + m_usage->setText( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ) ); + } + else + { + QLabel *free_label = static_cast( child( "FreeLabel", "QLabel" ) ); + + if ( free_label ) + { + m_layout->remove( free_label ); + delete free_label; + } + + if ( m_free ) + { + m_layout->remove( m_free ); + delete m_free; + m_free = NULL; + } + + QLabel *used_label = static_cast( child( "UsedLabel", "QLabel" ) ); + + if ( used_label ) + { + m_layout->remove( used_label ); + delete used_label; + } + + if ( m_used ) + { + m_layout->remove( m_used ); + delete m_used; + m_used = NULL; + } + + QLabel *total_label = static_cast( child( "TotalLabel", "QLabel" ) ); + + if ( total_label ) + { + m_layout->remove( total_label ); + delete total_label; + } + + if ( m_total ) + { + m_layout->remove( m_total ); + delete m_total; + m_total = NULL; + } + + QLabel *usage_label = static_cast( child( "UsageLabel", "QLabel" ) ); + + if ( usage_label ) + { + m_layout->remove( usage_label ); + delete usage_label; + } + + if ( m_usage ) + { + m_layout->remove( m_usage ); + delete m_usage; + m_usage = NULL; + } + + QFont font; + font.setItalic( true ); + + QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this ); + error->setFont( font ); + error->show(); + + m_layout->remove( m_pixmap ); + m_pixmap->setPixmap( m_item->desktopPixmap() ); + + m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter ); + m_layout->addMultiCellWidget( m_pixmap, 0, 5, 0, 0, Qt::AlignCenter ); + } + + adjustSize(); +} + + +void Smb4KSharesListViewToolTip::mousePressEvent( QMouseEvent *e ) +{ + hide(); + QLabel::mousePressEvent( e ); +} + + +void Smb4KSharesListViewToolTip::leaveEvent( QEvent *e ) +{ + hide(); + QLabel::leaveEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSharesListViewToolTip::slotHideToolTip() +{ + if ( isShown() ) + { + hide(); + } +} + +#include "smb4kshareslistviewtooltip.moc" diff --git a/smb4k/listview/smb4kshareslistviewtooltip.h b/smb4k/listview/smb4kshareslistviewtooltip.h new file mode 100644 index 0000000..d15a68e --- /dev/null +++ b/smb4k/listview/smb4kshareslistviewtooltip.h @@ -0,0 +1,160 @@ +/*************************************************************************** + smb4kshareslistviewtooltip - Tool tip for the shares list view. + ------------------- + begin : So Jul 8 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSHARESLISTVIEWTOOLTIP_H +#define SMB4KSHARESLISTVIEWTOOLTIP_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include +#include + +// Forward declarations: +class Smb4KSharesListViewItem; + +/** + * This class provides the tool tip for the shares list view + * of Smb4K. It shows information about the associated share. + * + * @author Alexander Reinholdt + */ + +class Smb4KSharesListViewToolTip : public QLabel +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * Please note that the parent of the tool tip will be '0' and + * not the parent widget of @p item. Thus, you have to delete the + * tool tip object in the destructor of the parent widget. + * + * @param item The item for which the tool tip should be shown. + */ + Smb4KSharesListViewToolTip( Smb4KSharesListViewItem *item ); + + /** + * The destructor + */ + ~Smb4KSharesListViewToolTip(); + + /** + * Show the tool tip. Please note that the tool tip will not be + * shown exactly at position @p pos but with a displacement of 5 + * pixels in x- and y-direction. + * + * @param pos The global position of the mouse pointer. + */ + void showTip( const QPoint &pos ); + + /** + * The shares list view item for which the tool tip should be shown. + * + * @returns a pointer to a Smb4KSharesListViewItem object. + */ + Smb4KSharesListViewItem *item() { return m_item; } + + /** + * Update the tool tip by rereading the contents of the shareObject() + * provided by the Smb4KSharesListViewItem. This function only changes + * those entries that might have changed such as the free and used disk + * space and the usage. + */ + void update(); + + protected: + /** + * Reimplemented from QLabel. + */ + void mousePressEvent( QMouseEvent *e ); + + /** + * Reimplemented from QLabel. + */ + void leaveEvent( QEvent *e ); + + protected slots: + /** + * This slot hides the tool tip after 10 sec. + */ + void slotHideToolTip(); + + private: + /** + * The item for which the tool tip should be shown + */ + Smb4KSharesListViewItem *m_item; + + /** + * The layout of the tool tip. + */ + QGridLayout *m_layout; + + /** + * This function sets up the tool tip. + */ + void setupTip(); + + /** + * Tells us if the tool tip has already been set up. + */ + bool m_is_set_up; + + /** + * This label holds the variable value of the free + * space left on the share. + */ + QLabel *m_free; + + /** + * This label holds the variable value of the used + * space on the share. + */ + QLabel *m_used; + + /** + * This label holds the value of the total space + * available on the share. + */ + QLabel *m_total; + + /** + * This label holds the variable value of the usage + */ + QLabel *m_usage; + + /** + * This label holds the pixmap. + */ + QLabel *m_pixmap; +}; + +#endif diff --git a/smb4k/main.cpp b/smb4k/main.cpp new file mode 100644 index 0000000..e3907a6 --- /dev/null +++ b/smb4k/main.cpp @@ -0,0 +1,161 @@ +/*************************************************************************** + main.cpp - Main file of the Smb4K program. + ------------------- + begin : Sam M� 1 14:57:21 CET 2003 + copyright : (C) 2003 by Alexander Reinholdt + email : dustpuppy@mail.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// system includes +#include + +// application specific includes +#include "smb4k.h" +#include "core/smb4ksettings.h" +#include "core/smb4kcore.h" + + +static const char *description = + I18N_NOOP( "Smb4K is an advanced network neighborhood browser and a\n" + "front end to the programs of the Samba software suite." ); + +static KCmdLineOptions options[] = +{ +// { "+[File]", I18N_NOOP("file to open"), 0 }, + { 0, 0, 0 } + // INSERT YOUR COMMANDLINE OPTIONS HERE +}; + + +int main( int argc, char *argv[] ) +{ + KAboutData aboutData( "smb4k", I18N_NOOP( "Smb4K" ), + VERSION, description, KAboutData::License_GPL, + I18N_NOOP( "(c) 2003-2008, Alexander Reinholdt\n(c) 2004-2008, Massimo Callegari\n(c) 2004, Franck Babin" ), 0, "http://smb4k.berlios.de", "smb4k-bugs@lists.berlios.de" ); + + // Authors: + aboutData.addAuthor( "Alexander Reinholdt", I18N_NOOP( "Developer" ), "dustpuppy@users.berlios.de" ); + aboutData.addAuthor( "Massimo Callegari", I18N_NOOP( "Developer" ), "massimocallegari@yahoo.it" ); + aboutData.addAuthor( "Franck Babin", I18N_NOOP( "Developer" ), "babinfranck@yahoo.ca" ); + + // All our credits: + aboutData.addCredit( "Leopold Palomo Avellaneda", I18N_NOOP( "Catalan translation" ), "lepalom@wol.es" ); + aboutData.addCredit( "Radoslaw Zawartko", I18N_NOOP( "Polish translation" ), "radzaw@lnet.szn.pl" ); + aboutData.addCredit( "Nick Chen", I18N_NOOP( "Chinese Simplified translation" ), "nick_chen75@hotmail.com" ); + aboutData.addCredit( "Stanislav Yudin", I18N_NOOP( "Russian translation" ), "decvar@mail.berlios.de" ); + aboutData.addCredit( "Marc Hansen", I18N_NOOP( "Swedish translation and intensive testing" ), "marc.hansen@gmx.de" ); + aboutData.addCredit( "Giovanni Degani", I18N_NOOP( "Brazilian Portuguese translation" ), "tiefox@terra.com.br" ); + aboutData.addCredit( "Ivan Petrouchtchak", I18N_NOOP( "Ukrainian translation" ), "iip@telus.net" ); + aboutData.addCredit( "Karoly Barcza", I18N_NOOP( "Hungarian translation" ), "kbarcza@blackpanther.hu" ); + aboutData.addCredit( "Quique", I18N_NOOP( "Spanish translation" ), "quique@sindominio.net" ); + aboutData.addCredit( "Michal Šulek", I18N_NOOP( "Slovak translation" ), "reloadshot@atlas.sk" ); + aboutData.addCredit( "Nicolas Ternisien", I18N_NOOP( "French translation" ), "nicolast@libertysurf.fr" ); + aboutData.addCredit( "Toyohiro Asukai", I18N_NOOP( "Japanese translation" ), "toyohiro@ksmplus.com" ); + aboutData.addCredit( "Atanas Mavrov", I18N_NOOP( "Bulgarian translation" ), "bugar@developer.bg" ); + aboutData.addCredit( "Isidoro Russo", I18N_NOOP( "Italian translation" ), "risidoro@aliceposta.it" ); + aboutData.addCredit( "Nils Kristian Tomren", I18N_NOOP( "Norwegian translations" ), "project@nilsk.net" ); + aboutData.addCredit( "Alois Nešpor", I18N_NOOP( "Czech translation" ), "alois.nespor@seznam.cz" ); + aboutData.addCredit( "Martín Carr", I18N_NOOP( "Spanish translation" ), "tincarr@gmail.com" ); + aboutData.addCredit( "Görkem Çetin", I18N_NOOP( "Turkish translation" ), "gorkem@gorkemcetin.com" ); + aboutData.addCredit( "Jack Liu", I18N_NOOP( "Chinese Traditional translation" ), "chuany@chuany.net" ); + aboutData.addCredit( "Arnar Leósson", I18N_NOOP( "Icelandic translation" ), "leosson@frisurf.no" ); + aboutData.addCredit( "Michael Brinkloev", I18N_NOOP( "Danish translation" ), "mhb@qxp.dk" ); + aboutData.addCredit( "Joop Beris", I18N_NOOP( "Dutch translation" ), "jberis@risse.nl" ); + aboutData.addCredit( "Lamarque V. Souza", I18N_NOOP( "Brazilian Portuguese translation" ), "lamarque_souza@hotmail.com" ); + aboutData.addCredit( "Serdar Soytetir", I18N_NOOP( "Turkish translation" ), "sendirom@gmail.com" ); + aboutData.addCredit( "Wei-Lun Chao", I18N_NOOP( "Chinese Traditional translation" ), "chaoweilun@users.berlios.de" ); + aboutData.addCredit( "Rashid N. Achilov", I18N_NOOP( "Testing of Smb4K under FreeBSD" ), "shelton@sentry.granch.ru" ); + aboutData.addCredit( "Jerzy Trzeciak", I18N_NOOP( "Polish translation" ), "artusek@wp.pl" ); + + KCmdLineArgs::init( argc, argv, &aboutData ); + KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. + + KUniqueApplication::addCmdLineOptions(); + + // This is not needed, because KUniqueApplication::start() + // is called directly before the application is executed, but + // we use it anyway. There is no performance impact. + if ( !KUniqueApplication::start() ) + { + exit( 0 ); + } + + KUniqueApplication app; + + // Check the current config file and remove it if it belongs to + // a version < 0.9.0. + KConfig config( "smb4krc", false, false, "config" ); + + if ( !config.groupList().isEmpty() && + (config.groupList().contains( "Browse Options" ) != 0 || + config.groupList().contains( "Mount Options" ) != 0 || + config.groupList().contains( "Rsync" ) != 0 || + config.groupList().contains( "Super User Privileges") != 0 || + config.groupList().contains( "User Interface" ) != 0 || + config.groupList().contains( "System" ) != 0) ) + { + int return_value = KMessageBox::warningContinueCancel( 0, i18n( "Smb4K now uses a different configuration system. Thus, your old settings are obsolete and you have to reconfigure the application.\nTo assure a clean transition, the current configuration file will be removed." ) ); + + if ( return_value == KMessageBox::Continue ) + { + QString file_name = locateLocal( "config", "smb4krc", false ); + + if ( !file_name.isEmpty() && QFile::exists( file_name ) ) + { + QFile::remove( file_name ); + } + } + else + { + exit( 0 ); + } + } + + // Launch the application: + Smb4KApp *smb4k = new Smb4KApp( 0, "MainApp" ); + + app.setMainWidget( smb4k ); + + if ( !Smb4KSettings::embedIntoSystemTray() || !Smb4KSettings::startMainWindowDocked() ) + { + smb4k->show(); + } + + Smb4KCore::self()->init(); + + int result = app.exec(); + + return result; +} diff --git a/smb4k/searchdlg/Makefile.am b/smb4k/searchdlg/Makefile.am new file mode 100644 index 0000000..3045fab --- /dev/null +++ b/smb4k/searchdlg/Makefile.am @@ -0,0 +1,10 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO +kde_module_LTLIBRARIES = libsmb4ksearchdialog.la +libsmb4ksearchdialog_la_LIBADD = $(top_builddir)/smb4k/core/libsmb4kcore.la \ + $(LIB_KDECORE) $(LIB_KDEUI) $(KDE_PLUGIN) $(LIB_KPARTS) $(LIB_QT) +noinst_HEADERS = smb4ksearchdialog.h smb4ksearchdialog_part.h \ + smb4ksearchdialogitem.h +libsmb4ksearchdialog_la_SOURCES = smb4ksearchdialog.cpp \ + smb4ksearchdialog_part.cpp smb4ksearchdialogitem.cpp +libsmb4ksearchdialog_la_LDFLAGS = -module -no-undefined $(all_libraries) diff --git a/smb4k/searchdlg/smb4ksearchdialog.cpp b/smb4k/searchdlg/smb4ksearchdialog.cpp new file mode 100644 index 0000000..bce09bb --- /dev/null +++ b/smb4k/searchdlg/smb4ksearchdialog.cpp @@ -0,0 +1,200 @@ +/*************************************************************************** + smb4ksearchdialog - The search dialog widget of Smb4K. + ------------------- + begin : Sa Jun 2 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include + +// KDE includes +#include +#include +#include + +// application specific includes +#include "smb4ksearchdialog.h" +#include "smb4ksearchdialogitem.h" +#include "../core/smb4knetworkitems.h" + +Smb4KSearchDialog::Smb4KSearchDialog( QWidget *parent, const char *name ) +: QWidget( parent, name ) +{ + QGridLayout *layout = new QGridLayout( this ); + layout->setSpacing( 5 ); + + // Tool bar + m_tool_bar = new KToolBar( this, "SearchDialogToolBar", true, true ); + + m_tool_bar->insertCombo( QStringList(), Combo, true, SIGNAL( returnPressed() ), + this, SLOT( slotReturnPressed() ), true, + i18n( "Enter the search string here." ), -1, Combo ); + m_tool_bar->setItemAutoSized( Combo, true ); + + m_tool_bar->insertSeparator(); + + m_tool_bar->insertButton( "find", Search, false, i18n( "Search" ) ); + m_tool_bar->insertButton( "editdelete", Clear, false, i18n( "Clear" ) ); + m_tool_bar->insertButton( "button_ok", Add, false, i18n( "Add" ) ); + + // List view + m_list_view = new KListView( this, "SearchDialogListView" ); + m_list_view->addColumn( i18n( "Search Results" ), -1 ); + m_list_view->header()->hide(); + m_list_view->setSelectionMode( QListView::Single ); + + layout->addWidget( m_tool_bar, 0, 0, 0 ); + layout->addWidget( m_list_view, 1, 0, 0 ); + + m_search_string = QString::null; + + // Connections: + connect( m_tool_bar->getCombo( Combo ), SIGNAL( textChanged( const QString & ) ), + this, SLOT( slotTextChanged( const QString & ) ) ); + + connect( m_tool_bar, SIGNAL( pressed( int ) ), + this, SLOT( slotButtonPressed( int ) ) ); + + connect( m_list_view, SIGNAL( clicked( QListViewItem * ) ), + this, SLOT( slotItemClicked( QListViewItem * ) ) ); + + connect( m_list_view, SIGNAL( selectionChanged( QListViewItem * ) ), + this, SLOT( slotSelectionChanged( QListViewItem * ) ) ); +} + + +Smb4KSearchDialog::~Smb4KSearchDialog() +{ +} + + +const QString &Smb4KSearchDialog::searchString() +{ + m_search_string = m_tool_bar->getCombo( Combo )->currentText(); + + return m_search_string; +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSearchDialog::slotReturnPressed() +{ + slotButtonPressed( Search ); +} + + +void Smb4KSearchDialog::slotTextChanged( const QString &text ) +{ + m_tool_bar->setItemEnabled( Search, !text.isEmpty() ); + m_tool_bar->setItemEnabled( Clear, !text.isEmpty() ); +} + + +void Smb4KSearchDialog::slotButtonPressed( int button_id ) +{ + switch( button_id ) + { + case Search: + { + // We will not remove the text from the edit line of the combo + // box like in earlier versions of Smb4K, but it will be selected + // later on, so that the user can easily remove it, if he wants to. + // We disable the combo box until the search process returns. + m_tool_bar->setItemEnabled( Combo, false ); + + break; + } + case Clear: + { + // Clear the combo box and the list view. The buttons + // will be disabled by slotTextChanged(). + m_tool_bar->getCombo( Combo )->clear(); + m_list_view->clear(); + + m_tool_bar->setItemEnabled( Search, false ); + m_tool_bar->setItemEnabled( Clear, false ); + m_tool_bar->setItemEnabled( Add, false ); + + break; + } + default: + { + break; + } + } + + emit buttonPressed( button_id ); +} + + +void Smb4KSearchDialog::slotItemClicked( QListViewItem *item ) +{ + if ( !item ) + { + // If there is no item, it means that the user clicked onto + // the viewport. In this case, disable the "Add" button and + // clear the current selection. + m_tool_bar->setItemEnabled( Add, false ); + + m_list_view->clearSelection(); + } + else + { + // This is done by slotSelectionChanged(). + } +} + + +void Smb4KSearchDialog::slotSelectionChanged( QListViewItem *item ) +{ + if ( item ) + { + // If we have got an item, enable the "Add" button if the + // item is regular. Otherwise disable the button. + Smb4KSearchDialogItem *search_item = static_cast( item ); + + if ( search_item->isRegular() ) + { + m_tool_bar->setItemEnabled( Add, true ); + } + else + { + m_tool_bar->setItemEnabled( Add, false ); + } + } + else + { + // If there is no item, it means that the user clicked onto + // the viewport. In this case, disable the "Add" button and + // clear the current selection. + m_tool_bar->setItemEnabled( Add, false ); + + m_list_view->clearSelection(); + } +} + +#include "smb4ksearchdialog.moc" diff --git a/smb4k/searchdlg/smb4ksearchdialog.h b/smb4k/searchdlg/smb4ksearchdialog.h new file mode 100644 index 0000000..2b0f2eb --- /dev/null +++ b/smb4k/searchdlg/smb4ksearchdialog.h @@ -0,0 +1,173 @@ +/*************************************************************************** + smb4ksearchdialog - The search dialog widget of Smb4K. + ------------------- + begin : Sa Jun 2 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSEARCHDIALOG_H +#define SMB4KSEARCHDIALOG_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include +#include + +// KDE includes +#include +#include + +// forward declarations +class Smb4KHostItem; + + +/** + * This is the search dialog. It enables the user to find servers, + * that were not found by the regular network scan. + * + * @author Alexander Reinholdt + */ + + +class Smb4KSearchDialog : public QWidget +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent widget + * + * @param name The name of this widget + */ + Smb4KSearchDialog( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KSearchDialog(); + + /** + * This enumeration determines the place where the tool bar + * widgets are located. + */ + enum ToolBarWidgets { Combo = 0, Search, Clear, Add }; + + /** + * Returns the search string the user entered. It's the current + * text of the combo box. + * + * @returns the search string. + */ + const QString &searchString(); + + /** + * This function returns a pointer to the list view of this widget. + * + * @returns a pointer to the list view of this widget. + */ + KListView *listView() { return m_list_view; } + + /** + * This function returns a pointer to the tool bar of this widget. + * + * @returns a pointer to the tool bar of this widget. + */ + KToolBar *toolBar() { return m_tool_bar; } + + signals: + /** + * This signal is emitted everytime a button of the tool bar + * or the return key has been clicked. It passes the button id + * according to the ToolBarWidgets enumeration. + * + * @param button_id The button id + */ + void buttonPressed( int button_id ); + + protected slots: + /** + * This slot is called when the search text has been entered + * and the return key has been pressed. + */ + void slotReturnPressed(); + + /** + * This slot is activated when the text in the edit line of the + * combo box changed. It is used to enable and disable buttons. + * + * @param text The text input + */ + void slotTextChanged( const QString &text ); + + /** + * This slot is activated when a button in the tool bar is pressed. + * It emits the buttonPressed() signal that can be processed by the + * KPart or other widgets. Additionally, it also executes those things + * that need not be done outside the widget, like clearing all the + * list box and the combo box. + * + * @param button_id The button id according to the ToolBarWidgets + * enumeration. + */ + void slotButtonPressed( int button_id ); + + /** + * This slot is activated when the user clicked into the list view. It + * is used to disable the "Add" button in the tool bar when no item is + * selected, i.e. the user clicked on the viewport. The rest is done by + * slotSelectionChanged(). + * + * @param item The list box item that the user clicked or NULL if + * he clicked onto the viewport. + */ + void slotItemClicked( QListViewItem *item ); + + /** + * This slot is activated when the selection changed in the list view. + * It is used to enable/disable the "Add" button in the tool bar. + * + * @param item The list box item that's currently selected + */ + void slotSelectionChanged( QListViewItem *item ); + + private: + /** + * The current search string + */ + QString m_search_string; + + /** + * The list box of this widget + */ + KListView *m_list_view; + + /** + * The tool bar of this widget + */ + KToolBar *m_tool_bar; +}; + +#endif diff --git a/smb4k/searchdlg/smb4ksearchdialog_part.cpp b/smb4k/searchdlg/smb4ksearchdialog_part.cpp new file mode 100644 index 0000000..6a23df6 --- /dev/null +++ b/smb4k/searchdlg/smb4ksearchdialog_part.cpp @@ -0,0 +1,277 @@ +/*************************************************************************** + smb4ksearchdialog_part - This Part encapsulates the search dialog + of Smb4K. + ------------------- + begin : Fr Jun 1 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4ksearchdialog_part.h" +#include "smb4ksearchdialog.h" +#include "smb4ksearchdialogitem.h" +#include "../core/smb4kcore.h" +#include "../core/smb4knetworkitems.h" +#include "../core/smb4kdefs.h" + +KInstance *Smb4KSearchDialogPartFactory::m_instance = 0L; +KAboutData *Smb4KSearchDialogPartFactory::m_about = 0L; + + +Smb4KSearchDialogPart::Smb4KSearchDialogPart( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name ) +: KParts::Part( parent, name ) +{ + // First of all we need an instance: + setInstance( Smb4KSearchDialogPartFactory::instance() ); + + // Set the XML file: +// setXMLFile( "smb4ksearchdialog_part.rc" ); + + // Set the widget of this part: + m_widget = new Smb4KSearchDialog( parentWidget, widgetName ); + setWidget( m_widget ); + + m_serial_number = 0; + + // Connections: + connect( m_widget, SIGNAL( buttonPressed( int ) ), + this, SLOT( slotButtonPressed( int ) ) ); + + connect( m_widget->listView(), SIGNAL( doubleClicked( QListViewItem * ) ), + this, SLOT( slotItemDoubleClicked( QListViewItem * ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( searchResult( Smb4KHostItem * ) ), + this, SLOT( slotReceivedSearchResult( Smb4KHostItem * ) ) ); + + connect( Smb4KCore::scanner(), SIGNAL( hostListChanged() ), + this, SLOT( slotCheckItemIsKnown() ) ); +} + + +Smb4KSearchDialogPart::~Smb4KSearchDialogPart() +{ +} + + +void Smb4KSearchDialogPart::customEvent( QCustomEvent *e ) +{ + switch ( e->type() ) + { + case EVENT_LOAD_SETTINGS: + { + // Not needed at the moment. + + break; + } + case EVENT_SET_FOCUS: + { + m_widget->toolBar()->getCombo( Smb4KSearchDialog::Combo )->lineEdit()->setFocus(); + + break; + } + default: + { + break; + } + } + + KParts::Part::customEvent( e ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS (Smb4KSearchDialogPart) +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSearchDialogPart::slotButtonPressed( int button_id ) +{ + switch ( button_id ) + { + case Smb4KSearchDialog::Search: + { + Smb4KCore::scanner()->search( m_widget->searchString() ); + + break; + } + case Smb4KSearchDialog::Add: + { + Smb4KSearchDialogItem *search_item = static_cast( m_widget->listView()->currentItem() ); + + if ( search_item && !search_item->isKnown() ) + { + Smb4KCore::scanner()->insertHost( search_item->hostItem() ); + } + else + { + // Do nothing + } + + break; + } + default: + { + break; + } + } +} + + +void Smb4KSearchDialogPart::slotReceivedSearchResult( Smb4KHostItem *item ) +{ + if ( item ) + { + // Create a Smb4KSearchDialogItem. This will also add it + // to the list box. + (void) new Smb4KSearchDialogItem( m_widget->listView(), item, m_serial_number++ ); + + // Enable the combo box and set the focus: + m_widget->toolBar()->setItemEnabled( Smb4KSearchDialog::Combo, true ); + m_widget->toolBar()->getCombo( Smb4KSearchDialog::Combo )->setFocus(); + + // Now select the text, so that the user can easily + // remove it. + int string_length = m_widget->toolBar()->getCombo( Smb4KSearchDialog::Combo )->lineEdit()->text().length(); + m_widget->toolBar()->getCombo( Smb4KSearchDialog::Combo )->lineEdit()->setSelection( 0, string_length ); + + slotCheckItemIsKnown(); + } +} + + +void Smb4KSearchDialogPart::slotCheckItemIsKnown() +{ + QListViewItemIterator it( m_widget->listView() ); + + while ( it.current() ) + { + Smb4KSearchDialogItem *item = static_cast( it.current() ); + + if ( item && item->isRegular() ) + { + Smb4KHostItem *host = Smb4KCore::scanner()->getHost( item->hostItem()->name(), item->hostItem()->workgroup() ); + + item->setKnown( (host ? true : false) ); + } + else + { + // Do nothing + } + + ++it; + } +} + + +void Smb4KSearchDialogPart::slotItemDoubleClicked( QListViewItem *item ) +{ + if ( item ) + { + // If we have got an item, enable the "Add" button if the + // item is regular. Otherwise disable the button. + Smb4KSearchDialogItem *search_item = static_cast( item ); + + if ( search_item && search_item->isRegular() && !search_item->isKnown() ) + { + Smb4KCore::scanner()->insertHost( search_item->hostItem() ); + } + else + { + // Do nothing + } + } +} + + +///////////////////////////////////////////////////////////////////////////// +// FACTORY STUFF +///////////////////////////////////////////////////////////////////////////// + +Smb4KSearchDialogPartFactory::Smb4KSearchDialogPartFactory() +: KParts::Factory() +{ +} + + +Smb4KSearchDialogPartFactory::~Smb4KSearchDialogPartFactory() +{ + delete m_instance; + delete m_about; + + m_instance = 0L; +} + + +KParts::Part *Smb4KSearchDialogPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, +QObject *parent, const char *name, const char *, const QStringList & ) +{ + Smb4KSearchDialogPart *obj = new Smb4KSearchDialogPart( parentWidget, widgetName, parent, name ); + + // See if we are to be read-write or not +// if (QCString(classname) == "KParts::ReadOnlyPart") +// { +// obj->setReadWrite(false); +// } + + return obj; +} + + +KInstance *Smb4KSearchDialogPartFactory::instance() +{ + if( !m_instance ) + { + m_about = new KAboutData( "smb4ksearchdialogpart", I18N_NOOP( "Smb4KSearchDialogPart" ), "1.0" ); + m_about->addAuthor("Alexander Reinholdt", 0, "dustpuppy@users.berlios.de"); + m_about->setLicense( KAboutData::License_GPL ); + m_instance = new KInstance( m_about ); + } + + return m_instance; +} + + +///////////////////////////////////////////////////////////////////////////// +// INIT +///////////////////////////////////////////////////////////////////////////// + +extern "C" +{ + void *init_libsmb4ksearchdialog() + { + KGlobal::locale()->insertCatalogue( "smb4k" ); + return new Smb4KSearchDialogPartFactory; + } +} + +#include "smb4ksearchdialog_part.moc" diff --git a/smb4k/searchdlg/smb4ksearchdialog_part.h b/smb4k/searchdlg/smb4ksearchdialog_part.h new file mode 100644 index 0000000..0638a1b --- /dev/null +++ b/smb4k/searchdlg/smb4ksearchdialog_part.h @@ -0,0 +1,171 @@ +/*************************************************************************** + smb4ksearchdialog_part - This Part encapsulates the search dialog + of Smb4K. + ------------------- + begin : Fr Jun 1 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSEARCHDIALOGPART_H +#define SMB4KSEARCHDIALOGPART_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// KDE includes +#include +#include + +// forward declarations +class Smb4KSearchDialog; +class Smb4KHostItem; + + +/** + * This is one of the parts of Smb4K. It contains the search dialog. + * + * @author Alexander Reinholdt + */ + +class Smb4KSearchDialogPart : public KParts::Part +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parentWidget The parent widget + * + * @param widgetName The name the widget should have + * + * @param parent The parent object + * + * @param name The name this object should have + */ + Smb4KSearchDialogPart( QWidget *parentWidget = 0, const char *widgetName = 0, + QObject *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + virtual ~Smb4KSearchDialogPart(); + + protected: + /** + * Reimplemented from KParts::Part. + */ + void customEvent( QCustomEvent *e ); + + protected slots: + /** + * This slot is connected to the Smb4KSearchDialog::buttonPressed() + * signal. It initializes the search process, etc. + * + * @param button_id The button id according to + * Smb4KSearchDialog::ToolBarWidgets. + */ + void slotButtonPressed( int button_id ); + + /** + * This slot retrieves the search result and puts it into the search + * dialog. + * + * @param item A Smb4KHostItem object + */ + void slotReceivedSearchResult( Smb4KHostItem *item ); + + /** + * This slot is connected to the Smb4KScanner::hostListChanged() signal + * and checks whether the host is already known, i.e. it is in the browser, + * or if it is "new". If it is already known, this slot will change the icon + * of the host item from the default one to one with a tick layed over. + */ + void slotCheckItemIsKnown(); + + /** + * This slot is invoked, when a user double clicks an item. It adds the item + * to the list of known hosts (if necessary). + * + * @param item The item that has been double clicked. + */ + void slotItemDoubleClicked( QListViewItem *item ); + + private: + /** + * This is the actual search dialog widget. + */ + Smb4KSearchDialog *m_widget; + + /** + * Work around insertion "problems" of the search dialog items. + */ + int m_serial_number; +}; + + +class KInstance; +class KAboutData; + +class Smb4KSearchDialogPartFactory : public KParts::Factory +{ + Q_OBJECT + + public: + /** + * The constructor + */ + Smb4KSearchDialogPartFactory(); + + /** + * The destructor + */ + virtual ~Smb4KSearchDialogPartFactory(); + + /** + * Reimplemented from KParts::Factory + */ + virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ); + + /** + * The instance + */ + static KInstance *instance(); + + private: + /** + * The factory's instance. + */ + static KInstance *m_instance; + + /** + * The factory's KAboutData object + */ + static KAboutData *m_about; +}; + +#endif diff --git a/smb4k/searchdlg/smb4ksearchdialogitem.cpp b/smb4k/searchdlg/smb4ksearchdialogitem.cpp new file mode 100644 index 0000000..525072e --- /dev/null +++ b/smb4k/searchdlg/smb4ksearchdialogitem.cpp @@ -0,0 +1,140 @@ +/*************************************************************************** + smb4ksearchdialogitem - This class is an enhanced version of a list + box item for Smb4K. + ------------------- + begin : So Jun 3 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include + +// KDE includes +#include +#include +#include + +// application specific includes +#include "smb4ksearchdialogitem.h" +#include "smb4ksearchdialog.h" +#include "../core/smb4knetworkitems.h" + + +Smb4KSearchDialogItem::Smb4KSearchDialogItem( KListView *listView, Smb4KHostItem *item, int serial ) +: KListViewItem( listView ), m_item( *item ), m_serial( serial ) +{ + m_is_known = false; + + if ( !m_item.name().isEmpty() ) + { + m_is_regular = true; + + QString item_text = m_item.name(); + + if ( !m_item.workgroup().isEmpty() && !m_item.ip().isEmpty() ) + { + item_text.append( " ["+m_item.workgroup()+", "+m_item.ip()+"]" ); + } + else + { + if ( !m_item.workgroup().isEmpty() ) + { + item_text.append( " ["+m_item.workgroup()+"]" ); + } + else if ( !m_item.ip().isEmpty() ) + { + // This case will most likely never appear. + item_text.append( " ["+m_item.ip()+"]" ); + } + else + { + // Add nothing to the item text. + } + } + + setText( 0, item_text ); + setIcon(); + } + else + { + m_is_regular = false; + + setText( 0, i18n( "The search failed." ) ); + setIcon(); + } +} + + +Smb4KSearchDialogItem::~Smb4KSearchDialogItem() +{ +} + + +void Smb4KSearchDialogItem::setIcon() +{ + if ( m_is_regular ) + { + if ( m_is_known ) + { + KIconEffect e; + QImage over = SmallIcon( "button_ok" ).convertToImage(); + QImage src = SmallIcon( "server" ).convertToImage(); + e.semiTransparent( over ); + e.overlay( src, over ); + + QPixmap pix( src ); + + setPixmap( 0, pix ); + } + else + { + setPixmap( 0, SmallIcon( "server" ) ); + } + } + else + { + setPixmap( 0, SmallIcon( "no" ) ); + } +} + + +void Smb4KSearchDialogItem::setKnown( bool known ) +{ + m_is_known = known; + + setIcon(); +} + + +int Smb4KSearchDialogItem::compare( QListViewItem *i, int, bool ascending ) const +{ + Smb4KSearchDialogItem *item = static_cast( i ); + + int result = 0; + + if ( item ) + { + result = item->serialNumber() - serialNumber(); + } + + return (ascending ? result : -result); +} + diff --git a/smb4k/searchdlg/smb4ksearchdialogitem.h b/smb4k/searchdlg/smb4ksearchdialogitem.h new file mode 100644 index 0000000..97dbbc9 --- /dev/null +++ b/smb4k/searchdlg/smb4ksearchdialogitem.h @@ -0,0 +1,166 @@ +/*************************************************************************** + smb4ksearchdialogitem - This class is an enhanced version of a list + box item for Smb4K. + ------------------- + begin : So Jun 3 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSEARCHDIALOGITEM_H +#define SMB4KSEARCHDIALOGITEM_H + + +#ifdef HAVE_CONFIG_H +#include +#endif + +// Qt includes +#include + +// application specific includes +#include "../core/smb4knetworkitems.h" + + +/** + * This class is an enhanced version of KListViewItem, that is used + * by the search dialog of Smb4K to show the search results. It + * encapsulates a Smb4KHostItem which carries all the information needed. + * + * @author Alexander Reinholdt + */ + +class Smb4KSearchDialog; +class Smb4KSearchDialogItem : public KListViewItem +{ + public: + /** + * The constructor. It will construct an list view item and set its + * text according to the contents of @p item. If the search failed + * and @p item is empty, an error message will be displayed. + * + * @param listBox The parent list box. + * + * @param item The host item that represents the search + * result. + * + * @param serial The user supplied serial number of this item. It + * is used for sorting. See compare() for further information. + */ + Smb4KSearchDialogItem( KListView *listView, Smb4KHostItem *item, int serial = 0 ); + + /** + * The destructor + */ + ~Smb4KSearchDialogItem(); + + /** + * This function returns the Smb4KHostItem object that is encapsulated + * here. + * + * Make sure you copy the contents to a new item, because the pointer + * will be invalidated if this Smb4KSearchDialogItem is deleted. + * + * @returns the encapsulated Smb4KHostItem object. + */ + Smb4KHostItem *hostItem() { return &m_item; } + + /** + * This function returns TRUE, if the item is regular, that means it + * represents a host. If it represents a failed search, it returns + * FALSE. + * + * @returns TRUE is the item is a regular one. + */ + bool isRegular() { return m_is_regular; } + + /** + * This function notifies the item that the host that it represents is + * known to the application, i.e. it is in the list of hosts. It will set + * the pixmap accordingly and sets m_is_known. + * + * @param known Should be TRUE is the host is known. + */ + void setKnown( bool known ); + + /** + * This function returns TRUE, if the item is already known by the scanner. + * + * @returns TRUE is the item is already known. + */ + bool isKnown() { return m_is_known; } + + /** + * This function is used for sorting. + * + * @returns the serial number of this item. + */ + int serialNumber() const { return m_serial; } + + /** + * Reimplemented from QListViewItem. It is used for sorting and compares the + * serial numbers of this item and @p item. If @p ascending is TRUE and the + * serial number of this item is greater than that of @p item, it will be inserted + * before @p item and else it will be inserted after. In this implementation, + * @p col is *not* used. + * + * @param item The list view item with that this one is compared. + * + * @param col The column that should be used for sorting. It is + * not used in this implementation. + * + * @param ascending Sort ascending if TRUE or descending if FALSE. + * + * @returns 0 if serialNumber() and @p item->serialNumber() are equal and != 0 if + * they are not. Which value and especially which algebraic sign is returned depends + * on the values that are returned by of both serialNumber() functions and on @p ascending. + */ + int compare( QListViewItem *item, int col, bool ascending ) const; + + private: + /** + * The Smb4KHostItem object + */ + Smb4KHostItem m_item; + + /** + * TRUE, if we have a regular item + */ + bool m_is_regular; + + /** + * TRUE is the item is known + */ + bool m_is_known; + + /** + * This function sets the icon of the item. It looks at m_is_known and + * m_is_regular to decide which icon to choose. + */ + void setIcon(); + + /** + * The user defined index of this item. + */ + int m_serial; +}; + + +#endif diff --git a/smb4k/smb4k.cpp b/smb4k/smb4k.cpp new file mode 100644 index 0000000..a2877ae --- /dev/null +++ b/smb4k/smb4k.cpp @@ -0,0 +1,1019 @@ +/*************************************************************************** + smb4k.cpp - The main class of Smb4K. + ------------------- + begin : Sam Mär 1 14:57:21 CET 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include + +// KDE includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4k.h" +#include "smb4ksystemtray.h" +#include "dialogs/smb4kbookmarkeditor.h" +#include "core/smb4ksettings.h" +#include "core/smb4kcore.h" +#include "core/smb4kglobal.h" +#include "core/smb4kbookmark.h" +#include "core/smb4kshare.h" +#include "core/smb4kdefs.h" + +using namespace Smb4KGlobal; + + +Smb4KApp::Smb4KApp( QWidget *parent, const char *name ) +: KParts::DockMainWindow( parent, name ) +{ + m_system_tray = NULL; + + m_shares_part = NULL; + m_browser_part = NULL; + m_search_part = NULL; + + // Set XML file: + setXMLFile( "smb4k_shell.rc" ); + + // Set up the actions. + setupActions(); + + // Set up the status bar: + setupStatusBar(); + + // Set up the view: + setupView(); + + // Setup all things that need to be done *after* createGUI() + // was run: + QPopupMenu *settings = static_cast( child( "settings", "QPopupMenu", true ) ); + + if ( settings ) + { + settings->insertItem( i18n( "&Dock Widgets" ), dockHideShowMenu(), 3, 3 ); + } + + slotSetupBookmarksMenu(); + + // Set up the system tray window: + setupSystemTray(); + + // Resize main window (will be overwritten by configuration): + resize( 800, 600 ); + + // Apply main window settings: + applyMainWindowSettings( Smb4KSettings::self()->config(), "MainWindow" ); + readDockConfig( Smb4KSettings::self()->config(), "MainWindow" ); + + // We have to set the tab labels here. The writeDockConfig() + // readDockConfig() combo will ignore changes of the localization, + // because the first labels will be saved and then loaded again + // and again. + KDockWidget *dock = NULL; + KDockTabGroup *parent_group = NULL; + + if ( (dock = manager()->getDockWidgetFromName( "NetworkBrowser" )) != NULL ) + { + dock->setTabPageLabel( i18n( "Network Browser" ) ); + + if ( (parent_group = dock->parentDockTabGroup()) != NULL ) + { + parent_group->changeTab( dock, i18n( "Network Browser" ) ); + } + } + + if ( (dock = manager()->getDockWidgetFromName( "SearchDialog" )) != NULL ) + { + dock->setTabPageLabel( i18n( "Search Dialog" ) ); + + if ( (parent_group = dock->parentDockTabGroup()) != NULL ) + { + parent_group->changeTab( dock, i18n( "Search Dialog" ) ); + } + } + + // Connections + connect( actionCollection(), SIGNAL( actionHighlighted( KAction * ) ), + this, SLOT( slotActionHighlighted( KAction * ) ) ); + + connect( Smb4KCore::self(), SIGNAL( runStateChanged() ), + this, SLOT( slotRunStateChanged() ) ); + + connect( Smb4KCore::bookmarkHandler(), SIGNAL( bookmarksUpdated() ), + this, SLOT( slotSetupBookmarksMenu() ) ); + + connect( Smb4KCore::mounter(), SIGNAL( updated() ), + this, SLOT( slotShareListUpdated() ) ); +} + + +Smb4KApp::~Smb4KApp() +{ +} + + +void Smb4KApp::setupActions() +{ + actionCollection()->setHighlightingEnabled( true ); + + (void) KStdAction::quit( this, SLOT( slotQuit() ), actionCollection(), "quit_action" ); + + // Set up the "Settings" menu: + setStandardToolBarMenuEnabled( true ); + createStandardStatusBarAction(); + + KActionMenu *view_modes = new KActionMenu( i18n( "Shares Vie&w" ), "view_choose", + actionCollection(), "view_modes_menu" ); + + KRadioAction *icon_view = new KRadioAction( i18n( "&Icon View" ), "view_icon", CTRL+Key_I, + this, SLOT( slotChangeSharesView() ), actionCollection(), "icon_view_action" ); + icon_view->setExclusiveGroup( "SharesViewActions" ); + + KRadioAction *list_view = new KRadioAction( i18n( "List Vie&w" ), "view_detailed", CTRL+Key_W, + this, SLOT( slotChangeSharesView() ), actionCollection(), "list_view_action" ); + list_view->setExclusiveGroup( "SharesViewActions" ); + + switch ( Smb4KSettings::sharesView() ) + { + case Smb4KSettings::EnumSharesView::IconView: + { + icon_view->setChecked( true ); + + break; + } + case Smb4KSettings::EnumSharesView::ListView: + { + list_view->setChecked( true ); + + break; + } + default: + { + break; + } + } + + view_modes->insert( icon_view, -1 ); + view_modes->insert( list_view, -1 ); + + (void) KStdAction::preferences( this, SLOT( slotConfigDialog() ), actionCollection(), "configure_action" ); + + // Notes: + // (1) Actions from the parts will be included by setupView(). + // (2) The list of dock widgets will be plugged into the menu + // by setupView(). + // (3) The bookmark menu is managed by slotSetupBookmarksMenu(). +} + + +void Smb4KApp::setupStatusBar() +{ + // Insert the items: + statusBar()->insertItem( i18n( "Ready." ), Message, 1, false ); + + KProgress *progress = new KProgress( statusBar(), "StatusBarProgressBar", 0 ); + progress->setFixedWidth( 75 ); + progress->setFixedHeight( fontMetrics().height() ); + progress->setPercentageVisible( false ); + statusBar()->addWidget( progress, 0, true ); + + statusBar()->insertFixedItem( QString( "Smb4K %1" ).arg( VERSION ), Version, true ); + + // Align the items: + statusBar()->setItemAlignment( Message, AlignAuto ); + statusBar()->setItemAlignment( Progress, AlignCenter ); + statusBar()->setItemAlignment( Version, AlignAuto ); +} + + +void Smb4KApp::setupView() +{ + // + // Main widget (shares view): + // + KLibFactory *shares_factory = NULL; + + m_current_shares_view = Smb4KSettings::sharesView(); + + switch ( Smb4KSettings::sharesView() ) + { + case Smb4KSettings::EnumSharesView::IconView: + { + shares_factory = KLibLoader::self()->factory( "libsmb4ksharesiconview" ); + + break; + } + case Smb4KSettings::EnumSharesView::ListView: + { + shares_factory = KLibLoader::self()->factory( "libsmb4kshareslistview" ); + + break; + } + default: + { + break; + } + } + + if ( shares_factory ) + { + m_shares_part = static_cast( shares_factory->create( this, "SharesPart", "KParts::Part" ) ); + + if ( m_shares_part ) + { + KDockWidget *main = createDockWidget( "SharesView", SmallIcon( "hdd_mount" ), 0L ); + main->setWidget( m_shares_part->widget() ); + main->setDockSite( KDockWidget::DockCorner ); + main->setEnableDocking( KDockWidget::DockNone ); + setView( main ); + setMainDockWidget( main ); + + createGUI( m_shares_part ); + + accel()->insert( i18n( "Jump to shares view" ), CTRL+Key_3, this, SLOT( slotJumpToSharesView() ), false, true ); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + KApplication::exit( 0 ); + + return; + } + + // + // Browser widget: + // + KLibFactory *browser_factory = KLibLoader::self()->factory( "libsmb4knetworkbrowser" ); + + if ( browser_factory ) + { + m_browser_part = static_cast( browser_factory->create( this, "BrowserPart", "KParts::Part" ) ); + + if ( m_browser_part ) + { + KDockWidget *network = createDockWidget( "NetworkBrowser", SmallIcon( "network" ), 0L, i18n( "Network Browser" ) ); + network->setWidget( m_browser_part->widget() ); + network->manualDock( getMainDockWidget(), KDockWidget::DockLeft, 45 ); + + factory()->addClient( m_browser_part ); + + accel()->insert( i18n( "Jump to network browser" ), CTRL+Key_1, this, SLOT( slotJumpToNetworkBrowser() ), false, true ); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + KApplication::exit( 0 ); + + return; + } + + // + // Search dialog + // + KLibFactory *search_factory = KLibLoader::self()->factory( "libsmb4ksearchdialog" ); + + if ( search_factory ) + { + m_search_part = static_cast( search_factory->create( this, "SearchDialogPart", "KParts::Part" ) ); + + if ( m_search_part ) + { + KDockWidget *search = createDockWidget( "SearchDialog", SmallIcon( "find" ), 0L, i18n( "Search Dialog" ) ); + search->setWidget( m_search_part->widget() ); + + KDockWidget *network = manager()->getDockWidgetFromName( "NetworkBrowser" ); + + if ( network ) + { + search->manualDock( network, KDockWidget::DockCenter, 0 ); + } + else + { + search->manualDock( getMainDockWidget(), KDockWidget::DockLeft, 45 ); + } + + factory()->addClient( m_search_part ); + + accel()->insert( i18n( "Jump to search dialog" ), CTRL+Key_2, this, SLOT( slotJumpToSearchDialog() ), false, true ); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + KApplication::exit( 0 ); + + return; + } +} + + +void Smb4KApp::setupSystemTray() +{ + if ( !m_system_tray ) + { + m_system_tray = new Smb4KSystemTray( this, "SystemTray" ); + } + + connect( m_system_tray, SIGNAL( quitSelected() ), + this, SLOT( slotQuit() ) ); + + connect( m_system_tray, SIGNAL( settingsChanged() ), + this, SLOT( slotSettingsChanged() ) ); + + m_system_tray->embed( Smb4KSettings::embedIntoSystemTray() ); +} + + +void Smb4KApp::changeSharesView() +{ + // Change the information about the current view: + m_current_shares_view = Smb4KSettings::sharesView(); + + // Save dock widget settings: + writeDockConfig( Smb4KSettings::self()->config(), "MainWindow" ); + + // Clear the shares view + factory()->removeClient( m_shares_part ); + + KDockWidget *dock = NULL; + + if ( (dock = manager()->getDockWidgetFromName( "SharesView" )) != NULL ) + { + delete dock; + } + + // Load the new shares view: + KLibFactory *shares_factory = NULL; + + switch ( Smb4KSettings::sharesView() ) + { + case Smb4KSettings::EnumSharesView::IconView: + { + shares_factory = KLibLoader::self()->factory( "libsmb4ksharesiconview" ); + + break; + } + case Smb4KSettings::EnumSharesView::ListView: + { + shares_factory = KLibLoader::self()->factory( "libsmb4kshareslistview" ); + + break; + } + default: + { + break; + } + } + + if ( shares_factory ) + { + m_shares_part = static_cast( shares_factory->create( this, "SharesPart", "KParts::Part" ) ); + + if ( m_shares_part ) + { + KDockWidget *main = createDockWidget( "SharesView", SmallIcon( "hdd_mount" ), this ); + main->setWidget( m_shares_part->widget() ); + main->setDockSite( KDockWidget::DockCorner ); + main->setEnableDocking( KDockWidget::DockNone ); + setView( main ); + setMainDockWidget( main ); + + factory()->addClient( m_shares_part ); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + KApplication::exit( 0 ); + + return; + } + + // Apply the settings to the dock widgets: + readDockConfig( Smb4KSettings::self()->config(), "MainWindow" ); +} + + +bool Smb4KApp::queryExit() +{ + Smb4KSettings::setStartMainWindowDocked( !isVisible() ); + + saveMainWindowSettings( Smb4KSettings::self()->config(), "MainWindow" ); + writeDockConfig( Smb4KSettings::self()->config(), "MainWindow" ); + + hide(); + + if ( m_system_tray ) + { + delete m_system_tray; + m_system_tray = NULL; + } + + // Save any options here that have to be written directly + // before the application exits: + + return true; +} + + +bool Smb4KApp::queryClose() +{ + if ( !kapp->sessionSaving() && isVisible() && m_system_tray->isEmbedded() && + Smb4KSettings::embedIntoSystemTray() ) + { + // This part has been 'stolen' from JuK application. + KMessageBox::information(this, + i18n( "Closing the main window will keep Smb4K running in the system tray. " + "Use \"Quit\" from the \"File\" menu to quit the application."), + i18n( "Docking in System Tray" ), "ClosingMainWindowInfo" ); + + hide(); + + return false; + + } + else + { + return true; + } +} + + +void Smb4KApp::timerEvent( QTimerEvent * ) +{ + KProgress *progress_bar = static_cast( child( "StatusBarProgressBar", "KProgress", true ) ); + + if ( progress_bar ) + { + progress_bar->setProgress( progress_bar->progress() + 1 ); + } +} + + +///////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////// + +void Smb4KApp::slotQuit() +{ + statusBar()->changeItem( i18n( "Exiting..." ), Message ); + + if ( m_system_tray->isEmbedded() ) + { + m_system_tray->embed( false ); + } + + KApplication::exit( 0 ); +} + + +void Smb4KApp::slotChangeSharesView() +{ + // Let's be sure that the last action that was highlighted is + // indeed an action that changes the shares view: + QString action_name; + + if ( m_action ) + { + action_name = QString( m_action->name() ); + + if ( QString::compare( action_name, "icon_view_action" ) != 0 && + QString::compare( action_name, "list_view_action" ) != 0 ) + { + return; + } + } + else + { + return; + } + + KRadioAction *shares_view_action = static_cast( m_action ); + + // Set the check mark for the action: + if ( !shares_view_action->isChecked() ) + { + shares_view_action->setChecked( true ); + } + else + { + // Do nothing + } + + // Change the shares view setting and save it: + if ( QString::compare( action_name, "icon_view_action" ) == 0 ) + { + Smb4KSettings::setSharesView( Smb4KSettings::EnumSharesView::IconView ); + } + else if ( QString::compare( action_name, "list_view_action" ) == 0 ) + { + Smb4KSettings::setSharesView( Smb4KSettings::EnumSharesView::ListView ); + } + else + { + return; + } + + Smb4KSettings::writeConfig(); + + changeSharesView(); +} + + +void Smb4KApp::slotConfigDialog() +{ + // If the config dialog is already created and cached, + // we do not create a new one but show the old instead: + if ( KConfigDialog::showDialog( "ConfigDialog" ) ) + { + return; + } + + // Load the factory of the config dialog: + KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4kconfigdialog" ); + + if ( config_factory ) + { + KConfigDialog *dlg = static_cast( config_factory->create( this, "ConfigDialog", "KConfigDialog" ) ); + + if ( dlg ) + { + connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); + + dlg->show(); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + return; + } +} + + +void Smb4KApp::slotSettingsChanged() +{ + // Adjust settings for the system tray widget: + if ( m_system_tray ) + { + m_system_tray->loadSettings(); + m_system_tray->embed( Smb4KSettings::embedIntoSystemTray() ); + } + + // (Re-)Load the correct shares view. + if ( m_current_shares_view != Smb4KSettings::sharesView() ) + { + changeSharesView(); + } + else + { + // Do nothing + } + + // Notify the parts to reload the settings. + // Note: QApplication::postEvent() will delete the QCustomEvent pointers. + QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) ); + QApplication::postEvent( m_search_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) ); + QApplication::postEvent( m_shares_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) ); +} + + +void Smb4KApp::slotBookmarkEditor() +{ + Smb4KBookmarkEditor *dlg = static_cast( child( "BookmarkEditor", "Smb4KBookmarkEditor", true ) ); + + if ( !dlg ) + { + dlg = new Smb4KBookmarkEditor( this, "BookmarkEditor" ); + } + + dlg->show(); +} + + +void Smb4KApp::slotRunStateChanged() +{ + // Get the progress bar: + KProgress *progress_bar = static_cast( child( "StatusBarProgressBar", "KProgress", true ) ); + + // Clear the status bar: + statusBar()->clear(); + + // Set the status bar message: + switch( Smb4KCore::currentState() ) + { + case SCANNER_INIT: + { + switch ( Smb4KSettings::browseList() ) + { + case Smb4KSettings::EnumBrowseList::LookupDomains: + { + statusBar()->changeItem( i18n( "Looking up workgroups and domains..." ), Message ); + + break; + } + case Smb4KSettings::EnumBrowseList::QueryCurrentMaster: + { + statusBar()->changeItem( i18n( "Querying current master browser..." ), Message ); + + break; + } + case Smb4KSettings::EnumBrowseList::QueryCustomMaster: + { + statusBar()->changeItem( i18n( "Querying master browser %1..." ).arg( Smb4KSettings::customMasterBrowser().upper() ), Message ); + + break; + } + case Smb4KSettings::EnumBrowseList::ScanBroadcastAreas: + { + statusBar()->changeItem( i18n( "Scanning broadcast areas..." ), Message ); + + break; + } + default: + { + break; + } + } + + break; + } + case SCANNER_OPENING_WORKGROUP: + { + statusBar()->changeItem( i18n( "Opening workgroup..." ), Message ); + + break; + } + case SCANNER_OPENING_HOST: + { + statusBar()->changeItem( i18n( "Retrieving list of shares..." ), Message ); + + break; + } + case SCANNER_RETRIEVING_INFO: + { + statusBar()->changeItem( i18n( "Retrieving additional information..." ), Message ); + + break; + } + case SCANNER_SEARCHING: + { + statusBar()->changeItem( i18n( "Searching..." ), Message ); + + break; + } + case SCANNER_RETRYING_OPENING_HOST: + { + statusBar()->changeItem( i18n( "Retrying to retrieve list of shares..." ), Message ); + + break; + } + case SCANNER_STOP: + { + statusBar()->changeItem( i18n( "Done." ), Message ); + + break; + } + case MOUNTER_MOUNTING: + { + statusBar()->changeItem( i18n( "Mounting share..." ), Message ); + + break; + } + case MOUNTER_UNMOUNTING: + { + statusBar()->changeItem( i18n( "Unmounting share..." ), Message ); + + break; + } + case MOUNTER_STOP: + { + statusBar()->changeItem( i18n( "Done." ), Message ); + + break; + } + case PRINT_START: + { + statusBar()->changeItem( i18n( "Printing file..." ), Message ); + + break; + } + case PRINT_STOP: + { + statusBar()->changeItem( i18n( "Done." ), Message ); + + break; + } + case SYNCHRONIZER_START: + { + statusBar()->changeItem( i18n( "Synchronizing data..." ), Message ); + + break; + } + case SYNCHRONIZER_STOP: + { + statusBar()->changeItem( i18n( "Done." ), Message ); + + break; + } + case PREVIEWER_START: + { + statusBar()->changeItem( i18n( "Generating preview..." ), Message ); + + break; + } + case PREVIEWER_STOP: + { + statusBar()->changeItem( i18n( "Done." ), Message ); + + break; + } + case CORE_STOP: + { + statusBar()->changeItem( i18n( "Ready." ), Message ); + + break; + } + default: + { + break; + } + } + + // Set up the progress bar: + if ( Smb4KCore::isRunning() ) + { + // If the progress bar exists and is already set to + // a totalSteps == 0, we do not need to do anything + // here. + if ( progress_bar && progress_bar->totalSteps() != 0 ) + { + progress_bar->setTotalSteps( 0 ); + + m_timer_id = startTimer( TIMER_INTERVAL ); + } + } + else + { + if ( progress_bar ) + { + killTimer( m_timer_id ); + + progress_bar->setTotalSteps( 100 ); + progress_bar->reset(); + } + } +} + + +void Smb4KApp::slotSetupBookmarksMenu() +{ + // Set up bookmark related actions: + QValueList bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks(); + + if ( !actionCollection()->action( "edit_bookmarks_action" ) ) + { + unplugActionList( "bookmark_actions" ); + + QPtrList bookmark_actions; + + // Create the "Edit Bookmarks" action: + bookmark_actions.append( new KAction( i18n( "&Edit Bookmarks" ), "bookmark", CTRL+Key_E, + this, SLOT( slotBookmarkEditor() ), actionCollection(), + "edit_bookmarks_action" ) ); + + // Get the "Add Bookmark" action from the browser: + QPtrList clients_list = factory()->clients(); + + for ( QPtrList::Iterator it = clients_list.begin(); it != clients_list.end(); ++it ) + { + if ( (*it)->action( "bookmark_action" ) ) + { + bookmark_actions.append( (*it)->action( "bookmark_action" ) ); + + break; + } + else + { + continue; + } + } + + bookmark_actions.append( new KActionSeparator() ); + + plugActionList( "bookmark_actions", bookmark_actions ); + } + + // Unplug the action list: + unplugActionList( "bookmarks" ); + + // Get the bookmark action list and delete all entries. We could + // also try to keep those actions that are not obsolete, but I think + // this is the cleanest way. + KActionPtrList list = actionCollection()->actions( "Bookmarks" ); + + for ( KActionPtrList::Iterator it = list.begin(); it != list.end(); ++it ) + { + actionCollection()->remove( *it ); + } + + // Set up the menu: + if ( bookmarks.isEmpty() ) + { + actionCollection()->action( "edit_bookmarks_action" )->setEnabled( false ); + } + else + { + actionCollection()->action( "edit_bookmarks_action" )->setEnabled( true ); + + // Work around sorting problems: + QStringList display_strings; + + for ( QValueListIterator it = bookmarks.begin(); it != bookmarks.end(); ++it ) + { + if ( !(*it)->label().isEmpty() && Smb4KSettings::showCustomBookmarkLabel() ) + { + display_strings.append( (*it)->label() ); + } + else + { + display_strings.append( (*it)->bookmark() ); + } + } + + display_strings.sort(); + + // Create the bookmark list and plug it into the menu: + QPtrList bookmark_list; + + for ( QStringList::ConstIterator it = display_strings.begin(); it != display_strings.end(); ++it ) + { + KAction *a = new KAction( *it, "folder", KShortcut::null(), 0, 0, actionCollection(), *it ); + a->setGroup( "Bookmarks" ); + connect( a, SIGNAL( activated() ), this, SLOT( slotBookmarkActivated() ) ); + bookmark_list.append( a ); + } + + plugActionList( "bookmarks", bookmark_list ); + } +} + + +void Smb4KApp::slotBookmarkActivated() +{ + if ( m_action && QString::compare( m_action->group(), "Bookmarks" ) == 0 ) + { + Smb4KBookmark *bookmark = NULL; + + if ( !m_action->plainText().startsWith( "//" ) ) + { + bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByLabel( m_action->plainText() ); + } + else + { + bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByName( m_action->plainText() ); + } + + if ( bookmark ) + { + Smb4KCore::mounter()->mountShare( bookmark->workgroup(), bookmark->host(), + bookmark->ip(), bookmark->share() ); + } + } + else + { + // Do nothing + } +} + + +void Smb4KApp::slotShareListUpdated() +{ + KActionPtrList list = actionCollection()->actions( "Bookmarks" ); + + if ( !list.isEmpty() ) + { + QString name; + + for ( KActionPtrList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + if ( !(*it)->plainText().startsWith( "//" ) ) + { + Smb4KBookmark *bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByLabel( (*it)->plainText() ); + + name = bookmark->bookmark(); + } + else + { + name = (*it)->plainText(); + } + + QValueList share_list = Smb4KCore::mounter()->findShareByName( name ); + + bool enable = true; + + for ( QValueList::ConstIterator i = share_list.begin(); i != share_list.end(); ++i ) + { + if ( !(*i).isForeign() ) + { + enable = false; + + break; + } + else + { + continue; + } + } + + (*it)->setEnabled( enable ); + } + } +} + + +void Smb4KApp::slotActionHighlighted( KAction *action ) +{ + m_action = action; +} + + +void Smb4KApp::slotJumpToNetworkBrowser() +{ + KDockWidget *dock = NULL; + + if ( (dock = manager()->getDockWidgetFromName( "NetworkBrowser" )) != NULL && + dock->isHidden() ) + { + manager()->getDockWidgetFromName( "NetworkBrowser" )->changeHideShowState(); + } + + // Send a custom focus event to the browser, that tells it to set + // the focus to the list view widget. + QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_SET_FOCUS ) ); +} + + +void Smb4KApp::slotJumpToSearchDialog() +{ + KDockWidget *dock = NULL; + + if ( (dock = manager()->getDockWidgetFromName( "SearchDialog" )) != NULL && + dock->isHidden() ) + { + manager()->getDockWidgetFromName( "SearchDialog" )->changeHideShowState(); + } + + // Send a custom focus event to the search dialog, that tells it + // to set the focus to the combo box in the tool bar. + QApplication::postEvent( m_search_part, new QCustomEvent( EVENT_SET_FOCUS ) ); +} + + +void Smb4KApp::slotJumpToSharesView() +{ + // Send a custom focus event to the shares view, that tells it + // to set the focus to its main widget. + QApplication::postEvent( m_shares_part, new QCustomEvent( EVENT_SET_FOCUS ) ); +} + +#include "smb4k.moc" + diff --git a/smb4k/smb4k.desktop b/smb4k/smb4k.desktop new file mode 100644 index 0000000..b0403f1 --- /dev/null +++ b/smb4k/smb4k.desktop @@ -0,0 +1,81 @@ +# KDE Config File +[Desktop Entry] +Name=Smb4K +GenericName=The SMB/CIFS Share Browser +GenericName[bg]=Самба ресурсен четец +GenericName[ca]=El navegador de compartits SMB/CIFS +GenericName[cs]=Prohližeč SMB/CIFS sdílení +GenericName[da]=SMB/CIFS ressource browseren +GenericName[de]=Der Browser für SMB/CIFS-Freigaben +GenericName[es]=El explorador de recursos compartidos SMB/CIFS +GenericName[fr]=L'explorateur de partages SMB / CIFS +GenericName[hu]=Az SMB/CIFS böngésző +GenericName[is]=SMB/CIFS sameignarflakkarinn +GenericName[it]=Browser di condivisioni SMB/CIFS +GenericName[ja]=SMB/CIFS 共有(シェア)・ブラウザー +GenericName[nb]=SMB/CIFS ressursutforsker +GenericName[nl]=De SMB/CIFS Share Browser +GenericName[nn]=SMB/CIFS ressurs-surfar +GenericName[pl]=Przeglądarka Zasobów SMB/CIFS +GenericName[pt_BR]=O navegador de compartilhamentos SMB/CIFS +GenericName[ru]=The SMB/CIFS Share Browser +GenericName[sk]=Prehliadač SMB/CIFS zdieľaní +GenericName[sv]=SMB Katalog programmed +GenericName[tr]=The SMB/CIFS Share Browser +GenericName[uk]=Навігатор спільних ресурсів SMB/CIFS +GenericName[zh_CN]=SMB 共享浏览器 +# +# The following lines seem to be necessary for SuSE. +# +Name[bg]=Smb4K +Name[ca]=Smb4K +Name[cs]=Smb4K +Name[da]=Smb4K +Name[de]=Smb4K +Name[es]=Smb4K +Name[fr]=Smb4K +Name[hu]=Smb4K +Name[is]=Smb4K +Name[it]=Smb4K +Name[ja]=Smb4K +Name[nb]=Smb4K +Name[nl]=Smb4K +Name[nn]=Smb4K +Name[pl]=Smb4K +Name[pt_BR]=Smb4K +Name[ru]=Smb4K +Name[sk]=Smb4K +Name[sv]=Smb4K +Name[tr]=Smb4K +Name[uk]=Smb4K +Name[zh_CN]=Smb4K +Comment=The SMB/CIFS Share Browser +Comment[bg]=Самба ресурсен четец +Comment[ca]=El navegador de compartits SMB/CIFS +Comment[cs]=Prohližeč SMB/CIFS sdílení +Comment[da]=SMB/CIFS ressource browseren +Comment[de]=Der Browser für SMB/CIFS-Freigaben +Comment[es]=El explorador de recursos compartidos SMB/CIFS +Comment[fr]=L'explorateur de partages SMB / CIFS +Comment[hu]=Az SMB/CIFS böngésző +Comment[is]=SMB/CIFS sameignarflakkarinn +Comment[it]=Browser di condivisioni SMB/CIFS +Comment[ja]=SMB/CIFS 共有(シェア)・ブラウザー +Comment[nb]=SMB/CIFS ressursutforsker +Comment[nl]=De SMB/CIFS Share Browser +Comment[nn]=SMB/CIFS ressurs-surfar +Comment[pl]=Przeglądarka Zasobów SMB/CIFS +Comment[pt_BR]=O navegador de compartilhamentos SMB/CIFS +Comment[ru]=The SMB/CIFS Share Browser +Comment[sk]=Prehliadač SMB/CIFS zdieľaní +Comment[sv]=SMB Katalog programmed +Comment[tr]=The SMB/CIFS Share Browser +Comment[uk]=Навігатор спільних ресурсів SMB/CIFS +Comment[zh_CN]=SMB 共享浏览器 +Exec=smb4k +Icon=smb4k +X-DocPath=smb4k/index.html +Type=Application +Terminal=false +Categories=Qt;KDE;Utility; +X-DCOP-ServiceType=Unique diff --git a/smb4k/smb4k.h b/smb4k/smb4k.h new file mode 100644 index 0000000..2021a47 --- /dev/null +++ b/smb4k/smb4k.h @@ -0,0 +1,229 @@ +/*************************************************************************** + smb4k.h - The main class of Smb4K. + ------------------- + begin : Sam M� 1 14:57:21 CET 2003 + copyright : (C) 2003-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4K_H +#define SMB4K_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +// Forward declarations +class Smb4KSystemTray; + +/** + * This is the application shell of Smb4K. + * + * @author Alexander Reinholdt + */ + +class Smb4KApp : public KParts::DockMainWindow +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent of this widget + * + * @param name The name of this widget + */ + Smb4KApp( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KApp(); + + protected: + /** + * Reimplemented from KMainWindow. + */ + bool queryExit(); + + /** + * Reimplemented from KMainWindow. + */ + bool queryClose(); + + /** + * Reimplemented from QObject + */ + void timerEvent( QTimerEvent *e ); + + protected slots: + /** + * Quit the application. + */ + void slotQuit(); + + /** + * Replace the current shares view. + */ + void slotChangeSharesView(); + + /** + * Open the configuration dialog. This slot is connected to the "Configure Smb4K..." + * action. + */ + void slotConfigDialog(); + + /** + * This slot is invoked when the config dialog is closed and the settings have + * been changed. Emits the reloadSettings() signal and adjusts the system tray + * widget to the new settings afterwards. + */ + void slotSettingsChanged(); + + /** + * Open the bookmark editor. This slot is connected to the "Edit Bookmarks" + * action. + */ + void slotBookmarkEditor(); + + /** + * Show a message to the user what currently is done by the application. This + * slot is connected to the Smb4KCore::runStateChanged() signal. + */ + void slotRunStateChanged(); + + /** + * This slot is invoked when the bookmarks have been updated. It inserts the + * bookmarks into the menu. Additionally, it enables the "Edit Bookmarks" + * action if there are bookmarks and else disables it. + */ + void slotSetupBookmarksMenu(); + + /** + * This slot is invoked when/if a bookmark is activated. + */ + void slotBookmarkActivated(); + + /** + * This slot is activated when the list of mounted shares has been updated. + * It is connected to the Smb4KMounter::updated() signal. + */ + void slotShareListUpdated(); + + /** + * This slot is activated when an action is highlighted and lets m_action + * point to it. No validity checks are performed. + * + * @param action The action that has been highlighted + */ + void slotActionHighlighted( KAction *action ); + + /** + * This slot sets the keyboard focus to the network browser and shows it + * if it is not already shown. + */ + void slotJumpToNetworkBrowser(); + + /** + * This slot sets the keyboard focus to the search dialog and shows it + * if it is not already shown. + */ + void slotJumpToSearchDialog(); + + /** + * This slot sets the keyboard focus to the shares view. Since it is the + * main widget, this slot does not care about it being hidden. + */ + void slotJumpToSharesView(); + + private: + /** + * Set up actions. + */ + void setupActions(); + + /** + * Set up the view. + */ + void setupView(); + + /** + * Set up the status bar + */ + void setupStatusBar(); + + /** + * Set up the system tray + */ + void setupSystemTray(); + + /** + * Change the shares view. + */ + void changeSharesView(); + + /** + * The shares view part + */ + KParts::Part *m_shares_part; + + /** + * The browser part + */ + KParts::Part *m_browser_part; + + /** + * The search dialog part + */ + KParts::Part *m_search_part; + + /** + * The system tray icon of this application + */ + Smb4KSystemTray *m_system_tray; + + /** + * Enumeration for the status bar + */ + enum StatusBarItem{ Message = 0, Progress = 1, Version = 2 }; + + /** + * The currently highlighted KAction. + */ + KAction *m_action; + + /** + * This holds the config entry of the current shares + * view. This is used to avoid unnecessary loading. + */ + int m_current_shares_view; + + /** + * The timer id + */ + int m_timer_id; +}; + +#endif diff --git a/smb4k/smb4k_shell.rc b/smb4k/smb4k_shell.rc new file mode 100644 index 0000000..365ed28 --- /dev/null +++ b/smb4k/smb4k_shell.rc @@ -0,0 +1,37 @@ + + + + &File + + + &Network + + Sh&ares + + &Bookmarks + + + + + &Settings + + + + + + + + + + +Network ToolBar + +Shares View ToolBar + +Main ToolBar + + + + + + diff --git a/smb4k/smb4ksystemtray.cpp b/smb4k/smb4ksystemtray.cpp new file mode 100644 index 0000000..336f0ec --- /dev/null +++ b/smb4k/smb4ksystemtray.cpp @@ -0,0 +1,1079 @@ +/*************************************************************************** + smb4ksystemtray - This is the system tray window class of Smb4K. + ------------------- + begin : Mi Jun 13 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +// Qt includes +#include +#include +#include +#include + +// KDE specific includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// application specific includes +#include "smb4ksystemtray.h" +#include "dialogs/smb4kmountdialog.h" +#include "dialogs/smb4kbookmarkeditor.h" +#include "dialogs/smb4ksynchronizationdialog.h" +#include "core/smb4kcore.h" +#include "core/smb4kbookmark.h" +#include "core/smb4kshare.h" +#include "core/smb4ksettings.h" + + +Smb4KSystemTray::Smb4KSystemTray( QWidget *parent, const char *name ) +: KSystemTray( parent, name ) +{ + setPixmap( loadIcon( "smb4k" ) ); + + QToolTip::add( this, i18n( "Smb4K" ) ); + + m_action = NULL; + + // Enable highlighting of actions: + actionCollection()->setHighlightingEnabled( true ); + + // Set up the context menu (skeleton): + m_shares_menu = new KActionMenu( i18n( "Mounted Shares" ), "hdd_mount", + actionCollection(), "st_mounted_shares_action_menu" ); + m_bookmarks_menu = new KActionMenu( i18n( "Bookmarks" ), "bookmark_folder", + actionCollection(), "st_bookmark_action_menu" ); + KActionSeparator *sep = new KActionSeparator( this ); + KAction *manual_mount = new KAction( i18n( "M&ount Manually" ), "connect_creating", + 0, this, SLOT( slotMountManually() ), + actionCollection(), "st_mount_manually_action" ); + KAction *configure = KStdAction::preferences( this, SLOT( slotConfigDialog() ), + actionCollection(), "st_configure_action" ); + + m_shares_menu->plug( contextMenu() ); + m_bookmarks_menu->plug( contextMenu() ); + sep->plug( contextMenu() ); + manual_mount->plug( contextMenu() ); + configure->plug( contextMenu() ); + + // Set up the menus: + slotSetupBookmarksMenu(); + slotSetupSharesMenu(); + + // Connections: + connect( actionCollection(), SIGNAL( actionHighlighted( KAction * ) ), + this, SLOT( slotActionHighlighted( KAction * ) ) ); + + connect( Smb4KCore::bookmarkHandler(), SIGNAL( bookmarksUpdated() ), + this, SLOT( slotSetupBookmarksMenu() ) ); + + connect( Smb4KCore::mounter(), SIGNAL( updated() ), + this, SLOT( slotEnableBookmarks() ) ); + + connect( Smb4KCore::mounter(), SIGNAL( updated() ), + this, SLOT( slotSetupSharesMenu() ) ); + + // Connection to quitSelected() signal must be done in parent widget. +} + + +Smb4KSystemTray::~Smb4KSystemTray() +{ +} + + +void Smb4KSystemTray::embed( bool ebd ) +{ + if ( ebd ) + { + show(); + } + else + { + hide(); + } +} + + +void Smb4KSystemTray::loadSettings() +{ + // Adjust the bookmarks menu. + // Since the menu is rebuilt everytime slotSetupBookmarksMenu() is + // called, we just call it and are done. + slotSetupBookmarksMenu(); + + // Adjust the shares menu. + // slotSetupSharesMenu() is doing everything for us, so just call it. + slotSetupSharesMenu(); +} + + +///////////////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATIONS +///////////////////////////////////////////////////////////////////////////// + +void Smb4KSystemTray::slotMountManually() +{ + Smb4KMountDialog *dlg = NULL; + + if ( parentWidget() ) + { + dlg = static_cast( parentWidget()->child( "MountDialog", "Smb4KMountDialog", true ) ); + } + else + { + dlg = static_cast( child( "MountDialog", "Smb4KMountDialog", true ) ); + } + + if ( !dlg ) + { + if ( parentWidget() && parentWidget()->isShown() ) + { + dlg = new Smb4KMountDialog( parentWidget(), "MountDialog" ); + } + else + { + dlg = new Smb4KMountDialog( this, "MountDialog" ); + } + } + + // The dialog will be closed destructively. + if ( !dlg->isShown() ) + { + dlg->exec(); + } +} + + +void Smb4KSystemTray::slotConfigDialog() +{ + // If the config dialog is already created and cached, + // we do not create a new one but show the old instead: + KConfigDialog *dlg = NULL; + + if ( (dlg = KConfigDialog::exists( "ConfigDialog" )) && KConfigDialog::showDialog( "ConfigDialog" ) ) + { + // To make sure we do not connect the config dialog several times + // to slotSettingsChanged(), we break the connection first and re- + // establish it afterwards: + disconnect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); + connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); + + return; + } + + // Load the factory of the config dialog: + KLibFactory *config_factory = KLibLoader::self()->factory( "libsmb4kconfigdialog" ); + + if ( config_factory ) + { + if ( parentWidget() && parentWidget()->isShown() ) + { + dlg = static_cast( config_factory->create( parentWidget(), "ConfigDialog", "KConfigDialog" ) ); + } + else + { + dlg = static_cast( config_factory->create( this, "ConfigDialog", "KConfigDialog" ) ); + } + + // ... and show it. + if ( dlg ) + { + connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); + + dlg->show(); + } + } + else + { + KMessageBox::error( 0, ""+KLibLoader::self()->lastErrorMessage()+"" ); + + return; + } +} + +void Smb4KSystemTray::slotSettingsChanged() +{ + // Notify the parent that the settings changed: + emit settingsChanged(); + + // Execute loadSettings(): + loadSettings(); +} + + +void Smb4KSystemTray::slotSetupBookmarksMenu() +{ + // First check if we have to set up the menu completely: + if ( !actionCollection()->action( "st_edit_bookmarks_action" ) ) + { + // OK, build the menu from ground up: + KAction *edit_bookmarks = new KAction( i18n( "&Edit Bookmarks" ), "bookmark", 0, + this, SLOT( slotBookmarkEditor() ), actionCollection(), + "st_edit_bookmarks_action" ); + edit_bookmarks->setGroup( "BookmarkActions" ); + edit_bookmarks->plug( m_bookmarks_menu->popupMenu() ); + + KActionSeparator *sep = new KActionSeparator( actionCollection(), "st_bookmark_action_separator" ); + sep->setGroup( "BookmarkActions" ); + sep->plug( m_bookmarks_menu->popupMenu() ); + } + + // Get the list of bookmark actions and delete all entries. We could + // also try to keep those actions that are not obsolete, but I think + // this is the cleanest way. + KActionPtrList list = actionCollection()->actions( "Bookmarks" ); + + for ( KActionPtrList::Iterator it = list.begin(); it != list.end(); ++it ) + { + (*it)->unplug( m_bookmarks_menu->popupMenu() ); + actionCollection()->remove( *it ); + } + + // Get the list of bookmarks: + QValueList bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks(); + QStringList display_strings; + + // Prepare the list of bookmarks for display: + if ( !bookmarks.isEmpty() ) + { + // Enable the "Edit Bookmarks" action: + actionCollection()->action( "st_edit_bookmarks_action" )->setEnabled( true ); + + // Work around sorting problems: + for ( QValueListIterator it = bookmarks.begin(); it != bookmarks.end(); ++it ) + { + if ( !(*it)->label().isEmpty() && Smb4KSettings::showCustomBookmarkLabel() ) + { + display_strings.append( (*it)->label() ); + } + else + { + display_strings.append( (*it)->bookmark() ); + } + } + + display_strings.sort(); + } + else + { + // Disable the "Edit Bookmarks" action: + actionCollection()->action( "st_edit_bookmarks_action" )->setEnabled( false ); + } + + for ( QStringList::ConstIterator it = display_strings.begin(); it != display_strings.end(); ++it ) + { + // Create the bookmark action: + KAction *a = new KAction( *it, "folder", KShortcut::null(), 0, 0, actionCollection(), "st_"+*it ); + a->setGroup( "Bookmarks" ); + connect( a, SIGNAL( activated() ), this, SLOT( slotBookmarkActivated() ) ); + + // Let's have a look if the bookmark action has to be enabled or disabled: + QString name; + + if ( !(*it).startsWith( "//" ) ) + { + Smb4KBookmark *bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByLabel( *it ); + + name = bookmark->bookmark(); + } + else + { + name = *it; + } + + QValueList share_list = Smb4KCore::mounter()->findShareByName( name ); + + bool enable = true; + + for ( QValueList::ConstIterator i = share_list.begin(); i != share_list.end(); ++i ) + { + if ( !(*i).isForeign() ) + { + enable = false; + + break; + } + else + { + continue; + } + } + + a->setEnabled( enable ); + + // Plug the bookmark to the menu: + a->plug( m_bookmarks_menu->popupMenu() ); + } +} + + +void Smb4KSystemTray::slotBookmarkEditor() +{ + Smb4KBookmarkEditor *dlg = NULL; + + if ( parentWidget() ) + { + dlg = static_cast( parentWidget()->child( "BookmarkEditor", "Smb4KBookmarkEditor", true ) ); + } + else + { + dlg = static_cast( child( "BookmarkEditor", "Smb4KBookmarkEditor", true ) ); + } + + if ( !dlg ) + { + if ( parentWidget() && parentWidget()->isShown() ) + { + dlg = new Smb4KBookmarkEditor( parentWidget(), "BookmarkEditor" ); + } + else + { + dlg = new Smb4KBookmarkEditor( this, "BookmarkEditor" ); + } + } + + if ( !dlg->isShown() ) + { + dlg->show(); + } +} + + +void Smb4KSystemTray::slotBookmarkActivated() +{ + if ( m_action && QString::compare( m_action->group(), "Bookmarks" ) == 0 ) + { + Smb4KBookmark *bookmark = NULL; + + if ( !m_action->plainText().startsWith( "//" ) ) + { + bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByLabel( m_action->plainText() ); + } + else + { + bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByName( m_action->plainText() ); + } + + if ( bookmark ) + { + Smb4KCore::mounter()->mountShare( bookmark->workgroup(), bookmark->host(), + bookmark->ip(), bookmark->share() ); + } + } + else + { + // Do nothing + } +} + + +void Smb4KSystemTray::slotEnableBookmarks() +{ + // Get the list of bookmarks: + KActionPtrList list = actionCollection()->actions( "Bookmarks" ); + + // Enable/diable the bookmark actions: + for ( KActionPtrList::Iterator it = list.begin(); it != list.end(); ++it ) + { + QString name; + + if ( !(*it)->plainText().startsWith( "//" ) ) + { + Smb4KBookmark *bookmark = Smb4KCore::bookmarkHandler()->findBookmarkByLabel( (*it)->plainText() ); + + name = bookmark->bookmark(); + } + else + { + name = (*it)->plainText(); + } + + QValueList share_list = Smb4KCore::mounter()->findShareByName( name ); + + bool enable = true; + + for ( QValueList::ConstIterator i = share_list.begin(); i != share_list.end(); ++i ) + { + if ( !(*i).isForeign() ) + { + enable = false; + + break; + } + else + { + continue; + } + } + + (*it)->setEnabled( enable ); + } +} + + +void Smb4KSystemTray::slotSetupSharesMenu() +{ + // First check if we have to set up the menu completely: + if ( !actionCollection()->action( "st_unmount_all_action" ) ) + { + // OK, build the menu from ground up: + KAction *unmount_all = new KAction( i18n( "U&nmount All" ), "gear", KShortcut::null(), + this, SLOT( slotUnmountAllShares() ), actionCollection(), + "st_unmount_all_action" ); + unmount_all->setGroup( "ShareActions" ); + unmount_all->plug( m_shares_menu->popupMenu(), 0 ); + + KActionSeparator *sep = new KActionSeparator( actionCollection(), "st_shares_action_separator" ); + sep->setGroup( "ShareActions" ); + sep->plug( m_shares_menu->popupMenu(), 1 ); + } + + // Since we are updating the list of shares very frequently, we should + // not delete all entries in the menu, but look for changes. + + // Get the list of share actions: + KActionPtrList actions_list = actionCollection()->actions( "ShareMenus" ); + + // Get the list of mounted shares: + QValueList shares_list = Smb4KCore::mounter()->getShares(); + + if ( !shares_list.isEmpty() ) + { + // Enable the "Unmount All" action: + actionCollection()->action( "st_unmount_all_action" )->setEnabled( true ); + + // Delete all obsolete actions: + for ( KActionPtrList::Iterator it = actions_list.begin(); it != actions_list.end(); ++it ) + { + // Get the canonical path of the share action: + QString action_name = (*it)->name(); + QString canonical_path = action_name.section( "st_[share_menu]_", 1, -1 ); + + // Check if the share is still present: + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path ); + + // Decide if the share action has to be deleted or if it can stay: + if ( share ) + { + // Keep the share if it either isn't foreign or all shares should + // be shown. + if ( !share->isForeign() || Smb4KSettings::showAllShares() ) + { + // To avoid sorting problems later, we remove *all* actions that + // have *displayed texts* that do not match the current criterions. + if ( (!Smb4KSettings::showMountPoint() && + QString::compare( (*it)->plainText(), share->name() ) == 0) || + (Smb4KSettings::showMountPoint() && + QString::compare( (*it)->plainText(), share->canonicalPath() ) == 0) ) + { + // Find the "Force Unmount" action and decide if it needs to be + // enabled/disabled: + KAction *force = actionCollection()->action( "st_[force]_"+canonical_path ); + + if ( force ) + { + force->setEnabled( Smb4KSettings::useForceUnmount() ); + } + + continue; + } + else + { + // First remove all actions that are in the submenu: + KAction *action = NULL; + KActionMenu *menu = static_cast( *it ); + + if ( menu ) + { + // Unmount action + action = actionCollection()->action( "st_[unmount]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + +#ifdef __linux__ + // Force Unmount action + action = actionCollection()->action( "st_[force]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } +#endif + + // Synchronize action + action = actionCollection()->action( "st_[synchronize]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konsole action + action = actionCollection()->action( "st_[konsole]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konqueror action + action = actionCollection()->action( "st_[filemanager]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + } + + // Now remove the menu itself: + (*it)->unplug( m_shares_menu->popupMenu() ); + actionCollection()->remove( *it ); + + continue; + } + } + else + { + // First remove all actions that are in the submenu: + KAction *action = NULL; + KActionMenu *menu = static_cast( *it ); + + if ( menu ) + { + // Unmount action + action = actionCollection()->action( "st_[unmount]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + +#ifdef __linux__ + // Force Unmount action + action = actionCollection()->action( "st_[force]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } +#endif + + // Synchronize action + action = actionCollection()->action( "st_[synchronize]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konsole action + action = actionCollection()->action( "st_[konsole]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konqueror action + action = actionCollection()->action( "st_[filemanager]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + } + + // Now remove the menu itself: + (*it)->unplug( m_shares_menu->popupMenu() ); + actionCollection()->remove( *it ); + + continue; + } + } + else + { + // First remove all actions that are in the submenu: + KAction *action = NULL; + KActionMenu *menu = static_cast( *it ); + + if ( menu ) + { + // Unmount action + action = actionCollection()->action( "st_[unmount]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + +#ifdef __linux__ + // Force Unmount action + action = actionCollection()->action( "st_[force]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } +#endif + + // Synchronize action + action = actionCollection()->action( "st_[synchronize]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konsole action + action = actionCollection()->action( "st_[konsole]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konqueror action + action = actionCollection()->action( "st_[filemanager]_"+canonical_path ); + + if ( action ) + { + action->unplug( menu->popupMenu() ); + actionCollection()->remove( action ); + } + } + + // Now remove the menu itself: + (*it)->unplug( m_shares_menu->popupMenu() ); + actionCollection()->remove( *it ); + + continue; + } + } + + // Since we cannot sort the Smb4kShare items appropriately, we have to + // work around this problem. For that, let's create a string list: + QStringList strings; + + for ( QValueList::ConstIterator it = shares_list.begin(); it != shares_list.end(); ++it ) + { + if ( !(*it)->isForeign() || Smb4KSettings::showAllShares() ) + { + if ( Smb4KSettings::showMountPoint() ) + { + strings.append( (*it)->canonicalPath() ); + } + else + { + // _::_ is the devider between share name and the canonical path of + // the share. + QString item = QString( "%1_::_%2" ).arg( (*it)->name(), (*it)->canonicalPath() ); + strings.append( item ); + } + + continue; + } + else + { + continue; + } + } + + strings.sort(); + + // We are ready to insert the new shares into the menu. + // We loop through the list of mounted shares and check if the + // single shares are already in the menu. If not, we plug them + // there: + for ( QValueList::ConstIterator it = shares_list.begin(); it != shares_list.end(); ++it ) + { + KActionMenu *action_menu = NULL; + + // Reread the list of share action menus: + KActionPtrList new_actions_list = actionCollection()->actions( "ShareMenus" ); + + for ( KActionPtrList::ConstIterator i = new_actions_list.begin(); i != new_actions_list.end(); ++i ) + { + QString item = QString( "st_[share_menu]_%1" ).arg( (*it)->canonicalPath() ); + + if ( QString::compare( (*i)->name(), item ) == 0 ) + { + action_menu = static_cast( *i ); + + break; + } + else + { + continue; + } + } + + if ( !action_menu ) + { + // Create a new KAction menu: + QIconSet set; + QPixmap pix; + KIconLoader loader; + + int icon_state = (*it)->isForeign() ? KIcon::DisabledState : KIcon::DefaultState; + + if ( (*it)->isBroken() ) + { + QImage over = loader.loadIcon( "button_cancel", KIcon::Small, + 0, icon_state, 0L, false ).convertToImage(); + QImage src = loader.loadIcon( "hdd_mount", KIcon::Small, + 0, icon_state, 0L, false ).convertToImage(); + + KIconEffect e; + e.semiTransparent( over ); + e.overlay( src, over ); + + pix = QPixmap( src ); + } + else + { + pix = loader.loadIcon( "hdd_mount", KIcon::Small, + 0, icon_state, 0L, false ); + } + + set.reset( pix, QIconSet::Automatic ); + + action_menu = new KActionMenu( Smb4KSettings::showMountPoint() ? (*it)->path() : (*it)->name(), + set, actionCollection(), "st_[share_menu]_"+(*it)->canonicalPath() ); + action_menu->setGroup( "ShareMenus" ); + + + // Define the actions that can be performed on a share from within + // the system tray widget: + KAction *umount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut::null(), this, + SLOT( slotUnmountShare() ), actionCollection(), "st_[unmount]_"+(*it)->canonicalPath() ); + umount->setGroup( "ShareActions" ); +#ifdef __linux__ + KAction *force_umount = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut::null(), this, + SLOT( slotForceUnmountShare() ), actionCollection(), "st_[force]_"+(*it)->canonicalPath() ); + force_umount->setGroup( "ShareActions" ); + force_umount->setEnabled( Smb4KSettings::useForceUnmount() ); +#endif + KAction *synchronize = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut::null(), this, + SLOT( slotSynchronize() ), actionCollection(), "st_[synchronize]_"+(*it)->canonicalPath() ); + synchronize->setGroup( "ShareActions" ); + synchronize->setEnabled( !Smb4KSettings::rsync().isEmpty() ); + + KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut::null(), this, + SLOT( slotKonsole() ), actionCollection(), "st_[konsole]_"+(*it)->canonicalPath() ); + konsole->setGroup( "ShareActions" ); + konsole->setEnabled( !Smb4KSettings::konsole().isEmpty() ); + + KAction *konqueror = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut::null(), this, + SLOT( slotFilemanager() ), actionCollection(), "st_[filemanager]_"+(*it)->canonicalPath() ); + konqueror->setGroup( "ShareActions" ); + + // Set up the action submenu: + action_menu->insert( umount ); +#ifdef __linux__ + action_menu->insert( force_umount ); +#endif + action_menu->popupMenu()->insertSeparator( -1 ); + action_menu->insert( synchronize ); + action_menu->popupMenu()->insertSeparator( -1 ); + action_menu->insert( konsole ); + action_menu->insert( konqueror ); + + // Plug the new menu to the popup menu: + int index = 0; + + if ( !Smb4KSettings::showMountPoint() ) + { + QString item = QString( "%1_::_%2" ).arg( (*it)->name(), (*it)->canonicalPath() ); + + index = strings.findIndex( item ); + } + else + { + index = strings.findIndex( (*it)->canonicalPath() ); + } + + m_shares_menu->insert( action_menu, index + 2 ); // +2 due to "Unmount All" and separator + } + else + { + // Change icon and disable some actions, if the share got inaccessible + // in the meantime: + if ( (*it)->isBroken() ) + { + QIconSet set; + QPixmap pix; + KIconLoader loader; + + int icon_state = (*it)->isForeign() ? KIcon::DisabledState : KIcon::DefaultState; + + QImage over = loader.loadIcon( "button_cancel", KIcon::Small, + 0, icon_state, 0L, false ).convertToImage(); + QImage src = loader.loadIcon( "hdd_mount", KIcon::Small, + 0, icon_state, 0L, false ).convertToImage(); + + KIconEffect e; + e.semiTransparent( over ); + e.overlay( src, over ); + + pix = QPixmap( src ); + + set.reset( pix, QIconSet::Automatic ); + + action_menu->setIconSet( set ); + + // Disable actions that should not be performed on an inaccessible + // share: + actionCollection()->action( "st_[synchronize]_"+(*it)->canonicalPath() )->setEnabled( false ); + actionCollection()->action( "st_[konsole]_"+(*it)->canonicalPath() )->setEnabled( false ); + actionCollection()->action( "st_[filemanager]_"+(*it)->canonicalPath() )->setEnabled( false ); + } + + // Change the text if necessary: + if ( !Smb4KSettings::showMountPoint() && + QString::compare( action_menu->plainText(), (*it)->name() ) != 0 ) + { + action_menu->setText( (*it)->name() ); + } + else if ( Smb4KSettings::showMountPoint() && + QString::compare( action_menu->plainText(), (*it)->path() ) != 0 ) + { + action_menu->setText( (*it)->path() ); + } + else + { + // Do nothing + } + } + } + } + else + { + // Remove all share action menus: + for ( KActionPtrList::Iterator it = actions_list.begin(); it != actions_list.end(); ++it ) + { + KActionMenu *action_menu = static_cast( *it ); + + // Get the canonical path of the share action: + QString action_name = action_menu->name(); + QString canonical_path = action_name.section( "st_[share_menu]_", 1, -1 ); + + // Remove all children of the share action menus: + KAction *action = NULL; + + // Unmount action + action = actionCollection()->action( "st_[unmount]_"+canonical_path ); + + if ( action ) + { + action->unplug( action_menu->popupMenu() ); + actionCollection()->remove( action ); + } + +#ifdef __linux__ + // Force Unmount action + action = actionCollection()->action( "st_[force]_"+canonical_path ); + + if ( action ) + { + action->unplug( action_menu->popupMenu() ); + actionCollection()->remove( action ); + } +#endif + + // Synchronize action + action = actionCollection()->action( "st_[synchronize]_"+canonical_path ); + + if ( action ) + { + action->unplug( action_menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konsole action + action = actionCollection()->action( "st_[konsole]_"+canonical_path ); + + if ( action ) + { + action->unplug( action_menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Konqueror action + action = actionCollection()->action( "st_[filemanager]_"+canonical_path ); + + if ( action ) + { + action->unplug( action_menu->popupMenu() ); + actionCollection()->remove( action ); + } + + // Remove action menu itself: + action_menu->unplug( m_shares_menu->popupMenu() ); + actionCollection()->remove( action_menu ); + } + + // Disable the "Unmount All" action: + actionCollection()->action( "st_unmount_all_action" )->setEnabled( false ); + } +} + + +void Smb4KSystemTray::slotUnmountAllShares() +{ + Smb4KCore::mounter()->unmountAllShares(); +} + + +void Smb4KSystemTray::slotUnmountShare() +{ + if ( m_action && QString( m_action->name() ).startsWith( "st_[unmount]_" ) ) + { + QString canonical_path = QString( m_action->name() ).section( "st_[unmount]_", 1, 1 ); + + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path ); + + if ( share ) + { + Smb4KCore::mounter()->unmountShare( share, false, false ); + } + } +} + + +void Smb4KSystemTray::slotForceUnmountShare() +{ + if ( m_action && QString( m_action->name() ).startsWith( "st_[force]_" ) ) + { + QString canonical_path = QString( m_action->name() ).section( "st_[force]_", 1, 1 ); + + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path ); + + if ( share ) + { + Smb4KCore::mounter()->unmountShare( share, true, false ); + } + } +} + + +void Smb4KSystemTray::slotSynchronize() +{ + // Since we want to allow the possibility to open several instances + // of the synchronization dialog, we do not checks like in slotConfigDialog() + if ( m_action && QString( m_action->name() ).startsWith( "st_[synchronize]_" ) ) + { + QString canonical_path = QString( m_action->name() ).section( "st_[synchronize]_", 1, 1 ); + + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path ); + + if ( share && !share->isBroken() ) + { + Smb4KSynchronizationDialog *dlg = NULL; + + if ( parentWidget() && parentWidget()->isShown() ) + { + dlg = new Smb4KSynchronizationDialog( share, parentWidget(), "SynchronizationDialog" ); + } + else + { + dlg = new Smb4KSynchronizationDialog( share, this, "SynchronizationDialog" ); + } + + dlg->show(); + } + } +} + + +void Smb4KSystemTray::slotKonsole() +{ + if ( m_action && QString( m_action->name() ).startsWith( "st_[konsole]_" ) ) + { + QString canonical_path = QString( m_action->name() ).section( "st_[konsole]_", 1, 1 ); + + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path ); + + if ( share && !share->isBroken() ) + { + Smb4KCore::open( share, Smb4KCore::Konsole ); + } + } +} + + +void Smb4KSystemTray::slotFilemanager() +{ + if ( m_action && QString( m_action->name() ).startsWith( "st_[filemanager]_" ) ) + { + QString canonical_path = QString( m_action->name() ).section( "st_[filemanager]_", 1, 1 ); + + Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path ); + + if ( share && !share->isBroken() ) + { + Smb4KCore::open( share, Smb4KCore::Konqueror ); + } + } +} + + +void Smb4KSystemTray::slotActionHighlighted( KAction *action ) +{ + // If the main window is not shown, the last action that + // is highlighted when the user clicks an action in a + // mounted-share-submenu is "st_mounted_shares_action_menu" + // and not the action the user clicked. That's why we need + // to filter this action out: + if ( action && !qstrcmp( action->name(), "st_mounted_shares_action_menu" ) ) + { + return; + } + + m_action = action; +} + +#include "smb4ksystemtray.moc" + diff --git a/smb4k/smb4ksystemtray.h b/smb4k/smb4ksystemtray.h new file mode 100644 index 0000000..c3d4d6b --- /dev/null +++ b/smb4k/smb4ksystemtray.h @@ -0,0 +1,207 @@ +/*************************************************************************** + smb4ksystemtray - This is the system tray window class of Smb4K. + ------------------- + begin : Mi Jun 13 2007 + copyright : (C) 2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef SMB4KSYSTEMTRAY_H +#define SMB4KSYSTEMTRAY_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// KDE includes +#include +#include + +class Smb4KSystemTray : public KSystemTray +{ + Q_OBJECT + + public: + /** + * The constructor. + * + * @param parent The parent widget of the system tray window + * + * @param name The name of the system tray window + */ + Smb4KSystemTray( QWidget *parent = 0, const char *name = 0 ); + + /** + * The destructor. + */ + ~Smb4KSystemTray(); + + /** + * Embeds the system tray window into the system tray, if @p ebd is + * TRUE. Otherwise, it removes it from there. Note, that the system tray + * icon won't be deleted but only hidden! + * + * @param ebd If TRUE the system tray icon will be embedded into + * the system tray. + */ + void embed( bool ebd ); + + /** + * This function returns TRUE if the system tray window is embedded into + * the system tray and FALSE otherwise. + * + * @returns TRUE if the system tray window is embedded. + */ + bool isEmbedded() { return isShown(); } + + /** + * This function (re-)loads the settings for this widget. It basically just + * runs the slot slotSetupBookmarkMenu() and slotSetupSharesMenu(), that will + * do everything to properly set up the menus. + * + * This slot *does not* manage the appearance (or disappearance) of this widget + * in the system tray. You need to use embed() to do this. + */ + void loadSettings(); + + signals: + /** + * This signal is emitted when the config dialog has been closed and the + * settings changed. + */ + void settingsChanged(); + + protected slots: + /** + * This slot opens the dialog for mounting shares manually. + */ + void slotMountManually(); + + /** + * This slot opens the configurations dialog. + */ + void slotConfigDialog(); + + /** + * This slot is invoked when the config dialog is closed and the settings have + * been changed. Emits the reloadSettings() signal and adjusts the system tray + * widget to the new settings afterwards. + */ + void slotSettingsChanged(); + + /** + * This slot is invoked when the bookmarks have been updated. It sets up the + * bookmark menu, inserts the bookmark actions into it and automatically + * disables them if they were already mounted (@see slotSetupSharesMenu() as well). + */ + void slotSetupBookmarksMenu(); + + /** + * This slot opens the bookmark editor. + */ + void slotBookmarkEditor(); + + /** + * This slot is called when a bookmark has been activated. It initializes the + * mounting of the represented share. + */ + void slotBookmarkActivated(); + + /** + * This slot enables and disables the bookmarks. If a share that's represented + * by the bookmark is mounted, the bookmark will be disabled. It will be + * enabled, when it is unmounted again. + */ + void slotEnableBookmarks(); + + /** + * This slot is activated when the list of mounted shares has been updated. + * It setus up the "Mounted Shares" menu and also enables/disables the + * bookmarks in the "Bookmarks" menu. It is connected to the + * Smb4KMounter::updated() signal. + */ + void slotSetupSharesMenu(); + + /** + * This slot initializes the umounting of all shares. It is connected to the + * "Unmount All" action of the "Mounted Shares" menu. + */ + void slotUnmountAllShares(); + + /** + * This slot is connected to the 'Unmount action'. You will be able to + * unmount a certain share when activating this slot. + */ + void slotUnmountShare(); + + /** + * This slot is connected to the 'Force Unmounting' action and is, thus, + * only useful under Linux, because only there the possibility for a forced + * (i.e. lazy) unmount exists. + * + * When activating this slot, the selected share will be unmounted, even if + * it is not accessible or the server already went offline. + */ + void slotForceUnmountShare(); + + /** + * This slot is connected to the 'Synchronize' action. The current item will be + * synchronized with a local copy (or vice versa) if you activate it. + */ + void slotSynchronize(); + + /** + * This slot is connected to the 'Konsole' action. The mount point of the current + * share item will be opened in Konsole. + */ + void slotKonsole(); + + /** + * This slot is connected to the 'Konqueror' action. The contents of the current + * share item will be opened in the file manager. + */ + void slotFilemanager(); + + /** + * This slot is enabled when an action is highlighted. No validity checks are + * performed. + * + * @param action The currently highlighted action. + */ + void slotActionHighlighted( KAction *action ); + + private: + /** + * The action menu for the bookmarks. + */ + KActionMenu *m_bookmarks_menu; + + /** + * The action menu for the mounted shares. + */ + KActionMenu *m_shares_menu; + + /** + * This is the currently highlighted action. + */ + KAction *m_action; +}; + +#endif diff --git a/stamp-h.in b/stamp-h.in new file mode 100644 index 0000000..e69de29 diff --git a/subdirs b/subdirs new file mode 100644 index 0000000..456ea5d --- /dev/null +++ b/subdirs @@ -0,0 +1,5 @@ +doc +plugin +po +smb4k +utilities diff --git a/utilities/Makefile.am b/utilities/Makefile.am new file mode 100644 index 0000000..3f8f77d --- /dev/null +++ b/utilities/Makefile.am @@ -0,0 +1,14 @@ +INCLUDES = +METASOURCES = AUTO +bin_PROGRAMS = smb4k_mount smb4k_umount smb4k_kill smb4k_cat smb4k_mv +smb4k_mount_LDFLAGS = $(all_libraries) + +smb4k_umount_LDFLAGS = $(all_libraries) +smb4k_kill_LDFLAGS = $(all_libraries) +smb4k_umount_SOURCES = smb4k_umount.cpp +smb4k_mount_SOURCES = smb4k_mount.cpp +smb4k_kill_SOURCES = smb4k_kill.cpp +smb4k_cat_LDFLAGS = $(all_libraries) +smb4k_cat_SOURCES = smb4k_cat.cpp +smb4k_mv_LDFLAGS = $(all_libraries) +smb4k_mv_SOURCES = smb4k_mv.cpp diff --git a/utilities/smb4k_cat.cpp b/utilities/smb4k_cat.cpp new file mode 100644 index 0000000..ce1387b --- /dev/null +++ b/utilities/smb4k_cat.cpp @@ -0,0 +1,206 @@ +/*************************************************************************** + smb4k_cat - This utility behaves essentially like 'cat'. It is + used to "read" system configuration files and is part of Smb4K. + ------------------- + begin : Mi Nov 2 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#define MAX_LINE_LENGTH 1024 +#define SMB4K_CAT_VERSION "0.8" + +void info() +{ + cout << "This is smb4k_cat (version " << SMB4K_CAT_VERSION << "), the cat utility of Smb4K" << endl; + cout << "Copyright (C) 2005-2007, Alexander Reinholdt" << endl; + cout << endl; + cout << "Usage:" << endl; + cout << " smb4k_cat {file}" << endl; + cout << " smb4k_cat --help" << endl; + cout << " smb4k_cat --version" << endl; + cout << endl; + cout << "Arguments:" << endl; + cout << " {file}\tThe (full) path of the file that should be printed to stdout." << endl; + cout << endl; + cout << " --help\tDisplay this help screen and exit." << endl; + cout << " --version\tDisplay the version information and exit." << endl; + cout << endl; +} + + +void version() +{ + cout << "Version: " << SMB4K_CAT_VERSION << endl; +} + + +int main( int argc, char *argv[] ) +{ + (void) setlocale( LC_ALL, "" ); + + if ( argc < 2 ) + { + info(); + exit( EXIT_FAILURE ); + } + + char *filename = NULL; + + int c; + + while ( 1 ) + { + int option_index = 0; + + static struct option long_options[] = + { + { "help", 0, 0, 0 }, + { "version", 0, 0, 0 }, + { 0, 0, 0, 0 } + }; + + c = getopt_long( argc, argv, "", long_options, &option_index ); + + if ( c == -1 ) + { + break; + } + + switch ( c ) + { + case 0: + { + int len = strlen( long_options[option_index].name ) + 1; + char opt[len]; + opt[0] = '\0'; + (void) strncpy( opt, long_options[option_index].name, len ); + opt[len-1] = '\0'; + + if ( !strncmp( opt, "help", len ) ) + { + info(); + exit( EXIT_SUCCESS ); + } + else if ( !strncmp( opt, "version", len ) ) + { + version(); + exit( EXIT_SUCCESS ); + } + else + { + break; + } + + break; + } + case '?': + { + // Abort the program if an unknown option + // is encountered: + exit( EXIT_FAILURE ); + } + default: + { + break; + } + } + } + + if ( optind < argc ) + { + // If we have an existing regular file, read it, + // display its contents and exit. + while ( optind < argc ) + { + struct stat file_stat; + + if ( lstat( argv[optind], &file_stat ) == -1 ) + { + int err = errno; + cerr << "smb4k_cat: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + + if ( !filename ) + { + int len = strlen( argv[optind] ) + 1; + filename = new char[len]; + filename[0] = '\0'; + (void) strncpy( filename, argv[optind], len ); + filename[len-1] = '\0'; + } + else + { + break; + } + + optind++; + } + } + + if ( filename ) + { + FILE *fd; + + if ( (fd = fopen( filename, "r" )) == NULL ) + { + int err = errno; + cerr << "smb4k_cat: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + + char line[MAX_LINE_LENGTH]; + line[0] = '\0'; + + while ( fgets( line, MAX_LINE_LENGTH, fd ) != NULL ) + { + cout << line; + } + + fclose( fd ); + } + else + { + // This is redundant, but we'll keep it regardless. + cerr << "smb4k_cat: No file specified" << endl; + exit( EXIT_FAILURE ); + } + + exit( EXIT_SUCCESS ); +} + diff --git a/utilities/smb4k_kill.cpp b/utilities/smb4k_kill.cpp new file mode 100644 index 0000000..7c31bfd --- /dev/null +++ b/utilities/smb4k_kill.cpp @@ -0,0 +1,228 @@ +/*************************************************************************** + smb4k_kill - This is the kill utility for Smb4K. + ------------------- + begin : So Sep 26 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#define SMB4K_KILL_VERSION "0.7" + +void info() +{ + cout << "This is smb4k_kill (version " << SMB4K_KILL_VERSION << "), the kill utility of Smb4K" << endl; + cout << "Copyright (C) 2004-2007, Alexander Reinholdt" << endl; + cout << endl; + cout << "Usage:" << endl; + cout << " smb4k_kill {pid}" << endl; + cout << " smb4k_kill --help" << endl; + cout << " smb4k_kill --version" << endl; + cout << endl; + cout << "Arguments:" << endl; + cout << " {pid}\t\tThe ID of the process that should be terminated." << endl; + cout << endl; + cout << " --help\tDisplay this help screen and exit." << endl; + cout << " --version\tDisplay the version information and exit." << endl; + cout << endl; +} + + +void version() +{ + cout << "Version: " << SMB4K_KILL_VERSION << endl; +} + + +bool find_program( const char *name, char *path ) +{ + const char *paths[] = { "/bin/", "/sbin/", "/usr/bin/", "/usr/sbin/", "/usr/local/bin/", "/usr/local/sbin/" }; + string file = ""; + + for ( uint i = 0; i < sizeof( paths ) / sizeof( char * ); i++ ) + { + string p( paths[i] ); + p.append( name ); + + if ( access( p.c_str(), X_OK ) == 0 ) + { + file.assign( p ); + break; + } + } + + if ( !strcmp( file.c_str(), "" ) ) + { + cerr << "smb4k_kill: Could not find " << name << " binary" << endl; + + return false; + } + + int len = strlen( file.c_str() ) + 1; + + (void) strncpy( path, file.c_str(), len ); + path[len-1] = '\0'; + + return true; +} + + +int main( int argc, char *argv[], char *envp[] ) +{ + // Set the locale: + (void) setlocale( LC_ALL, "" ); + + if ( argc < 2 ) + { + info(); + exit( EXIT_FAILURE ); + } + + int new_argc = argc + 1; + char *new_argv[new_argc]; + int index = 0; + char path[255]; + path[0] = '\0'; + + // Get the options that were passed. + int c; + + while ( 1 ) + { + int option_index = 0; + + static struct option long_options[] = + { + { "help", 0, 0, 0 }, + { "version", 0, 0, 0 }, + { 0, 0, 0, 0 } + }; + + c = getopt_long( argc, argv, "", long_options, &option_index ); + + if ( c == -1 ) + { + break; + } + + switch ( c ) + { + case 0: + { + // Copy the option: + int len = strlen( long_options[option_index].name ) + 1; + char opt[len]; + opt[0] = '\0'; + (void) strncpy( opt, long_options[option_index].name, len ); + opt[len-1] = '\0'; + + // Now check which option has been provided: + if ( !strncmp( opt, "help", len ) ) + { + info(); + exit( EXIT_SUCCESS ); + } + else if ( !strncmp( opt, "version", len ) ) + { + version(); + exit( EXIT_SUCCESS ); + } + else + { + break; + } + + break; + } + case '?': + { + // Abort the program if an unknown option + // is encountered: + exit( EXIT_FAILURE ); + } + default: + { + break; + } + } + } + + if ( !find_program( "kill", path ) ) + { + exit( EXIT_FAILURE ); + } + + int len = strlen( path ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, len ); + new_argv[index][len-1] = '\0'; + + index++; + + if ( optind < argc ) + { + while ( optind < argc ) + { + len = strlen( argv[optind] ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], argv[optind], len ); + new_argv[index][len-1] = '\0'; + + optind++; + index++; + } + } + + if ( index >= new_argc ) + { + cerr << "smb4k_kill: There are too many arguments" << endl; + exit( EXIT_FAILURE ); + } + + // Terminate the new argv: + new_argv[index] = NULL; + + // Execute command: + if ( execve( new_argv[0], new_argv, envp ) == -1 ) + { + int err = errno; + cerr << "smb4k_kill: " << strerror( err ) << endl; + + exit( EXIT_FAILURE ); + } + + return EXIT_SUCCESS; +} diff --git a/utilities/smb4k_mount.cpp b/utilities/smb4k_mount.cpp new file mode 100644 index 0000000..2e82f28 --- /dev/null +++ b/utilities/smb4k_mount.cpp @@ -0,0 +1,1033 @@ +/*************************************************************************** + smb4k_mount - This is the mount utility for Smb4K. + ------------------- + begin : Di Sep 21 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#define SMB4K_MOUNT_VERSION "0.10" + +void info() +{ + cout << "This is smb4k_mount (version " << SMB4K_MOUNT_VERSION << "), the mount utility of Smb4K" << endl; + cout << "Copyright (C) 2004-2007, Alexander Reinholdt" << endl; + cout << endl; + cout << "Usage:" << endl; +#ifndef __FreeBSD__ + cout << " smb4k_mount {mode} {options} {share} {mountpoint}" << endl; +#else + cout << " smb4k_mount {options} {share} {mountpoint}" << endl; +#endif + cout << " smb4k_mount --help" << endl; + cout << " smb4k_mount --version" << endl; + cout << endl; + cout << "Arguments:" << endl; +#ifndef __FreeBSD__ + cout << " {mode}" << endl; + cout << " --no-suid\tsmb4k_mount is run in normal user mode, so smbmount or" << endl; + cout << "\t\tmount.cifs is invoked." << endl; + cout << " --suid\tsmb4k_mount is run in super user mode, so mount is invoked." << endl; + cout << " -n\t\tThe same as the '--no-suid' argument." << endl; + cout << " -s\t\tThe same as the '--suid' argument." << endl; + cout << endl; + cout << " {options}" << endl; + cout << " -t \tThe file system that should be used for mounting. Only 'smbfs'" << endl; + cout << "\t\tand 'cifs' are supported. All other file systems will result in" << endl; + cout << "\t\tan error. Note, that this argument is mandatory." << endl; + cout << " -o \tWith this argument you define the options that should be passed" << endl; + cout << "\t\tto the actual mount binary in a comma-separated list. See the" << endl; + cout << "\t\tmanual page of smbmount, mount.cifs, and mount for more"<< endl; + cout << "\t\tinformation." << endl; +#else + cout << " {options}\tAll options that can be passed to mount_smbfs. Please refer to" << endl; + cout << "\t\tthe manual page of mount_smbfs to learn more." << endl; +#endif + cout << endl; + cout << " {share}\tThe SMB share that should be mounted." << endl; + cout << endl; + cout << " {mountpoint}\tThe path where the share should be mounted to." << endl; + cout << endl; + cout << " --help\tDisplay this help sceen and exit." << endl; + cout << " --version\tDisplay the version information and exit." << endl; + cout << endl; +} + + +void version() +{ + cout << "Version " << SMB4K_MOUNT_VERSION << endl; +} + + +bool find_program( const char *name, char *path ) +{ + const char *paths[] = { "/bin/", "/sbin/", "/usr/bin/", "/usr/sbin/", "/usr/local/bin/", "/usr/local/sbin/" }; + string file = ""; + + for ( uint i = 0; i < sizeof( paths ) / sizeof( char * ); i++ ) + { + string p( paths[i] ); + p.append( name ); + + if ( access( p.c_str(), X_OK ) == 0 ) + { + file.assign( p ); + break; + } + } + + if ( !strcmp( file.c_str(), "" ) ) + { + cerr << "smb4k_mount: Could not find " << name << " binary" << endl; + + return false; + } + + int len = strlen( file.c_str() ) + 1; + + (void) strncpy( path, file.c_str(), len ); + path[len-1] = '\0'; + + return true; +} + + +int main( int argc, char *argv[], char *envp[] ) +{ + // First of all, set the locale: + (void) setlocale( LC_ALL, "" ); + + if ( argc < 2 ) + { + info(); + exit( EXIT_FAILURE ); + } + + int new_argc = argc + 1; + char *new_argv[new_argc]; + int index = 0; + char path[255]; + path[0] = '\0'; + bool have_share = false; +#ifndef __FreeBSD__ + bool normal_user_mode = true; + bool have_user_mode = false; + char *mount_options = NULL; + char *filesystem = NULL; +#else + char *charset = NULL; + char *host = NULL; + char *locale = NULL; + char *access_rights = NULL; + char *owner_attributes = NULL; + char *retries = NULL; + char *timeout = NULL; + char *workgroup = NULL; + char *case_opt = NULL; + char *dir_mode = NULL; + char *file_mode = NULL; + char *gid = NULL; + char *uid = NULL; + char *options = NULL; + bool no_password = false; +#endif + + // Get the options that were passed: + int c; + + while ( 1 ) + { + int option_index = 0; + + // FIXME: Under FreeBSD we do not need to determine + // if smb4k_mount is run in super user mode or not, + // because we do only have mount_smbfs available. So, + // in future versions of smb4k_mount, we should remove + // the '--suid' and '--no-suid' argument under FreeBSD. + static struct option long_options[] = + { + { "suid", 0, 0, 0 }, + { "no-suid", 0, 0, 0 }, + { "help", 0, 0, 0 }, + { "version", 0, 0, 0 }, + { 0, 0, 0, 0 } + }; + +#ifndef __FreeBSD__ + c = getopt_long( argc, argv, "o:t:ns", long_options, &option_index ); +#else + c = getopt_long( argc, argv, "E:I:L:M:NO:R:T:W:c:d:f:g:n:u:", long_options, &option_index ); +#endif + + if ( c == -1 ) + { + break; + } + + switch ( c ) + { + case 0: + { + // Get the length of the option string, create a + // new string and copy the option into it: + int len = strlen( long_options[option_index].name ) + 1; + char opt[len]; + opt[0] = '\0'; + (void) strncpy( opt, long_options[option_index].name, len ); + opt[len-1] = '\0'; + + // Now check which option has been provided: + if ( !strncmp( opt, "help", len ) ) + { + info(); + + // That's it. Exit here. + exit( EXIT_SUCCESS ); + } + else if ( !strncmp( opt, "version", len ) ) + { + version(); + + // That's it. Exit here. + exit( EXIT_SUCCESS ); + } +#ifndef __FreeBSD__ + else if ( !strncmp( opt, "suid", len ) ) + { + // Enter super user mode. + + normal_user_mode = false; + have_user_mode = true; + + break; + } + else if ( !strncmp( opt, "no-suid", len ) ) + { + // Entering normal user mode. + + normal_user_mode = true; + have_user_mode = true; + + break; + } +#endif + else + { + break; + } + + break; + } +#ifndef __FreeBSD__ + case 't': + { + // Get the length of the option argument: + int len = strlen( optarg ) + 1; + + if ( strncmp( "smbfs", optarg, len ) != 0 && + strncmp( "cifs", optarg, len ) != 0 ) + { + cerr << "smb4k_mount: File system " << optarg << " is not supported" << endl; + exit( EXIT_FAILURE ); + } + + if ( !filesystem ) + { + filesystem = new char[len]; + filesystem[0] = '\0'; + (void) strncpy( filesystem, optarg, len ); + filesystem[len-1] = '\0'; + } + + break; + } + case 'o': + { + int len = strlen( optarg ) + 1; + + if ( !mount_options ) + { + mount_options = new char[len]; + mount_options[0] = '\0'; + (void) strncpy( mount_options, optarg, len ); + mount_options[len-1] = '\0'; + } + + break; + } + case 's': + { + // Enter super user mode. + + normal_user_mode = false; + have_user_mode = true; + + break; + } + case 'n': + { + // Enter normal user mode. + + normal_user_mode = true; + have_user_mode = true; + + break; + } +#else + case 'E': + { + if ( !charset ) + { + int len = strlen( optarg ) + 1; + charset = new char[len]; + charset[0] = '\0'; + (void) strncpy( charset, optarg, len ); + charset[len-1] = '\0'; + } + + break; + } + case 'I': + { + if ( !host ) + { + int len = strlen( optarg ) + 1; + host = new char[len]; + host[0] = '\0'; + (void) strncpy( host, optarg, len ); + host[len-1] = '\0'; + } + + break; + } + case 'L': + { + if ( !locale ) + { + int len = strlen( optarg ) + 1; + locale = new char[len]; + locale[0] = '\0'; + (void) strncpy( locale, optarg, len ); + locale[len-1] = '\0'; + } + + break; + } + case 'M': + { + if ( !access_rights ) + { + int len = strlen( optarg ) + 1; + access_rights = new char[len]; + access_rights[0] = '\0'; + (void) strncpy( access_rights, optarg, len ); + access_rights[len-1] = '\0'; + } + + break; + } + case 'N': + { + no_password = true; + + break; + } + case 'O': + { + if ( !owner_attributes ) + { + int len = strlen( optarg ) + 1; + owner_attributes = new char[len]; + owner_attributes[0] = '\0'; + (void) strncpy( owner_attributes, optarg, len ); + owner_attributes[len-1] = '\0'; + } + + break; + } + case 'R': + { + if ( !retries ) + { + int len = strlen( optarg ) + 1; + retries = new char[len]; + retries[0] = '\0'; + (void) strncpy( retries, optarg, len ); + retries[len-1] = '\0'; + } + + break; + } + case 'T': + { + if ( !timeout ) + { + int len = strlen( optarg ) + 1; + timeout = new char[len]; + timeout[0] = '\0'; + (void) strncpy( timeout, optarg, len ); + timeout[len-1] = '\0'; + } + + break; + } + case 'W': + { + if ( !workgroup ) + { + int len = strlen( optarg ) + 1; + workgroup = new char[len]; + workgroup[0] = '\0'; + (void) strncpy( workgroup, optarg, len ); + workgroup[len-1] = '\0'; + } + + break; + } + case 'c': + { + if ( !case_opt ) + { + int len = strlen( optarg ) + 1; + case_opt = new char[len]; + case_opt[0] = '\0'; + (void) strncpy( case_opt, optarg, len ); + case_opt[len-1] = '\0'; + } + + break; + } + case 'd': + { + if ( !dir_mode ) + { + int len = strlen( optarg ) + 1; + dir_mode = new char[len]; + dir_mode[0] = '\0'; + (void) strncpy( dir_mode, optarg, len ); + dir_mode[len-1] = '\0'; + } + + break; + } + case 'f': + { + if ( !file_mode ) + { + int len = strlen( optarg ) + 1; + file_mode = new char[len]; + file_mode[0] = '\0'; + (void) strncpy( file_mode, optarg, len ); + file_mode[len-1] = '\0'; + } + + break; + } + case 'g': + { + if ( !gid ) + { + int len = strlen( optarg ) + 1; + gid = new char[len]; + gid[0] = '\0'; + (void) strncpy( gid, optarg, len ); + gid[len-1] = '\0'; + } + + break; + } + case 'n': + { + if ( options ) + { + int len = strlen( optarg ) + 1; + options = new char[len]; + options[0] = '\0'; + (void) strncpy( options, optarg, len ); + options[len-1] = '\0'; + } + + break; + } + case 'u': + { + if ( !uid ) + { + int len = strlen( optarg ) + 1; + uid = new char[len]; + uid[0] = '\0'; + (void) strncpy( uid, optarg, len ); + uid[len-1] = '\0'; + } + + break; + } +#endif + case '?': + { + // Abort the program if an unknown option + // is encountered: + exit( EXIT_FAILURE ); + } + default: + { + break; + } + } + } + +#ifndef __FreeBSD__ + // Error out if no user mode was specified. + if ( !have_user_mode ) + { + cerr << "smb4k_mount: No mode was specified" << endl; + exit( EXIT_FAILURE ); + } + + // Error out if the user did not specify any file system. + if ( !filesystem ) + { + cerr << "smb4k_mount: No file system was specified" << endl; + exit( EXIT_FAILURE ); + } + + if ( normal_user_mode ) + { + int len = strlen( filesystem ) + 1; + + if ( !strncmp( "smbfs", filesystem, len ) ) + { + if ( !find_program( "smbmount", path ) ) + { + exit( EXIT_FAILURE ); + } + } + else + { + if( !find_program( "mount.cifs", path ) ) + { + exit( EXIT_FAILURE ); + } + } + + len = strlen( path ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, len ); + new_argv[index][len-1] = '\0'; + + index++; + + // Add the service name and the mount point. + if ( optind < argc ) + { + while ( optind < argc ) + { + // Check for the share: + if ( (argv[optind][0] == '\057' && argv[optind][1] == '\057') /* slash */ || + (argv[optind][0] == '\134' && argv[optind][1] == '\134') /* back slash */ ) + { + have_share = true; + } + + len = strlen( argv[optind] ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], argv[optind], len ); + new_argv[index][len-1] = '\0'; + + optind++; + index++; + } + } + + // Pass the arguments that were provided with the -o + // option. + // NOTE: smbmount and mount.cifs want the -o argument to be + // the last one in the command string. So, do not change the + // order. + if ( mount_options ) + { + len = strlen( "-o" ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-o", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( mount_options ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], mount_options, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + } + else + { + if ( !find_program( "mount", path ) ) + { + exit( EXIT_FAILURE ); + } + + int len = strlen( path ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( "-t" ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-t", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( filesystem ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], filesystem, len ); + new_argv[index][len-1] = '\0'; + + index++; + + // Pass the arguments that were provided with the -o + // option. + // NOTE: mount wants the -o argument to be in front of + // the service name and mount point. So, do not change the + // order. + if ( mount_options ) + { + len = strlen( "-o" ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-o", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( mount_options ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], mount_options, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + // Add the service name and the mount point. + if ( optind < argc ) + { + while ( optind < argc ) + { + // Check for the share: + if ( (argv[optind][0] == '\057' && argv[optind][1] == '\057') /* slash */ || + (argv[optind][0] == '\134' && argv[optind][1] == '\134') /* back slash */ ) + { + have_share = true; + } + + len = strlen( argv[optind] ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], argv[optind], len ); + new_argv[index][len-1] = '\0'; + + optind++; + index++; + } + } + } +#else + // We do not need to probe for the user mode, because we + // only have mount_smbfs available. Also, we do not have + // to check the file system. There is only one possible... + if ( !find_program( "mount_smbfs", path ) ) + { + exit( EXIT_FAILURE ); + } + + int len = strlen( path ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, len ); + new_argv[index][len-1] = '\0'; + + index++; + + // Add the arguments: + if ( charset ) + { + len = strlen( "-E" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-E", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( charset ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], charset, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( host ) + { + len = strlen( "-I" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-I", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( host ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], host, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( locale ) + { + len = strlen( "-L" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-L", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( locale ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], locale, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( access_rights ) + { + len = strlen( "-M" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index],"-M" , len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( access_rights ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], access_rights, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( no_password ) + { + len = strlen( "-N" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-N", len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( owner_attributes ) + { + len = strlen( "-O" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-O", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( owner_attributes ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], owner_attributes, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( retries ) + { + len = strlen( "-R" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-R", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( retries ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], retries, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( timeout ) + { + len = strlen( "-I" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index],"-I" , len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( timeout ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], timeout, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( workgroup ) + { + len = strlen( "-W" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-W", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( workgroup ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], workgroup, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( case_opt ) + { + len = strlen( "-c" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-c", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( case_opt ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], case_opt, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( dir_mode ) + { + len = strlen( "-d" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-d", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( dir_mode ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], dir_mode, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( file_mode ) + { + len = strlen( "-f" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-f", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( file_mode ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], file_mode, len ); + new_argv[index][len-1] = '\0'; + + index++; + + } + + if ( gid ) + { + len = strlen( "-g" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-g", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( gid ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], gid, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( uid ) + { + len = strlen( "-u" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-u", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( uid ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], uid, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + if ( options ) + { + len = strlen( "-n" ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-n", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( options ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], options, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + // Add the service name and the mount point. + if ( optind < argc ) + { + while ( optind < argc ) + { + // Check for the share: + if ( (argv[optind][0] == '\057' && argv[optind][1] == '\057') /* slash */ || + (argv[optind][0] == '\134' && argv[optind][1] == '\134') /* back slash */ ) + { + have_share = true; + } + + len = strlen( argv[optind] ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], argv[optind], len ); + new_argv[index][len-1] = '\0'; + + optind++; + index++; + } + } +#endif + + if ( !have_share ) + { + cerr << "smb4k_mount: No share was specified" << endl; + exit( EXIT_FAILURE ); + } + + if ( index >= new_argc ) + { + cerr << "smb4k_mount: There are too many arguments" << endl; + exit( EXIT_SUCCESS ); + } + + // Terminate new_argv: + new_argv[index] = NULL; + + // Execute command: + if ( execve( new_argv[0], new_argv, envp ) == -1 ) + { + int err = errno; + cerr << "smb4k_mount: " << strerror( err ) << endl; + + exit( EXIT_FAILURE ); + } + + return EXIT_SUCCESS; +} diff --git a/utilities/smb4k_mv.cpp b/utilities/smb4k_mv.cpp new file mode 100644 index 0000000..7949722 --- /dev/null +++ b/utilities/smb4k_mv.cpp @@ -0,0 +1,388 @@ +/*************************************************************************** + smb4k_mv - This is the move utility of Smb4K + ------------------- + begin : Sa Nov 19 2005 + copyright : (C) 2005-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#define SMB4K_MV_VERSION "0.4" + +void info() +{ + cout << "This is smb4k_mv (version " << SMB4K_MV_VERSION << "), the move utility of Smb4K" << endl; + cout << "Copyright (C) 2005-2007, Alexander Reinholdt" << endl; + cout << endl; + cout << "Usage:" << endl; + cout << " smb4k_mv {user}:{group} {perms} {src} {dest}" << endl; + cout << " smb4k_mv --help" << endl; + cout << " smb4k_mv --version" << endl; + cout << endl; + cout << "Arguments:" << endl; + cout << " {user}\tThe (new) owner of the file" << endl; + cout << endl; + cout << " {group}\tThe (new) group of the file" << endl; + cout << endl; + cout << " {perms}\tThe new permissions of the file" << endl; + cout << endl; + cout << " {src}\t\tThe (full) path of the source file" << endl; + cout << endl; + cout << " {dest}\tThe destination where the file will be moved to" << endl; + cout << endl; + cout << " --help\tDisplay this help screen and exit." << endl; + cout << " --version\tDisplay the version information and exit." << endl; + cout << endl; +} + + +void version() +{ + cout << "Version: " << SMB4K_MV_VERSION << endl; +} + + +bool find_program( const char *name, char *path ) +{ + const char *paths[] = { "/bin/", "/sbin/", "/usr/bin/", "/usr/sbin/", "/usr/local/bin/", "/usr/local/sbin/" }; + string file = ""; + + for ( uint i = 0; i < sizeof( paths ) / sizeof( char * ); i++ ) + { + string p( paths[i] ); + p.append( name ); + + if ( access( p.c_str(), X_OK ) == 0 ) + { + file.assign( p ); + break; + } + } + + if ( !strcmp( file.c_str(), "" ) ) + { + cerr << "smb4k_mv: Could not find " << name << " binary" << endl; + + return false; + } + + int len = strlen( file.c_str() ) + 1; + (void) strncpy( path, file.c_str(), len ); + path[len-1] = '\0'; + + return true; +} + + +int main( int argc, char *argv[], char *envp[] ) +{ + (void) setlocale( LC_ALL, "" ); + + if ( argc < 2 ) + { + info(); + exit( EXIT_FAILURE ); + } + + char *user_group = NULL; + char *permissions = NULL; + char *source = NULL; + char *destination = NULL; + + int c; + + while ( 1 ) + { + int option_index = 0; + + static struct option long_options[] = + { + { "help", 0, 0, 0 }, + { "version", 0, 0, 0 }, + { 0, 0, 0, 0 } + }; + + c = getopt_long( argc, argv, "", long_options, &option_index ); + + if ( c == -1 ) + { + break; + } + + switch ( c ) + { + case 0: + { + // Get the length of the option string, create a + // new string and copy the option into it: + int len = strlen( long_options[option_index].name ) + 1; + char opt[len]; + opt[0] = '\0'; + (void) strncpy( opt, long_options[option_index].name, len ); + opt[len-1] = '\0'; + + // Now check which option has been provided: + if ( !strncmp( opt, "help", len ) ) + { + info(); + + // That's it. Exit here. + exit( EXIT_SUCCESS ); + } + else if ( !strncmp( opt, "version", len ) ) + { + version(); + + // That's it. Exit here. + exit( EXIT_SUCCESS ); + } + else + { + break; + } + + break; + } + case '?': + { + // Abort the program if an unknown option + // is encountered: + exit( EXIT_FAILURE ); + } + default: + { + break; + } + } + } + + if ( optind < argc ) + { + while ( optind < argc ) + { + if ( optind == 1 ) + { + if ( strchr( argv[optind], ':' ) ) + { + int len = strlen( argv[optind] ) + 1; + user_group = new char[len]; + user_group[0] = '\0'; + (void) strncpy( user_group, argv[optind], len ); + user_group[len-1] = '\0'; + } + else + { + cerr << "smb4k_mv: First argument must contain a colon" << endl; + exit( EXIT_FAILURE ); + } + } + else if ( optind == 2 ) + { + int i = 0; + + while ( argv[optind][i] ) + { + if ( !isdigit( argv[optind][i] ) ) + { + cerr << "smb4k_mv: Second argument must only contain digits" << endl; + exit( EXIT_FAILURE ); + } + + i++; + } + + int len = strlen( argv[optind] ) + 1; + permissions = new char[len]; + permissions[0] = '\0'; + (void) strncpy( permissions, argv[optind], len ); + permissions[len-1] = '\0'; + } + else if ( optind == 3 ) + { + // We only want regular files to be moved: + struct stat file_stat; + + if ( lstat( argv[optind], &file_stat ) == -1 ) + { + int err = errno; + cerr << "smb4k_mv: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + + if ( !S_ISREG( file_stat.st_mode ) || + S_ISFIFO( file_stat.st_mode ) || + S_ISLNK( file_stat.st_mode ) ) + { + cerr << "smb4k_mv: '" << argv[optind] << "' is not a regular file" << endl; + exit( EXIT_FAILURE ); + } + + int len = strlen( argv[optind] ) + 1; + source = new char[len]; + source[0] = '\0'; + (void) strncpy( source, argv[optind], len ); + source[len-1] = '\0'; + } + else if ( optind == 4 ) + { + // Be sure that the destination either does not + // exist or that it is a regular file: + struct stat file_stat; + bool file_exists = true; + + if ( lstat( argv[optind], &file_stat ) == -1 ) + { + int err = errno; + + // If the file does not exist, that's very good + // for our purposes. Do not error out in that case. + if ( err != ENOENT ) + { + cerr << "smb4k_mv: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + else + { + file_exists = false; + } + } + + if ( file_exists ) + { + if ( !S_ISREG( file_stat.st_mode ) || + S_ISFIFO( file_stat.st_mode ) || + S_ISLNK( file_stat.st_mode ) ) + { + cerr << "smb4k_mv: '" << argv[optind] << "' is not a regular file" << endl; + exit( EXIT_FAILURE ); + } + } + + int len = strlen( argv[optind] ) + 1; + destination = new char[len]; + destination[0] = '\0'; + (void) strncpy( destination, argv[optind], len ); + destination[len-1] = '\0'; + } + else + { + cerr << "smb4k_mv: There are too many arguments" << endl; + exit( EXIT_FAILURE ); + } + + optind++; + } + } + + int i; + + // Change owner and group: + char chown_prog[255]; + chown_prog[0] = '\0'; + + if ( !find_program( "chown", chown_prog ) ) + { + exit( EXIT_FAILURE ); + } + + char *chown_argv[] = { chown_prog, user_group, source, NULL }; + + if ( fork() == 0 ) + { + if ( (i = execve( chown_argv[0], chown_argv, envp )) == -1 ) + { + int err = errno; + cerr << "smb4k_mv: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + } + else + { + wait( &i ); + } + + // Apply new permissions: + char chmod_prog[255]; + chmod_prog[0] = '\0'; + + if ( !find_program( "chmod", chmod_prog ) ) + { + exit( EXIT_FAILURE ); + } + + char *chmod_argv[] = { chmod_prog, permissions, source, NULL }; + + if ( fork() == 0 ) + { + if ( (i = execve( chmod_argv[0], chmod_argv, envp )) == -1 ) + { + int err = errno; + cerr << "smb4k_mv: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + } + else + { + wait( &i ); + } + + // Now, finally, move the file: + char mv_prog[255]; + mv_prog[0] = '\0'; + + if ( !find_program( "mv", mv_prog ) ) + { + exit( EXIT_FAILURE ); + } + + char *mv_argv[] = { mv_prog, source, destination, NULL }; + + if ( fork() == 0 ) + { + if ( (i = execve( mv_argv[0], mv_argv, envp )) == -1 ) + { + int err = errno; + cerr << "smb4k_mv: " << strerror( err ) << endl; + exit( EXIT_FAILURE ); + } + } + else + { + wait( &i ); + } + + return EXIT_SUCCESS; +} + diff --git a/utilities/smb4k_umount.cpp b/utilities/smb4k_umount.cpp new file mode 100644 index 0000000..23eb266 --- /dev/null +++ b/utilities/smb4k_umount.cpp @@ -0,0 +1,570 @@ +/*************************************************************************** + smb4k_umount - This is the unmount utility of Smb4K. + ------------------- + begin : Sa Sep 25 2004 + copyright : (C) 2004-2007 by Alexander Reinholdt + email : dustpuppy@users.berlios.de + ***************************************************************************/ + +/*************************************************************************** + * 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. * + * * + * This program is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#if !defined(__FreeBSD__) && !defined(__solaris__) && !defined(USE_SOLARIS) +#include +#elif defined(__solaris__) || defined(USE_SOLARIS) +#include +#include +#elif defined(__FreeBSD__) +#include +#include +#endif + +#ifdef __linux__ +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#define SMB4K_UMOUNT_VERSION "0.14" + + +void info() +{ + cout << "This is smb4k_umount (version " << SMB4K_UMOUNT_VERSION << "), the unmount utility of Smb4K" << endl; + cout << "Copyright (C) 2004-2007, Alexander Reinholdt" << endl; + cout << endl; + cout << "Usage:" << endl; +#ifndef __FreeBSD__ + cout << " smb4k_umount {mode} {options} {mountpoint}" << endl; +#else + cout << " smb4k_umount {mountpoint}" << endl; +#endif + cout << " smb4k_umount --help" << endl; + cout << " smb4k_umount --version" << endl; + cout << endl; + cout << "Arguments:" << endl; + cout << " {mode}" << endl; +#ifndef __FreeBSD__ + cout << " --no-suid\tsmb4k_umount is run in normal user mode, so smbumount or" << endl; + cout << "\t\tumount.cifs is invoked." << endl; + cout << " --suid\tsmb4k_umount is run in super user mode, so umount is invoked." << endl; + cout << " -n\t\tThe same as the '--no-suid' argument." << endl; + cout << " -s\t\tThe same as the '--suid' argument." << endl; + cout << endl; + cout << " {options}" << endl; + cout << " -t \tThe file system that should be used for unmounting. Only 'smbfs'" << endl; + cout << "\t\tand 'cifs' are supported. All other file systems will result in" << endl; + cout << "\t\tan error. Please note, that this argument is mandatory." << endl; +#endif +#ifdef __linux__ + cout << " -l\t\tPerform a lazy unmount. See the manual page of umount for" << endl; + cout << "\t\tmore information. Please note, that this argument is only" << endl; + cout << "\t\trecognized in super user mode, i.e. if '--suid' is supplied," << endl; + cout << "\t\tand that you need kernel version 2.4.11 or later." << endl; +#endif + cout << endl; + cout << " {mountpoint}\tThe path where the share is mounted to." << endl; + cout << endl; + cout << " --help\tDisplay this help screen and exit." << endl; + cout << " --version\tDisplay the version information and exit." << endl; + cout << endl; +} + + +void version() +{ + cout << "Version " << SMB4K_UMOUNT_VERSION << endl; +} + + +bool find_program( const char *name, char *path ) +{ + const char *paths[] = { "/bin/", "/sbin/", "/usr/bin/", "/usr/sbin/", "/usr/local/bin/", "/usr/local/sbin/" }; + string file = ""; + + for ( uint i = 0; i < sizeof( paths ) / sizeof( char * ); i++ ) + { + string p( paths[i] ); + p.append( name ); + + if ( access( p.c_str(), X_OK ) == 0 ) + { + file.assign( p ); + break; + } + } + + if ( !strcmp( file.c_str(), "" ) ) + { + cerr << "smb4k_umount: Could not find " << name << " binary" << endl; + + return false; + } + + int len = strlen( file.c_str() ) + 1; + strncpy( path, file.c_str(), len ); + path[len-1] = '\0'; + + return true; +} + + +bool check_filesystem( const char *path, const char *fs ) +{ + bool ok = false; + +#if !defined(__solaris__) && !defined(USE_SOLARIS) + struct statfs filesystem; +#else + struct statvfs filesystem; +#endif + +#if !defined(__solaris__) && !defined(USE_SOLARIS) && !defined(__irix__) + if ( statfs( path, &filesystem ) == -1 ) +#elif defined(__irix__) + if ( statfs( path, &filesystem, sizeof( filesystem ), 0 ) == -1 ) +#else + if ( statvfs( path, &filesystem ) == -1 ) +#endif + { + int err_code = errno; + + if ( err_code != EIO && err_code != EACCES ) + { + // ok is still FALSE + cerr << "smb4k_umount: " << strerror( err_code ) << endl; + } + else + { + ok = true; // Bypass the check below, because it would yield ok == FALSE + // and we want to be able to unmount broken shares as well. + } + + return ok; + } + +#if !defined(__FreeBSD__) && !defined(__solaris__) && !defined(USE_SOLARIS) && !defined(__irix__) + // First entry is for CIFS, the second for SMBFS. + if ( (uint)filesystem.f_type == 0xFF534D42 && !strncmp( fs, "cifs", strlen( fs )+1 ) ) + { + ok = true; + } + else if ( (uint)filesystem.f_type == 0x517B && !strncmp( fs, "smbfs", strlen( fs )+1 ) ) + { + ok = true; + } +#elif defined(__FreeBSD__) + if ( !strncmp( filesystem.f_fstypename, fs, strlen( fs ) ) ) + { + ok = true; + } +#elif defined(__solaris__) || defined(USE_SOLARIS) + if ( (uint)filesystem.f_basetype == 0xFF534D42 && !strncmp( fs, "cifs", strlen( fs )+1 ) ) + { + ok = true; + } + else if ( (uint)filesystem.f_basetype == 0x517B && !strncmp( fs, "smbfs", strlen( fs )+1 ) ) + { + ok = true; + } +#elif defined(__irix__) + if ( (uint)filesystem.f_fstyp == 0xFF534D42 && !strncmp( fs, "cifs", strlen( fs )+1 ) ) + { + ok = true; + } + else if ( (uint)filesystem.f_basetype == 0x517B && !strncmp( fs, "smbfs", strlen( fs )+1 ) ) + { + ok = true; + } +#endif + else + { + // ok is still FALSE. + cerr << "smb4k_umount: Wrong file system specified" << endl; + } + + return ok; +} + + +int main( int argc, char *argv[], char *envp[] ) +{ + // First of all, set the locale + (void) setlocale( LC_ALL, "" ); + + if ( argc < 2 ) + { + info(); + exit( EXIT_FAILURE ); + } + + int new_argc = argc + 1; + char *new_argv[new_argc]; + int index = 0; + char path[255]; + path[0] = '\0'; + char *mountpoint = NULL; +#ifndef __FreeBSD__ + char *filesystem = NULL; + bool normal_user_mode = true; + bool have_user_mode = false; +#ifdef __linux__ + bool lazy_unmount = false; +#endif +#endif + + // Get the options that were passed: + int c; + + while ( 1 ) + { + int option_index = 0; + + static struct option long_options[] = + { + { "help", 0, 0, 0 }, + { "version", 0, 0, 0 }, +#ifndef __FreeBSD__ + { "suid", 0, 0, 0 }, + { "no-suid", 0, 0, 0 }, +#endif + { 0, 0, 0, 0 } + }; +#ifdef __linux__ + c = getopt_long( argc, argv, "t:nsl", long_options, &option_index ); +#else +#ifndef __FreeBSD__ + c = getopt_long( argc, argv, "t:ns", long_options, &option_index ); +#else + c = getopt_long( argc, argv, "", long_options, &option_index ); +#endif +#endif + + if ( c == -1 ) + { + break; + } + + switch ( c ) + { + case 0: + { + int len = strlen( long_options[option_index].name ) + 1; + char opt[len]; + opt[0] = '\0'; + (void) strncpy( opt, long_options[option_index].name, len ); + opt[len-1] = '\0'; + + if ( !strncmp( opt, "help", len ) ) + { + info(); + + exit( EXIT_SUCCESS ); + } + else if ( !strncmp( opt, "version", len ) ) + { + version(); + + exit( EXIT_SUCCESS ); + } +#ifndef __FreeBSD__ + else if ( !strncmp( opt, "suid", len ) ) + { + // Enter super user mode + + normal_user_mode = false; + have_user_mode = true; + + break; + } + else if ( !strncmp( opt, "no-suid", len ) ) + { + // Enter normal user mode + + normal_user_mode = true; + have_user_mode = true; + + break; + } +#endif + else + { + break; + } + + break; + } +#ifndef __FreeBSD__ + case 't': + { + // Get the length of the option argument: + int len = strlen( optarg ) + 1; + + if ( strncmp( "smbfs", optarg, len) != 0 && + strncmp( "cifs", optarg, len ) != 0 ) + { + cerr << "smb4k_umount: File system " << optarg << " is not supported" << endl; + exit( EXIT_FAILURE ); + } + + if ( !filesystem ) + { + filesystem = new char[len]; + filesystem[0] = '\0'; + (void) strncpy( filesystem, optarg, len ); + filesystem[len-1] = '\0'; + } + + break; + } + case 's': + { + // Enter super user mode + normal_user_mode = false; + have_user_mode = true; + + break; + } + case 'n': + { + // Enter normal user mode + normal_user_mode = true; + have_user_mode = true; + + break; + } +#endif +#ifdef __linux__ + case 'l': + { + // Initiate a lazy unmount. The umount binary + // will complain, if '-l' is not supported. + lazy_unmount = true; + + break; + } +#endif + case '?': + { + // Abort the program if an unknown option + // is encountered: + exit( EXIT_FAILURE ); + } + default: + { + break; + } + }; + } + +#ifndef __FreeBSD__ + // Error out if no user mode was specified. + if ( !have_user_mode ) + { + cerr << "smb4k_umount: No mode was specified" << endl; + exit( EXIT_FAILURE ); + } + + // Error out if the user did not specify any file system. + if ( !filesystem ) + { + cerr << "smb4k_umount: No file system was specified" << endl; + exit( EXIT_FAILURE ); + } + + if ( normal_user_mode ) + { + int len = strlen( filesystem ) + 1; + + if ( !strncmp( "smbfs", filesystem, len ) ) + { + if ( !find_program( "smbumount", path ) ) + { + exit( EXIT_FAILURE ); + } + } + else + { + if ( !find_program( "umount.cifs", path ) ) + { + exit( EXIT_FAILURE ); + } + } + + len = strlen( path ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + else + { + if ( !find_program( "umount", path ) ) + { + exit( EXIT_FAILURE ); + } + + int len = strlen( path ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( "-t" ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-t", len ); + new_argv[index][len-1] = '\0'; + + index++; + + len = strlen( filesystem ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], filesystem, len ); + new_argv[index][len-1] = '\0'; + + index++; + +#ifdef __linux__ + // Lazy unmount? + if ( lazy_unmount ) + { + len = strlen( "-l" ) + 1; + + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], "-l", len ); + new_argv[index][len-1] = '\0'; + + index++; + } +#endif + } +#else + // We do not need to care about the user mode and + // we also need not to check for the file system, + // since there is only one. + if ( !find_program( "umount", path ) ) + { + exit( EXIT_FAILURE ); + } + + int length = strlen( path ) + 1; + new_argv[index] = new char[length]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], path, length ); + new_argv[index][length-1] = '\0'; + + index++; +#endif + + // Add the mount point: + if ( optind < argc ) + { + while ( optind < argc ) + { + if ( !mountpoint ) + { + if ( argv[optind][0] != '\057' ) + { + cerr << "smb4k_umount: Argument " << optind << " is not a mount point" << endl; + exit( EXIT_FAILURE ); + } +#ifndef __FreeBSD__ + if ( !check_filesystem( argv[optind], filesystem ) ) +#else + if ( !check_filesystem( argv[optind], "smbfs" ) ) +#endif + { + // Error message is given by check_filesystem() + exit( EXIT_FAILURE ); + } + + int len = strlen( argv[optind] ) + 1; + + mountpoint = new char[len]; + mountpoint[0] = '\0'; + (void) strncpy( mountpoint, argv[optind], len ); + mountpoint[len-1] = '\0'; + + optind++; + } + else + { + break; + } + } + } + + if ( !mountpoint ) + { + cerr << "smb4k_umount: No mount point was specified" << endl; + exit( EXIT_FAILURE ); + } + else + { + int len = strlen( mountpoint ) + 1; + new_argv[index] = new char[len]; + new_argv[index][0] = '\0'; + (void) strncpy( new_argv[index], mountpoint, len ); + new_argv[index][len-1] = '\0'; + + index++; + } + + + if ( index >= new_argc ) + { + cerr << "smb4k_umount: There are too many arguments" << endl; + exit( EXIT_FAILURE ); + } + + // Terminate new_argv: + new_argv[index] = NULL; + + // Execute command: + if ( execve( new_argv[0], new_argv, envp ) == -1 ) + { + int err = errno; + cerr << "smb4k_umount: " << strerror( err ) << endl; + + exit( EXIT_FAILURE ); + } + + return EXIT_SUCCESS; +} +