From faaa4398461552fdd3ae72b74d6d3f57407fced1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ChangZhuo=20Chen=20=28=E9=99=B3=E6=98=8C=E5=80=AC=29?= Date: Thu, 17 Dec 2015 09:41:19 +0800 Subject: [PATCH] Cherry-pick upstream version 0.10.1 --- AUTHORS | 5 +- CMakeLists.txt | 63 +- COPYING => LICENSE | 0 README.md | 12 +- libfm-qt/CMakeLists.txt | 150 -- libfm-qt/app-chooser-dialog.ui | 183 --- libfm-qt/appchoosercombobox.cpp | 154 -- libfm-qt/appchoosercombobox.h | 61 - libfm-qt/appchooserdialog.cpp | 286 ---- libfm-qt/appchooserdialog.h | 74 - libfm-qt/applaunchcontext.cpp | 61 - libfm-qt/applaunchcontext.h | 50 - libfm-qt/appmenuview.cpp | 159 -- libfm-qt/appmenuview.h | 73 - libfm-qt/appmenuview_p.h | 74 - libfm-qt/bookmarkaction.cpp | 30 - libfm-qt/bookmarkaction.h | 54 - libfm-qt/browsehistory.cpp | 87 -- libfm-qt/browsehistory.h | 131 -- libfm-qt/cachedfoldermodel.cpp | 73 - libfm-qt/cachedfoldermodel.h | 51 - libfm-qt/colorbutton.cpp | 51 - libfm-qt/colorbutton.h | 55 - libfm-qt/createnewmenu.cpp | 90 -- libfm-qt/createnewmenu.h | 51 - libfm-qt/dirtreemodel.cpp | 205 --- libfm-qt/dirtreemodel.h | 90 -- libfm-qt/dirtreemodelitem.cpp | 339 ----- libfm-qt/dirtreemodelitem.h | 84 -- libfm-qt/dirtreeview.cpp | 296 ---- libfm-qt/dirtreeview.h | 95 -- libfm-qt/dndactionmenu.cpp | 50 - libfm-qt/dndactionmenu.h | 47 - libfm-qt/dnddest.cpp | 71 - libfm-qt/dnddest.h | 53 - libfm-qt/edit-bookmarks.ui | 143 -- libfm-qt/editbookmarksdialog.cpp | 109 -- libfm-qt/editbookmarksdialog.h | 53 - libfm-qt/exec-file.ui | 163 -- libfm-qt/execfiledialog.cpp | 70 - libfm-qt/execfiledialog_p.h | 54 - libfm-qt/file-operation-dialog.ui | 171 --- libfm-qt/file-props.ui | 736 ---------- libfm-qt/filelauncher.cpp | 121 -- libfm-qt/filelauncher.h | 87 -- libfm-qt/filemenu.cpp | 396 ----- libfm-qt/filemenu.h | 208 --- libfm-qt/filemenu_p.h | 84 -- libfm-qt/fileoperation.cpp | 304 ---- libfm-qt/fileoperation.h | 164 --- libfm-qt/fileoperationdialog.cpp | 176 --- libfm-qt/fileoperationdialog.h | 63 - libfm-qt/filepropsdialog.cpp | 441 ------ libfm-qt/filepropsdialog.h | 97 -- libfm-qt/filesearch.ui | 449 ------ libfm-qt/filesearchdialog.cpp | 143 -- libfm-qt/filesearchdialog.h | 56 - libfm-qt/fm-search.c | 317 ---- libfm-qt/fm-search.h | 88 -- libfm-qt/folderitemdelegate.cpp | 216 --- libfm-qt/folderitemdelegate.h | 59 - libfm-qt/foldermenu.cpp | 232 --- libfm-qt/foldermenu.h | 127 -- libfm-qt/foldermodel.cpp | 556 ------- libfm-qt/foldermodel.h | 121 -- libfm-qt/foldermodelitem.cpp | 93 -- libfm-qt/foldermodelitem.h | 71 - libfm-qt/folderview.cpp | 970 ------------ libfm-qt/folderview.h | 169 --- libfm-qt/folderview_p.h | 109 -- libfm-qt/fontbutton.cpp | 55 - libfm-qt/fontbutton.h | 54 - libfm-qt/icontheme.cpp | 143 -- libfm-qt/icontheme.h | 69 - libfm-qt/libfm-qt.pc.in | 12 - libfm-qt/libfmqt.cpp | 79 - libfm-qt/libfmqt.h | 47 - libfm-qt/libfmqtglobals.h | 30 - libfm-qt/mount-operation-password.ui | 205 --- libfm-qt/mountoperation.cpp | 227 --- libfm-qt/mountoperation.h | 155 -- libfm-qt/mountoperationpassworddialog.cpp | 125 -- libfm-qt/mountoperationpassworddialog_p.h | 64 - libfm-qt/mountoperationquestiondialog.cpp | 71 - libfm-qt/mountoperationquestiondialog_p.h | 51 - libfm-qt/path.cpp | 22 - libfm-qt/path.h | 247 ---- libfm-qt/pathedit.cpp | 195 --- libfm-qt/pathedit.h | 64 - libfm-qt/placesmodel.cpp | 521 ------- libfm-qt/placesmodel.h | 131 -- libfm-qt/placesmodelitem.cpp | 190 --- libfm-qt/placesmodelitem.h | 130 -- libfm-qt/placesview.cpp | 418 ------ libfm-qt/placesview.h | 109 -- libfm-qt/proxyfoldermodel.cpp | 278 ---- libfm-qt/proxyfoldermodel.h | 109 -- libfm-qt/rename-dialog.ui | 204 --- libfm-qt/renamedialog.cpp | 137 -- libfm-qt/renamedialog.h | 83 -- libfm-qt/sidepane.cpp | 247 ---- libfm-qt/sidepane.h | 134 -- libfm-qt/thumbnailloader.cpp | 197 --- libfm-qt/thumbnailloader.h | 99 -- libfm-qt/translations/libfm-qt.ts | 1265 ---------------- libfm-qt/translations/libfm-qt_ar.ts | 1265 ---------------- libfm-qt/translations/libfm-qt_cs_CZ.ts | 1288 ---------------- libfm-qt/translations/libfm-qt_de.ts | 1293 ---------------- libfm-qt/translations/libfm-qt_el.ts | 1285 ---------------- libfm-qt/translations/libfm-qt_es.ts | 1293 ---------------- libfm-qt/translations/libfm-qt_fr.ts | 1290 ---------------- libfm-qt/translations/libfm-qt_gl.ts | 1290 ---------------- libfm-qt/translations/libfm-qt_hu.ts | 1294 ---------------- libfm-qt/translations/libfm-qt_it.ts | 1297 ---------------- libfm-qt/translations/libfm-qt_ja.ts | 1302 ---------------- libfm-qt/translations/libfm-qt_lt_LT.ts | 1301 ---------------- libfm-qt/translations/libfm-qt_pl.ts | 1293 ---------------- libfm-qt/translations/libfm-qt_pt.ts | 1301 ---------------- libfm-qt/translations/libfm-qt_ru.ts | 1277 ---------------- libfm-qt/translations/libfm-qt_ru_RU.ts | 1277 ---------------- libfm-qt/translations/libfm-qt_zh_TW.ts | 1305 ----------------- libfm-qt/utilities.cpp | 326 ---- libfm-qt/utilities.h | 71 - libfm-qt/utilities_p.h | 79 - pcmanfm-qt.1.in | 8 +- pcmanfm/CMakeLists.txt | 39 +- pcmanfm/application.cpp | 15 +- pcmanfm/application.h | 4 +- pcmanfm/autorundialog.cpp | 6 +- pcmanfm/desktop-preferences.ui | 4 +- pcmanfm/desktopitemdelegate.cpp | 59 +- pcmanfm/desktopitemdelegate.h | 3 + pcmanfm/desktoppreferencesdialog.cpp | 4 +- pcmanfm/desktopwindow.cpp | 104 +- pcmanfm/launcher.h | 2 +- pcmanfm/main-win.ui | 90 +- pcmanfm/mainwindow.cpp | 71 +- pcmanfm/mainwindow.h | 9 + pcmanfm/pcmanfm.cpp | 2 +- pcmanfm/preferencesdialog.cpp | 5 +- pcmanfm/settings.cpp | 18 +- pcmanfm/settings.h | 8 +- pcmanfm/tabpage.cpp | 28 +- pcmanfm/tabpage.h | 9 +- .../pcmanfm-qt-desktop-pref_ru.desktop | 4 + .../pcmanfm-qt-desktop-pref_ru_RU.desktop | 4 + pcmanfm/translations/pcmanfm-qt_fr.ts | 149 +- pcmanfm/translations/pcmanfm-qt_hu.ts | 548 ++++--- pcmanfm/translations/pcmanfm-qt_it.ts | 204 +-- pcmanfm/translations/pcmanfm-qt_ru.desktop | 4 + pcmanfm/translations/pcmanfm-qt_ru.ts | 563 +++---- pcmanfm/translations/pcmanfm-qt_ru_RU.desktop | 4 + pcmanfm/translations/pcmanfm-qt_ru_RU.ts | 563 +++---- pcmanfm/view.cpp | 48 +- pcmanfm/view.h | 2 +- 155 files changed, 1437 insertions(+), 39262 deletions(-) rename COPYING => LICENSE (100%) delete mode 100644 libfm-qt/CMakeLists.txt delete mode 100644 libfm-qt/app-chooser-dialog.ui delete mode 100644 libfm-qt/appchoosercombobox.cpp delete mode 100644 libfm-qt/appchoosercombobox.h delete mode 100644 libfm-qt/appchooserdialog.cpp delete mode 100644 libfm-qt/appchooserdialog.h delete mode 100644 libfm-qt/applaunchcontext.cpp delete mode 100644 libfm-qt/applaunchcontext.h delete mode 100644 libfm-qt/appmenuview.cpp delete mode 100644 libfm-qt/appmenuview.h delete mode 100644 libfm-qt/appmenuview_p.h delete mode 100644 libfm-qt/bookmarkaction.cpp delete mode 100644 libfm-qt/bookmarkaction.h delete mode 100644 libfm-qt/browsehistory.cpp delete mode 100644 libfm-qt/browsehistory.h delete mode 100644 libfm-qt/cachedfoldermodel.cpp delete mode 100644 libfm-qt/cachedfoldermodel.h delete mode 100644 libfm-qt/colorbutton.cpp delete mode 100644 libfm-qt/colorbutton.h delete mode 100644 libfm-qt/createnewmenu.cpp delete mode 100644 libfm-qt/createnewmenu.h delete mode 100644 libfm-qt/dirtreemodel.cpp delete mode 100644 libfm-qt/dirtreemodel.h delete mode 100644 libfm-qt/dirtreemodelitem.cpp delete mode 100644 libfm-qt/dirtreemodelitem.h delete mode 100644 libfm-qt/dirtreeview.cpp delete mode 100644 libfm-qt/dirtreeview.h delete mode 100644 libfm-qt/dndactionmenu.cpp delete mode 100644 libfm-qt/dndactionmenu.h delete mode 100644 libfm-qt/dnddest.cpp delete mode 100644 libfm-qt/dnddest.h delete mode 100644 libfm-qt/edit-bookmarks.ui delete mode 100644 libfm-qt/editbookmarksdialog.cpp delete mode 100644 libfm-qt/editbookmarksdialog.h delete mode 100644 libfm-qt/exec-file.ui delete mode 100644 libfm-qt/execfiledialog.cpp delete mode 100644 libfm-qt/execfiledialog_p.h delete mode 100644 libfm-qt/file-operation-dialog.ui delete mode 100644 libfm-qt/file-props.ui delete mode 100644 libfm-qt/filelauncher.cpp delete mode 100644 libfm-qt/filelauncher.h delete mode 100644 libfm-qt/filemenu.cpp delete mode 100644 libfm-qt/filemenu.h delete mode 100644 libfm-qt/filemenu_p.h delete mode 100644 libfm-qt/fileoperation.cpp delete mode 100644 libfm-qt/fileoperation.h delete mode 100644 libfm-qt/fileoperationdialog.cpp delete mode 100644 libfm-qt/fileoperationdialog.h delete mode 100644 libfm-qt/filepropsdialog.cpp delete mode 100644 libfm-qt/filepropsdialog.h delete mode 100644 libfm-qt/filesearch.ui delete mode 100644 libfm-qt/filesearchdialog.cpp delete mode 100644 libfm-qt/filesearchdialog.h delete mode 100644 libfm-qt/fm-search.c delete mode 100644 libfm-qt/fm-search.h delete mode 100644 libfm-qt/folderitemdelegate.cpp delete mode 100644 libfm-qt/folderitemdelegate.h delete mode 100644 libfm-qt/foldermenu.cpp delete mode 100644 libfm-qt/foldermenu.h delete mode 100644 libfm-qt/foldermodel.cpp delete mode 100644 libfm-qt/foldermodel.h delete mode 100644 libfm-qt/foldermodelitem.cpp delete mode 100644 libfm-qt/foldermodelitem.h delete mode 100644 libfm-qt/folderview.cpp delete mode 100644 libfm-qt/folderview.h delete mode 100644 libfm-qt/folderview_p.h delete mode 100644 libfm-qt/fontbutton.cpp delete mode 100644 libfm-qt/fontbutton.h delete mode 100644 libfm-qt/icontheme.cpp delete mode 100644 libfm-qt/icontheme.h delete mode 100644 libfm-qt/libfm-qt.pc.in delete mode 100644 libfm-qt/libfmqt.cpp delete mode 100644 libfm-qt/libfmqt.h delete mode 100644 libfm-qt/libfmqtglobals.h delete mode 100644 libfm-qt/mount-operation-password.ui delete mode 100644 libfm-qt/mountoperation.cpp delete mode 100644 libfm-qt/mountoperation.h delete mode 100644 libfm-qt/mountoperationpassworddialog.cpp delete mode 100644 libfm-qt/mountoperationpassworddialog_p.h delete mode 100644 libfm-qt/mountoperationquestiondialog.cpp delete mode 100644 libfm-qt/mountoperationquestiondialog_p.h delete mode 100644 libfm-qt/path.cpp delete mode 100644 libfm-qt/path.h delete mode 100644 libfm-qt/pathedit.cpp delete mode 100644 libfm-qt/pathedit.h delete mode 100644 libfm-qt/placesmodel.cpp delete mode 100644 libfm-qt/placesmodel.h delete mode 100644 libfm-qt/placesmodelitem.cpp delete mode 100644 libfm-qt/placesmodelitem.h delete mode 100644 libfm-qt/placesview.cpp delete mode 100644 libfm-qt/placesview.h delete mode 100644 libfm-qt/proxyfoldermodel.cpp delete mode 100644 libfm-qt/proxyfoldermodel.h delete mode 100644 libfm-qt/rename-dialog.ui delete mode 100644 libfm-qt/renamedialog.cpp delete mode 100644 libfm-qt/renamedialog.h delete mode 100644 libfm-qt/sidepane.cpp delete mode 100644 libfm-qt/sidepane.h delete mode 100644 libfm-qt/thumbnailloader.cpp delete mode 100644 libfm-qt/thumbnailloader.h delete mode 100644 libfm-qt/translations/libfm-qt.ts delete mode 100644 libfm-qt/translations/libfm-qt_ar.ts delete mode 100644 libfm-qt/translations/libfm-qt_cs_CZ.ts delete mode 100644 libfm-qt/translations/libfm-qt_de.ts delete mode 100644 libfm-qt/translations/libfm-qt_el.ts delete mode 100644 libfm-qt/translations/libfm-qt_es.ts delete mode 100644 libfm-qt/translations/libfm-qt_fr.ts delete mode 100644 libfm-qt/translations/libfm-qt_gl.ts delete mode 100644 libfm-qt/translations/libfm-qt_hu.ts delete mode 100644 libfm-qt/translations/libfm-qt_it.ts delete mode 100644 libfm-qt/translations/libfm-qt_ja.ts delete mode 100644 libfm-qt/translations/libfm-qt_lt_LT.ts delete mode 100644 libfm-qt/translations/libfm-qt_pl.ts delete mode 100644 libfm-qt/translations/libfm-qt_pt.ts delete mode 100644 libfm-qt/translations/libfm-qt_ru.ts delete mode 100644 libfm-qt/translations/libfm-qt_ru_RU.ts delete mode 100644 libfm-qt/translations/libfm-qt_zh_TW.ts delete mode 100644 libfm-qt/utilities.cpp delete mode 100644 libfm-qt/utilities.h delete mode 100644 libfm-qt/utilities_p.h create mode 100644 pcmanfm/translations/pcmanfm-qt-desktop-pref_ru.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt-desktop-pref_ru_RU.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt_ru.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt_ru_RU.desktop diff --git a/AUTHORS b/AUTHORS index c20cbb5..b5b60c5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,7 +3,4 @@ Upstream Authors: Hong Jen Yee (PCMan) Copyright: - Copyright (c) 2013-2014 LXQt team - -License: GPL-2 -The full text of the licenses can be found in the 'COPYING' file. + Copyright (c) 2013-2015 LXQt team diff --git a/CMakeLists.txt b/CMakeLists.txt index c4c2162..f963be2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,61 +1,62 @@ cmake_minimum_required(VERSION 3.0.2) project(pcmanfm-qt) +# CMP0063: Honor visibility properties for all target types. +if (POLICY CMP0063) + cmake_policy (SET CMP0063 NEW) +endif (POLICY CMP0063) + set(PCMANFM_QT_VERSION_MAJOR 0) set(PCMANFM_QT_VERSION_MINOR 10) set(PCMANFM_QT_VERSION_PATCH 0) set(PCMANFM_QT_VERSION ${PCMANFM_QT_VERSION_MAJOR}.${PCMANFM_QT_VERSION_MINOR}.${PCMANFM_QT_VERSION_PATCH}) -set(LIBFM_QT_VERSION_MAJOR 0) -set(LIBFM_QT_VERSION_MINOR 10) -set(LIBFM_QT_VERSION_PATCH 0) -set(LIBFM_QT_VERSION ${LIBFM_QT_VERSION_MAJOR}.${LIBFM_QT_VERSION_MINOR}.${LIBFM_QT_VERSION_PATCH}) - list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") -# We use the libtool versioning scheme for the internal so name, "current:revision:age" -# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# https://www.sourceware.org/autobook/autobook/autobook_91.html -# http://pusling.com/blog/?p=352 -# Actually, libtool uses different ways on different operating systems. So there is no -# universal way to translate a libtool version-info to a cmake version. -# We use "(current-age).age.revision" as the cmake version. -# current: 2, revision: 0, age: 0 => version: 2.0.0 -set(LIBFM_QT_LIB_VERSION "2.0.0") -set(LIBFM_QT_LIB_SOVERSION "2") - find_package(Qt5Widgets 5.2 REQUIRED) find_package(Qt5DBus 5.2 REQUIRED) find_package(Qt5LinguistTools 5.2 REQUIRED) find_package(Qt5X11Extras 5.2 REQUIRED) +find_package(fm-qt REQUIRED) -find_package(PkgConfig) -pkg_check_modules(SYSTEM_LIBS REQUIRED - glib-2.0 - gio-2.0 - gio-unix-2.0 - xcb -) - -pkg_check_modules(LIBFM REQUIRED libfm>=1.2.0) -pkg_check_modules(LIBMENUCACHE REQUIRED libmenu-cache>=0.4.0) +find_package(PkgConfig REQUIRED) +pkg_check_modules(LIB_XCB REQUIRED xcb) option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) include(GNUInstallDirs) include(LXQtTranslateTs) include(LXQtTranslateDesktop) -add_definitions(-DQT_NO_KEYWORDS) +# set visibility to hidden to hide symbols, unless they're exported manually in the code +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +if (CMAKE_VERSION VERSION_LESS "3.1") + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + # -std=c++0x is deprecated but some tools e.g. qmake or older gcc are still using it + if(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + else() + message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER} does not support c++11/c++0x") + endif() + endif() +else() + set(CMAKE_CXX_STANDARD 11) +endif() -if (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # set visibility to hidden to hide symbols, unless they're exported manually in the code - set(CMAKE_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-fno-exceptions ${CMAKE_CXX_FLAGS}") endif() set(CMAKE_AUTOMOC TRUE) set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_subdirectory(libfm-qt) add_subdirectory(pcmanfm) # manpage for pcmanfm-qt @@ -89,7 +90,7 @@ endif() # To create a source distribution, type: # make package_source include(InstallRequiredSystemLibraries) -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_PACKAGE_VENDOR "") set(CPACK_PACKAGE_VERSION_MAJOR ${PCMANFM_QT_VERSION_MAJOR}) diff --git a/COPYING b/LICENSE similarity index 100% rename from COPYING rename to LICENSE diff --git a/README.md b/README.md index 047afd3..c9cd394 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ The Qt port of the LXDE file manager PCManFM. -Includes libfm-qt, the qt port of the libfm-qt - a library providing components -to build desktop file managers. +Includes libfm-qt, the Qt port of the libfm - a library providing components to +build desktop file managers. Issue tracker: https://github.com/lxde/pcmanfm-qt/issues @@ -13,3 +13,11 @@ LXQt website: LXDE website: http://lxde.org + + +# License + +PCManFM is licensed under the terms of the +[GPLv2](https://www.gnu.org/licenses/gpl-2.0.en.html) or any later version. + +See the LICENSE file for the full text of the license. diff --git a/libfm-qt/CMakeLists.txt b/libfm-qt/CMakeLists.txt deleted file mode 100644 index c0cbc1e..0000000 --- a/libfm-qt/CMakeLists.txt +++ /dev/null @@ -1,150 +0,0 @@ -project(fm-qt) - -set(LIBRARY_NAME "fm-qt5") -set(QTX_INCLUDE_DIRS "") -set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras) -set(libfm_TRANSLATION_TEMPLATE "lib${PROJECT_NAME}") - -include_directories( - ${QTX_INCLUDE_DIRS} - ${LIBFM_INCLUDE_DIRS} - "${LIBFM_INCLUDEDIR}/libfm" # to workaround incorrect #include in fm-actions. - ${LIBMENUCACHE_INCLUDE_DIRS} - ${SYSTEM_LIBS_INCLUDE_DIRS} - "${CMAKE_CURRENT_BINARY_DIR}" -) - -link_directories( - ${LIBFM_LIBRARY_DIRS} - ${LIBMENUCACHE_LIBRARY_DIRS} - ${SYSTEM_LIBS_LIBRARY_DIRS} -) - -set(libfm_SRCS - libfmqt.cpp - bookmarkaction.cpp - sidepane.cpp - icontheme.cpp - filelauncher.cpp - foldermodel.cpp - foldermodelitem.cpp - cachedfoldermodel.cpp - proxyfoldermodel.cpp - folderview.cpp - folderitemdelegate.cpp - createnewmenu.cpp - filemenu.cpp - foldermenu.cpp - filepropsdialog.cpp - applaunchcontext.cpp - placesview.cpp - placesmodel.cpp - placesmodelitem.cpp - dirtreeview.cpp - dirtreemodel.cpp - dirtreemodelitem.cpp - dnddest.cpp - mountoperation.cpp - mountoperationpassworddialog.cpp - mountoperationquestiondialog.cpp - fileoperation.cpp - fileoperationdialog.cpp - renamedialog.cpp - pathedit.cpp - colorbutton.cpp - fontbutton.cpp - browsehistory.cpp - utilities.cpp - dndactionmenu.cpp - editbookmarksdialog.cpp - thumbnailloader.cpp - path.cpp - execfiledialog.cpp - appchoosercombobox.cpp - appmenuview.cpp - appchooserdialog.cpp - filesearchdialog.cpp - fm-search.c # might be moved to libfm later -) - -set(libfm_UIS - file-props.ui - file-operation-dialog.ui - rename-dialog.ui - mount-operation-password.ui - edit-bookmarks.ui - exec-file.ui - app-chooser-dialog.ui - filesearch.ui -) - -qt5_wrap_ui(libfm_UIS_H ${libfm_UIS}) - -# add translation for libfm-qt -lxqt_translate_ts(QM_FILES - UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} - SOURCES ${libfm_SRCS} ${libfm_UIS} - TEMPLATE ${libfm_TRANSLATION_TEMPLATE} -) - -add_library(${LIBRARY_NAME} SHARED - ${libfm_SRCS} - ${libfm_UIS_H} - ${QM_FILES} -) - -set_property( - TARGET ${LIBRARY_NAME} APPEND - PROPERTY COMPILE_DEFINITIONS - LIBFM_QT_COMPILATION=1 - LIBFM_DATA_DIR="${CMAKE_INSTALL_FULL_DATADIR}/libfm-qt" -) - -# only turn on custom actions support if it is enabled in libfm. -if(EXISTS ${LIBFM_INCLUDEDIR}/libfm/fm-actions.h) - set_property(TARGET ${LIBRARY_NAME} APPEND PROPERTY COMPILE_DEFINITIONS CUSTOM_ACTIONS) -endif() - -target_link_libraries(${LIBRARY_NAME} - ${QTX_LIBRARIES} - ${LIBFM_LIBRARIES} - ${LIBMENUCACHE_LIBRARIES} - ${SYSTEM_LIBS_LIBRARIES} -) - -# set libtool soname -set_target_properties(${LIBRARY_NAME} PROPERTIES - VERSION ${LIBFM_QT_LIB_VERSION} - SOVERSION ${LIBFM_QT_LIB_SOVERSION} -) - -# install include header files (FIXME: can we make this cleaner? should dir name be versioned?) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h" - PATTERN "*_p.h" EXCLUDE # exclude private headers -) - -# FIXME: add libtool version to the lib (soname) later. -# FIXME: only export public symbols - -install(TARGETS ${LIBRARY_NAME} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER -) - -# install a pkgconfig file for libfm-qt -set(REQUIRED_QT "Qt5Core >= 5.1 Qt5DBus >= 5.1") -configure_file(libfm-qt.pc.in lib${LIBRARY_NAME}.pc @ONLY) -# FreeBSD loves to install files to different locations -# http://www.freebsd.org/doc/handbook/dirstructure.html -if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${LIBRARY_NAME}.pc" DESTINATION libdata/pkgconfig) -else() - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${LIBRARY_NAME}.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") -endif() - -install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/libfm-qt/translations") - -# prevent the generated files from being deleted during make cleaner -set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true) diff --git a/libfm-qt/app-chooser-dialog.ui b/libfm-qt/app-chooser-dialog.ui deleted file mode 100644 index ef1ebee..0000000 --- a/libfm-qt/app-chooser-dialog.ui +++ /dev/null @@ -1,183 +0,0 @@ - - - AppChooserDialog - - - - 0 - 0 - 432 - 387 - - - - Choose an Application - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - - - - - 0 - 1 - - - - 0 - - - - Installed Applications - - - - - - - - - - Custom Command - - - - - - Command line to execute: - - - - - - - - - - Application name: - - - - - - - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - - - Qt::RichText - - - - - - - false - - - Keep terminal window open after command execution - - - - - - - Execute in terminal emulator - - - - - - - - - - - Set selected application as default action of this file type - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - Fm::AppMenuView - QTreeView -
appmenuview.h
-
-
- - - - buttonBox - accepted() - AppChooserDialog - accept() - - - 227 - 359 - - - 157 - 274 - - - - - buttonBox - rejected() - AppChooserDialog - reject() - - - 295 - 365 - - - 286 - 274 - - - - - useTerminal - toggled(bool) - keepTermOpen - setEnabled(bool) - - - 72 - 260 - - - 79 - 282 - - - - -
diff --git a/libfm-qt/appchoosercombobox.cpp b/libfm-qt/appchoosercombobox.cpp deleted file mode 100644 index 9d537e7..0000000 --- a/libfm-qt/appchoosercombobox.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "appchoosercombobox.h" -#include "icontheme.h" -#include "appchooserdialog.h" -#include "utilities.h" - -namespace Fm { - -AppChooserComboBox::AppChooserComboBox(QWidget* parent): - QComboBox(parent), - defaultApp_(NULL), - appInfos_(NULL), - defaultAppIndex_(-1), - prevIndex_(0), - mimeType_(NULL), - blockOnCurrentIndexChanged_(false) { - - // the new Qt5 signal/slot syntax cannot handle overloaded methods by default - // hence a type-casting is needed here. really ugly! - // reference: http://qt-project.org/forums/viewthread/21513 - connect((QComboBox*)this, static_cast(&QComboBox::currentIndexChanged), this, &AppChooserComboBox::onCurrentIndexChanged); -} - -AppChooserComboBox::~AppChooserComboBox() { - if(mimeType_) - fm_mime_type_unref(mimeType_); - if(defaultApp_) - g_object_unref(defaultApp_); - // delete GAppInfo objects stored for Combobox - if(appInfos_) { - g_list_foreach(appInfos_, (GFunc)g_object_unref, NULL); - g_list_free(appInfos_); - } -} - -void AppChooserComboBox::setMimeType(FmMimeType* mimeType) { - clear(); - if(mimeType_) - fm_mime_type_unref(mimeType_); - - mimeType_ = fm_mime_type_ref(mimeType); - if(mimeType_) { - const char* typeName = fm_mime_type_get_type(mimeType_); - defaultApp_ = g_app_info_get_default_for_type(typeName, FALSE); - appInfos_ = g_app_info_get_all_for_type(typeName); - int i = 0; - for(GList* l = appInfos_; l; l = l->next, ++i) { - GAppInfo* app = G_APP_INFO(l->data); - GIcon* gicon = g_app_info_get_icon(app); - QString name = QString::fromUtf8(g_app_info_get_name(app)); - // QVariant data = qVariantFromValue(app); - // addItem(IconTheme::icon(gicon), name, data); - addItem(IconTheme::icon(gicon), name); - if(g_app_info_equal(app, defaultApp_)) - defaultAppIndex_ = i; - } - } - // add "Other applications" item - insertSeparator(count()); - addItem(tr("Customize")); - if(defaultAppIndex_ != -1) - setCurrentIndex(defaultAppIndex_); -} - -// returns the currently selected app. -GAppInfo* AppChooserComboBox::selectedApp() { - return G_APP_INFO(g_list_nth_data(appInfos_, currentIndex())); -} - -bool AppChooserComboBox::isChanged() { - return (defaultAppIndex_ != currentIndex()); -} - -void AppChooserComboBox::onCurrentIndexChanged(int index) { - if(index == -1 || index == prevIndex_ || blockOnCurrentIndexChanged_) - return; - - // the last item is "Customize" - if(index == (count() - 1)) { - /* TODO: let the user choose an app or add custom actions here. */ - QWidget* toplevel = topLevelWidget(); - AppChooserDialog dlg(mimeType_, toplevel); - dlg.setWindowModality(Qt::WindowModal); - dlg.setCanSetDefault(false); - if(dlg.exec() == QDialog::Accepted) { - GAppInfo* app = dlg.selectedApp(); - if(app) { - /* see if it's already in the list to prevent duplication */ - GList* found = NULL; - for(found = appInfos_; found; found = found->next) { - if(g_app_info_equal(app, G_APP_INFO(found->data))) - break; - } - - // inserting new items or change current index will recursively trigger onCurrentIndexChanged. - // we need to block our handler to prevent recursive calls. - blockOnCurrentIndexChanged_ = true; - /* if it's already in the list, select it */ - if(found) { - setCurrentIndex(g_list_position(appInfos_, found)); - g_object_unref(app); - } - else { /* if it's not found, add it to the list */ - appInfos_ = g_list_prepend(appInfos_, app); - GIcon* gicon = g_app_info_get_icon(app); - QString name = QString::fromUtf8(g_app_info_get_name(app)); - insertItem(0, IconTheme::icon(gicon), name); - setCurrentIndex(0); - } - blockOnCurrentIndexChanged_ = false; - return; - } - } - - // block our handler to prevent recursive calls. - blockOnCurrentIndexChanged_ = true; - // restore to previously selected item - setCurrentIndex(prevIndex_); - blockOnCurrentIndexChanged_ = false; - } - else { - prevIndex_ = index; - } -} - - -#if 0 -/* get a list of custom apps added with app-chooser. -* the returned GList is owned by the combo box and shouldn't be freed. */ -const GList* AppChooserComboBox::customApps() { - -} -#endif - -} // namespace Fm diff --git a/libfm-qt/appchoosercombobox.h b/libfm-qt/appchoosercombobox.h deleted file mode 100644 index d14640e..0000000 --- a/libfm-qt/appchoosercombobox.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FM_APPCHOOSERCOMBOBOX_H -#define FM_APPCHOOSERCOMBOBOX_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class LIBFM_QT_API AppChooserComboBox : public QComboBox { - Q_OBJECT -public: - ~AppChooserComboBox(); - AppChooserComboBox(QWidget* parent); - - void setMimeType(FmMimeType* mimeType); - - FmMimeType* mimeType() { - return mimeType_; - } - - GAppInfo* selectedApp(); - // const GList* customApps(); - - bool isChanged(); - -private Q_SLOTS: - void onCurrentIndexChanged(int index); - -private: - FmMimeType* mimeType_; - GList* appInfos_; // applications used to open the file type - GAppInfo* defaultApp_; // default application used to open the file type - int defaultAppIndex_; - int prevIndex_; - bool blockOnCurrentIndexChanged_; -}; - -} - -#endif // FM_APPCHOOSERCOMBOBOX_H diff --git a/libfm-qt/appchooserdialog.cpp b/libfm-qt/appchooserdialog.cpp deleted file mode 100644 index 0a2b19d..0000000 --- a/libfm-qt/appchooserdialog.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright 2010-2014 Hong Jen Yee (PCMan) - * Copyright 2012-2013 Andriy Grytsenko (LStranger) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "appchooserdialog.h" -#include "ui_app-chooser-dialog.h" -#include -#include - -namespace Fm { - -AppChooserDialog::AppChooserDialog(FmMimeType* mimeType, QWidget* parent, Qt::WindowFlags f): - QDialog(parent, f), - mimeType_(NULL), - selectedApp_(NULL), - canSetDefault_(true), - ui(new Ui::AppChooserDialog()) { - ui->setupUi(this); - - connect(ui->appMenuView, &AppMenuView::selectionChanged, this, &AppChooserDialog::onSelectionChanged); - connect(ui->tabWidget, &QTabWidget::currentChanged, this, &AppChooserDialog::onTabChanged); - - if(!ui->appMenuView->isAppSelected()) - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); // disable OK button - - if(mimeType) - setMimeType(mimeType); -} - -AppChooserDialog::~AppChooserDialog() { - delete ui; - if(mimeType_) - fm_mime_type_unref(mimeType_); - if(selectedApp_) - g_object_unref(selectedApp_); -} - -bool AppChooserDialog::isSetDefault() { - return ui->setDefault->isChecked(); -} - - -static void on_temp_appinfo_destroy(gpointer data, GObject* objptr) { - char* filename = (char*)data; - if(g_unlink(filename) < 0) - g_critical("failed to remove %s", filename); - /* else - qDebug("temp file %s removed", filename); */ - g_free(filename); -} - -static GAppInfo* app_info_create_from_commandline(const char* commandline, - const char* application_name, - const char* bin_name, - const char* mime_type, - gboolean terminal, gboolean keep) { - GAppInfo* app = NULL; - char* dirname = g_build_filename(g_get_user_data_dir(), "applications", NULL); - const char* app_basename = strrchr(bin_name, '/'); - - if(app_basename) - app_basename++; - else - app_basename = bin_name; - if(g_mkdir_with_parents(dirname, 0700) == 0) { - char* filename = g_strdup_printf("%s/userapp-%s-XXXXXX.desktop", dirname, app_basename); - int fd = g_mkstemp(filename); - if(fd != -1) { - GString* content = g_string_sized_new(256); - g_string_printf(content, - "[" G_KEY_FILE_DESKTOP_GROUP "]\n" - G_KEY_FILE_DESKTOP_KEY_TYPE "=" G_KEY_FILE_DESKTOP_TYPE_APPLICATION "\n" - G_KEY_FILE_DESKTOP_KEY_NAME "=%s\n" - G_KEY_FILE_DESKTOP_KEY_EXEC "=%s\n" - G_KEY_FILE_DESKTOP_KEY_CATEGORIES "=Other;\n" - G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY "=true\n", - application_name, - commandline - ); - if(mime_type) - g_string_append_printf(content, - G_KEY_FILE_DESKTOP_KEY_MIME_TYPE "=%s\n", - mime_type); - g_string_append_printf(content, - G_KEY_FILE_DESKTOP_KEY_TERMINAL "=%s\n", - terminal ? "true" : "false"); - if(terminal) - g_string_append_printf(content, "X-KeepTerminal=%s\n", - keep ? "true" : "false"); - close(fd); /* g_file_set_contents() may fail creating duplicate */ - if(g_file_set_contents(filename, content->str, content->len, NULL)) { - char* fbname = g_path_get_basename(filename); - app = G_APP_INFO(g_desktop_app_info_new(fbname)); - g_free(fbname); - /* if there is mime_type set then created application will be - saved for the mime type (see fm_choose_app_for_mime_type() - below) but if not then we should remove this temp. file */ - if(!mime_type || !application_name[0]) - /* save the name so this file will be removed later */ - g_object_weak_ref(G_OBJECT(app), on_temp_appinfo_destroy, - g_strdup(filename)); - } - else - g_unlink(filename); - g_string_free(content, TRUE); - } - g_free(filename); - } - g_free(dirname); - return app; -} - -inline static char* get_binary(const char* cmdline, gboolean* arg_found) { - /* see if command line contains %f, %F, %u, or %U. */ - const char* p = strstr(cmdline, " %"); - if(p) { - if(!strchr("fFuU", *(p + 2))) - p = NULL; - } - if(arg_found) - *arg_found = (p != NULL); - if(p) - return g_strndup(cmdline, p - cmdline); - else - return g_strdup(cmdline); -} - -GAppInfo* AppChooserDialog::customCommandToApp() { - GAppInfo* app = NULL; - QByteArray cmdline = ui->cmdLine->text().toLocal8Bit(); - QByteArray app_name = ui->appName->text().toUtf8(); - if(!cmdline.isEmpty()) { - gboolean arg_found = FALSE; - char* bin1 = get_binary(cmdline.constData(), &arg_found); - qDebug("bin1 = %s", bin1); - /* see if command line contains %f, %F, %u, or %U. */ - if(!arg_found) { /* append %f if no %f, %F, %u, or %U was found. */ - cmdline += " %f"; - } - - /* FIXME: is there any better way to do this? */ - /* We need to ensure that no duplicated items are added */ - if(mimeType_) { - MenuCache* menu_cache; - /* see if the command is already in the list of known apps for this mime-type */ - GList* apps = g_app_info_get_all_for_type(fm_mime_type_get_type(mimeType_)); - GList* l; - for(l = apps; l; l = l->next) { - GAppInfo* app2 = G_APP_INFO(l->data); - const char* cmd = g_app_info_get_commandline(app2); - char* bin2 = get_binary(cmd, NULL); - if(g_strcmp0(bin1, bin2) == 0) { - app = G_APP_INFO(g_object_ref(app2)); - qDebug("found in app list"); - g_free(bin2); - break; - } - g_free(bin2); - } - g_list_foreach(apps, (GFunc)g_object_unref, NULL); - g_list_free(apps); - if(app) - goto _out; - - /* see if this command can be found in menu cache */ - menu_cache = menu_cache_lookup("applications.menu"); - if(menu_cache) { - MenuCacheDir* root_dir = menu_cache_dup_root_dir(menu_cache); - if(root_dir) { - GSList* all_apps = menu_cache_list_all_apps(menu_cache); - GSList* l; - for(l = all_apps; l; l = l->next) { - MenuCacheApp* ma = MENU_CACHE_APP(l->data); - const char* exec = menu_cache_app_get_exec(ma); - char* bin2; - if(exec == NULL) { - g_warning("application %s has no Exec statement", menu_cache_item_get_id(MENU_CACHE_ITEM(ma))); - continue; - } - bin2 = get_binary(exec, NULL); - if(g_strcmp0(bin1, bin2) == 0) { - app = G_APP_INFO(g_desktop_app_info_new(menu_cache_item_get_id(MENU_CACHE_ITEM(ma)))); - qDebug("found in menu cache"); - menu_cache_item_unref(MENU_CACHE_ITEM(ma)); - g_free(bin2); - break; - } - menu_cache_item_unref(MENU_CACHE_ITEM(ma)); - g_free(bin2); - } - g_slist_free(all_apps); - menu_cache_item_unref(MENU_CACHE_ITEM(root_dir)); - } - menu_cache_unref(menu_cache); - } - if(app) - goto _out; - } - - /* FIXME: g_app_info_create_from_commandline force the use of %f or %u, so this is not we need */ - app = app_info_create_from_commandline(cmdline.constData(), app_name.constData(), bin1, - mimeType_ ? fm_mime_type_get_type(mimeType_) : NULL, - ui->useTerminal->isChecked(), ui->keepTermOpen->isChecked()); - _out: - g_free(bin1); - } - return app; -} - -void AppChooserDialog::accept() { - QDialog::accept(); - - if(ui->tabWidget->currentIndex() == 0) { - selectedApp_ = ui->appMenuView->selectedApp(); - } - else { // custom command line - selectedApp_ = customCommandToApp(); - } - - if(selectedApp_) { - if(mimeType_ && fm_mime_type_get_type(mimeType_) && g_app_info_get_name(selectedApp_)[0]) { - /* add this app to the mime-type */ -#if GLIB_CHECK_VERSION(2, 27, 6) - g_app_info_set_as_last_used_for_type(selectedApp_, fm_mime_type_get_type(mimeType_), NULL); -#else - g_app_info_add_supports_type(selectedApp_, fm_mime_type_get_type(mimeType_), NULL); -#endif - /* if need to set default */ - if(ui->setDefault->isChecked()) - g_app_info_set_as_default_for_type(selectedApp_, fm_mime_type_get_type(mimeType_), NULL); - } - } -} - -void AppChooserDialog::onSelectionChanged() { - bool isAppSelected = ui->appMenuView->isAppSelected(); - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isAppSelected); -} - -void AppChooserDialog::setMimeType(FmMimeType* mimeType) { - if(mimeType_) - fm_mime_type_unref(mimeType_); - - mimeType_ = mimeType ? fm_mime_type_ref(mimeType) : NULL; - if(mimeType_) { - QString text = tr("Select an application to open \"%1\" files") - .arg(QString::fromUtf8(fm_mime_type_get_desc(mimeType_))); - ui->fileTypeHeader->setText(text); - } - else { - ui->fileTypeHeader->hide(); - ui->setDefault->hide(); - } -} - -void AppChooserDialog::setCanSetDefault(bool value) { - canSetDefault_ = value; - ui->setDefault->setVisible(value); -} - -void AppChooserDialog::onTabChanged(int index) { - if(index == 0) { // app menu view - onSelectionChanged(); - } - else if(index == 1) { // custom command - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); - } -} - -} // namespace Fm diff --git a/libfm-qt/appchooserdialog.h b/libfm-qt/appchooserdialog.h deleted file mode 100644 index 64a5464..0000000 --- a/libfm-qt/appchooserdialog.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2010-2014 Hong Jen Yee (PCMan) - * Copyright 2012-2013 Andriy Grytsenko (LStranger) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FM_APPCHOOSERDIALOG_H -#define FM_APPCHOOSERDIALOG_H - -#include -#include "libfmqtglobals.h" -#include - -namespace Ui { - class AppChooserDialog; -} - -namespace Fm { - -class LIBFM_QT_API AppChooserDialog : public QDialog { - Q_OBJECT -public: - explicit AppChooserDialog(FmMimeType* mimeType, QWidget* parent = NULL, Qt::WindowFlags f = 0); - ~AppChooserDialog(); - - virtual void accept(); - - void setMimeType(FmMimeType* mimeType); - FmMimeType* mimeType() { - return mimeType_; - } - - void setCanSetDefault(bool value); - bool canSetDefault() { - return canSetDefault_; - } - - GAppInfo* selectedApp() { - return G_APP_INFO(g_object_ref(selectedApp_)); - } - - bool isSetDefault(); - -private: - GAppInfo* customCommandToApp(); - -private Q_SLOTS: - void onSelectionChanged(); - void onTabChanged(int index); - -private: - Ui::AppChooserDialog* ui; - FmMimeType* mimeType_; - bool canSetDefault_; - GAppInfo* selectedApp_; -}; - -} - -#endif // FM_APPCHOOSERDIALOG_H diff --git a/libfm-qt/applaunchcontext.cpp b/libfm-qt/applaunchcontext.cpp deleted file mode 100644 index a70c1fd..0000000 --- a/libfm-qt/applaunchcontext.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "applaunchcontext.h" -#include -#include - -typedef struct _FmAppLaunchContext { - GAppLaunchContext parent; -}FmAppLaunchContext; - -G_DEFINE_TYPE(FmAppLaunchContext, fm_app_launch_context, G_TYPE_APP_LAUNCH_CONTEXT) - -static char* fm_app_launch_context_get_display(GAppLaunchContext *context, GAppInfo *info, GList *files) { - Display* dpy = QX11Info::display(); - if(dpy) { - char* xstr = DisplayString(dpy); - return g_strdup(xstr); - } - return NULL; -} - -static char* fm_app_launch_context_get_startup_notify_id(GAppLaunchContext *context, GAppInfo *info, GList *files) { - return NULL; -} - -static void fm_app_launch_context_class_init(FmAppLaunchContextClass* klass) { - GAppLaunchContextClass* app_launch_class = G_APP_LAUNCH_CONTEXT_CLASS(klass); - app_launch_class->get_display = fm_app_launch_context_get_display; - app_launch_class->get_startup_notify_id = fm_app_launch_context_get_startup_notify_id; -} - -static void fm_app_launch_context_init(FmAppLaunchContext* context) { -} - -FmAppLaunchContext* fm_app_launch_context_new_for_widget(QWidget* widget) { - FmAppLaunchContext* context = (FmAppLaunchContext*)g_object_new(FM_TYPE_APP_LAUNCH_CONTEXT, NULL); - return context; -} - -FmAppLaunchContext* fm_app_launch_context_new() { - FmAppLaunchContext* context = (FmAppLaunchContext*)g_object_new(FM_TYPE_APP_LAUNCH_CONTEXT, NULL); - return context; -} diff --git a/libfm-qt/applaunchcontext.h b/libfm-qt/applaunchcontext.h deleted file mode 100644 index 828768a..0000000 --- a/libfm-qt/applaunchcontext.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_APP_LAUNCHCONTEXT_H -#define FM_APP_LAUNCHCONTEXT_H - -#include "libfmqtglobals.h" -#include -#include - -#define FM_TYPE_APP_LAUNCH_CONTEXT (fm_app_launch_context_get_type()) -#define FM_APP_LAUNCH_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ - FM_TYPE_APP_LAUNCH_CONTEXT, FmAppLaunchContext)) -#define FM_APP_LAUNCH_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\ - FM_TYPE_APP_LAUNCH_CONTEXT, FmAppLaunchContextClass)) -#define FM_IS_APP_LAUNCH_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\ - FM_TYPE_APP_LAUNCH_CONTEXT)) -#define FM_IS_APP_LAUNCH_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ - FM_TYPE_APP_LAUNCH_CONTEXT)) -#define FM_APP_LAUNCH_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\ - FM_TYPE_APP_LAUNCH_CONTEXT, FmAppLaunchContextClass)) - -typedef struct _FmAppLaunchContext FmAppLaunchContext; - -typedef struct _FmAppLaunchContextClass { - GAppLaunchContextClass parent; -}FmAppLaunchContextClass; - -FmAppLaunchContext* fm_app_launch_context_new(); -FmAppLaunchContext* fm_app_launch_context_new_for_widget(QWidget* widget); -GType fm_app_launch_context_get_type(); - -#endif // FM_APPLAUNCHCONTEXT_H diff --git a/libfm-qt/appmenuview.cpp b/libfm-qt/appmenuview.cpp deleted file mode 100644 index 53102db..0000000 --- a/libfm-qt/appmenuview.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "appmenuview.h" -#include -#include "icontheme.h" -#include "appmenuview_p.h" -#include - -namespace Fm { - -AppMenuView::AppMenuView(QWidget* parent): - model_(new QStandardItemModel()), - menu_cache(NULL), - menu_cache_reload_notify(NULL), - QTreeView(parent) { - - setHeaderHidden(true); - setSelectionMode(SingleSelection); - - // initialize model - // TODO: share one model among all app menu view widgets - // ensure that we're using lxmenu-data (FIXME: should we do this?) - QByteArray oldenv = qgetenv("XDG_MENU_PREFIX"); - qputenv("XDG_MENU_PREFIX", "lxde-"); - menu_cache = menu_cache_lookup("applications.menu"); - // if(!oldenv.isEmpty()) - qputenv("XDG_MENU_PREFIX", oldenv); // restore the original value if needed - - if(menu_cache) { - MenuCacheDir* dir = menu_cache_dup_root_dir(menu_cache); - menu_cache_reload_notify = menu_cache_add_reload_notify(menu_cache, _onMenuCacheReload, this); - if(dir) { /* content of menu is already loaded */ - addMenuItems(NULL, dir); - menu_cache_item_unref(MENU_CACHE_ITEM(dir)); - } - } - setModel(model_); - connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, &AppMenuView::selectionChanged); - selectionModel()->select(model_->index(0, 0), QItemSelectionModel::SelectCurrent); -} - -AppMenuView::~AppMenuView() { - delete model_; - if(menu_cache) { - if(menu_cache_reload_notify) - menu_cache_remove_reload_notify(menu_cache, menu_cache_reload_notify); - menu_cache_unref(menu_cache); - } -} - -void AppMenuView::addMenuItems(QStandardItem* parentItem, MenuCacheDir* dir) { - GSList* l; - GSList* list; - /* Iterate over all menu items in this directory. */ - for(l = list = menu_cache_dir_list_children(dir); l != NULL; l = l->next) { - /* Get the menu item. */ - MenuCacheItem* menuItem = MENU_CACHE_ITEM(l->data); - switch(menu_cache_item_get_type(menuItem)) { - case MENU_CACHE_TYPE_NONE: - case MENU_CACHE_TYPE_SEP: - break; - case MENU_CACHE_TYPE_APP: - case MENU_CACHE_TYPE_DIR: { - AppMenuViewItem* newItem = new AppMenuViewItem(menuItem); - if(parentItem) - parentItem->insertRow(parentItem->rowCount(), newItem); - else - model_->insertRow(model_->rowCount(), newItem); - - if(menu_cache_item_get_type(menuItem) == MENU_CACHE_TYPE_DIR) - addMenuItems(newItem, MENU_CACHE_DIR(menuItem)); - break; - } - } - } - g_slist_free_full(list, (GDestroyNotify)menu_cache_item_unref); -} - -void AppMenuView::onMenuCacheReload(MenuCache* mc) { - MenuCacheDir* dir = menu_cache_dup_root_dir(mc); - model_->clear(); - /* FIXME: preserve original selection */ - if(dir) { - addMenuItems(NULL, dir); - menu_cache_item_unref(MENU_CACHE_ITEM(dir)); - selectionModel()->select(model_->index(0, 0), QItemSelectionModel::SelectCurrent); - } -} - -bool AppMenuView::isAppSelected() { - AppMenuViewItem* item = selectedItem(); - return (item && item->isApp()); -} - -AppMenuViewItem* AppMenuView::selectedItem() { - QModelIndexList selected = selectedIndexes(); - if(!selected.isEmpty()) { - AppMenuViewItem* item = static_cast(model_->itemFromIndex(selected.first() - )); - return item; - } - return NULL; -} - -GAppInfo* AppMenuView::selectedApp() { - const char* id = selectedAppDesktopId(); - return id ? G_APP_INFO(g_desktop_app_info_new(id)) : NULL; -} - -QByteArray AppMenuView::selectedAppDesktopFilePath() { - AppMenuViewItem* item = selectedItem(); - if(item && item->isApp()) { - char* path = menu_cache_item_get_file_path(item->item()); - QByteArray ret(path); - g_free(path); - return ret; - } - return QByteArray(); -} - -const char* AppMenuView::selectedAppDesktopId() { - AppMenuViewItem* item = selectedItem(); - if(item && item->isApp()) { - return menu_cache_item_get_id(item->item()); - } - return NULL; -} - -FmPath* AppMenuView::selectedAppDesktopPath() { - AppMenuViewItem* item = selectedItem(); - if(item && item->isApp()) { - char* mpath = menu_cache_dir_make_path(MENU_CACHE_DIR(item)); - FmPath* path = fm_path_new_relative(fm_path_get_apps_menu(), - mpath + 13 /* skip "/Applications" */); - g_free(mpath); - return path; - } - return NULL; -} - -} // namespace Fm diff --git a/libfm-qt/appmenuview.h b/libfm-qt/appmenuview.h deleted file mode 100644 index e41f646..0000000 --- a/libfm-qt/appmenuview.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FM_APPMENUVIEW_H -#define FM_APPMENUVIEW_H - -#include -#include "libfmqtglobals.h" -#include -#include - -class QStandardItemModel; -class QStandardItem; - -namespace Fm { - -class AppMenuViewItem; - -class LIBFM_QT_API AppMenuView : public QTreeView { - Q_OBJECT -public: - explicit AppMenuView(QWidget* parent = NULL); - ~AppMenuView(); - - GAppInfo* selectedApp(); - - const char* selectedAppDesktopId(); - - QByteArray selectedAppDesktopFilePath(); - - FmPath * selectedAppDesktopPath(); - - bool isAppSelected(); - -Q_SIGNALS: - void selectionChanged(); - -private: - void addMenuItems(QStandardItem* parentItem, MenuCacheDir* dir); - void onMenuCacheReload(MenuCache* mc); - static void _onMenuCacheReload(MenuCache* mc, gpointer user_data) { - static_cast(user_data)->onMenuCacheReload(mc); - } - - AppMenuViewItem* selectedItem(); - -private: - // gboolean fm_app_menu_view_is_item_app(, GtkTreeIter* it); - QStandardItemModel* model_; - MenuCache* menu_cache; - MenuCacheNotifyId menu_cache_reload_notify; -}; - -} - -#endif // FM_APPMENUVIEW_H diff --git a/libfm-qt/appmenuview_p.h b/libfm-qt/appmenuview_p.h deleted file mode 100644 index cc549ca..0000000 --- a/libfm-qt/appmenuview_p.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FM_APPMENUVIEW_P_H -#define FM_APPMENUVIEW_P_H - -#include -#include -#include "icontheme.h" - -namespace Fm { - -class AppMenuViewItem : public QStandardItem { -public: - explicit AppMenuViewItem(MenuCacheItem* item): - item_(menu_cache_item_ref(item)) { - FmIcon* fmicon; - if(menu_cache_item_get_icon(item)) - fmicon = fm_icon_from_name(menu_cache_item_get_icon(item)); - else - fmicon = NULL; - setText(QString::fromUtf8(menu_cache_item_get_name(item))); - setEditable(false); - setDragEnabled(false); - if(fmicon) { - setIcon(IconTheme::icon(fmicon)); - fm_icon_unref(fmicon); - } - } - - ~AppMenuViewItem() { - menu_cache_item_unref(item_); - } - - MenuCacheItem* item() { - return item_; - } - - MenuCacheType type() { - return menu_cache_item_get_type(item_); - } - - bool isApp() { - return type() == MENU_CACHE_TYPE_APP; - } - - bool isDir() { - return type() == MENU_CACHE_TYPE_DIR; - } - -private: - MenuCacheItem* item_; -}; - -} - -#endif // FM_APPMENUVIEW_P_H diff --git a/libfm-qt/bookmarkaction.cpp b/libfm-qt/bookmarkaction.cpp deleted file mode 100644 index 43b2ab4..0000000 --- a/libfm-qt/bookmarkaction.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "bookmarkaction.h" - -using namespace Fm; - -BookmarkAction::BookmarkAction(FmBookmarkItem* item, QObject* parent): - QAction(parent), - item_(fm_bookmark_item_ref(item)) { - - setText(QString::fromUtf8(item->name)); -} diff --git a/libfm-qt/bookmarkaction.h b/libfm-qt/bookmarkaction.h deleted file mode 100644 index f707a4e..0000000 --- a/libfm-qt/bookmarkaction.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 BOOKMARKACTION_H -#define BOOKMARKACTION_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -// action used to create bookmark menu items -class LIBFM_QT_API BookmarkAction : public QAction { -public: - explicit BookmarkAction(FmBookmarkItem* item, QObject* parent = 0); - - virtual ~BookmarkAction() { - if(item_) - fm_bookmark_item_unref(item_); - } - - FmBookmarkItem* bookmark() { - return item_; - } - - FmPath* path() { - return item_->path; - } - -private: - FmBookmarkItem* item_; -}; - -} - -#endif // BOOKMARKACTION_H diff --git a/libfm-qt/browsehistory.cpp b/libfm-qt/browsehistory.cpp deleted file mode 100644 index 18bd5af..0000000 --- a/libfm-qt/browsehistory.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "browsehistory.h" - -using namespace Fm; - -BrowseHistory::BrowseHistory(): - currentIndex_(0), - maxCount_(10) { -} - -BrowseHistory::~BrowseHistory() { -} - -void BrowseHistory::add(FmPath* path, int scrollPos) { - int lastIndex = size() - 1; - if(currentIndex_ < lastIndex) { - // if we're not at the last item, remove items after the current one. - erase(begin() + currentIndex_ + 1, end()); - } - - if(size() + 1 > maxCount_) { - // if there are too many items, remove the oldest one. - // FIXME: what if currentIndex_ == 0? remove the last item instead? - if(currentIndex_ == 0) - remove(lastIndex); - else { - remove(0); - --currentIndex_; - } - } - // add a path and current scroll position to browse history - append(BrowseHistoryItem(path, scrollPos)); - currentIndex_ = size() - 1; -} - -void BrowseHistory::setCurrentIndex(int index) { - if(index >= 0 && index < size()) { - currentIndex_ = index; - // FIXME: should we emit a signal for the change? - } -} - -bool BrowseHistory::canBackward() const { - return (currentIndex_ > 0); -} - -int BrowseHistory::backward() { - if(canBackward()) - --currentIndex_; - return currentIndex_; -} - -bool BrowseHistory::canForward() const { - return (currentIndex_ + 1 < size()); -} - -int BrowseHistory::forward() { - if(canForward()) - ++currentIndex_; - return currentIndex_; -} - -void BrowseHistory::setMaxCount(int maxCount) { - maxCount_ = maxCount; - if(size() > maxCount) { - // TODO: remove some items - } -} diff --git a/libfm-qt/browsehistory.h b/libfm-qt/browsehistory.h deleted file mode 100644 index 9dfb646..0000000 --- a/libfm-qt/browsehistory.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_BROWSEHISTORY_H -#define FM_BROWSEHISTORY_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -// class used to story browsing history of folder views -// We use this class to replace FmNavHistory provided by libfm since -// the original Libfm API is hard to use and confusing. - -class LIBFM_QT_API BrowseHistoryItem { -public: - - BrowseHistoryItem(): - path_(NULL), - scrollPos_(0) { - } - - BrowseHistoryItem(FmPath* path, int scrollPos = 0): - path_(fm_path_ref(path)), - scrollPos_(scrollPos) { - } - - BrowseHistoryItem(const BrowseHistoryItem& other): - path_(other.path_ ? fm_path_ref(other.path_) : NULL), - scrollPos_(other.scrollPos_) { - } - - ~BrowseHistoryItem() { - if(path_) - fm_path_unref(path_); - } - - BrowseHistoryItem& operator=(const BrowseHistoryItem& other) { - if(path_) - fm_path_unref(path_); - path_ = other.path_ ? fm_path_ref(other.path_) : NULL; - scrollPos_ = other.scrollPos_; - return *this; - } - - FmPath* path() const { - return path_; - } - - int scrollPos() const { - return scrollPos_; - } - - void setScrollPos(int pos) { - scrollPos_ = pos; - } - -private: - FmPath* path_; - int scrollPos_; - // TODO: we may need to store current selection as well. reserve room for furutre expansion. - // void* reserved1; - // void* reserved2; -}; - -class LIBFM_QT_API BrowseHistory : public QVector { - -public: - BrowseHistory(); - virtual ~BrowseHistory(); - - int currentIndex() const { - return currentIndex_; - } - void setCurrentIndex(int index); - - FmPath* currentPath() const { - return at(currentIndex_).path(); - } - - int currentScrollPos() const { - return at(currentIndex_).scrollPos(); - } - - BrowseHistoryItem& currentItem() { - return operator[](currentIndex_); - } - - void add(FmPath* path, int scrollPos = 0); - - bool canForward() const; - - bool canBackward() const; - - int backward(); - - int forward(); - - int maxCount() const { - return maxCount_; - } - - void setMaxCount(int maxCount); - -private: - int currentIndex_; - int maxCount_; -}; - -} - -#endif // FM_BROWSEHISTORY_H diff --git a/libfm-qt/cachedfoldermodel.cpp b/libfm-qt/cachedfoldermodel.cpp deleted file mode 100644 index 4b3374b..0000000 --- a/libfm-qt/cachedfoldermodel.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - - Copyright (C) 2013 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "cachedfoldermodel.h" - -using namespace Fm; - -static GQuark data_id = 0; - - -CachedFolderModel::CachedFolderModel(FmFolder* folder): - FolderModel(), - refCount(1) { - - FolderModel::setFolder(folder); -} - -CachedFolderModel::~CachedFolderModel() { -} - -CachedFolderModel* CachedFolderModel::modelFromFolder(FmFolder* folder) { - CachedFolderModel* model = NULL; - if(!data_id) - data_id = g_quark_from_static_string("CachedFolderModel"); - gpointer qdata = g_object_get_qdata(G_OBJECT(folder), data_id); - model = reinterpret_cast(qdata); - if(model) { - // qDebug("cache found!!"); - model->ref(); - } - else { - model = new CachedFolderModel(folder); - g_object_set_qdata(G_OBJECT(folder), data_id, model); - } - return model; -} - -CachedFolderModel* CachedFolderModel::modelFromPath(FmPath* path) { - FmFolder* folder = fm_folder_from_path(path); - if(folder) { - CachedFolderModel* model = modelFromFolder(folder); - g_object_unref(folder); - return model; - } - return NULL; -} - -void CachedFolderModel::unref() { - // qDebug("unref cache"); - --refCount; - if(refCount <= 0) { - g_object_set_qdata(G_OBJECT(folder()), data_id, NULL); - deleteLater(); - } -} - diff --git a/libfm-qt/cachedfoldermodel.h b/libfm-qt/cachedfoldermodel.h deleted file mode 100644 index 051c352..0000000 --- a/libfm-qt/cachedfoldermodel.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - - Copyright (C) 2013 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_CACHEDFOLDERMODEL_H -#define FM_CACHEDFOLDERMODEL_H - -#include "libfmqtglobals.h" -#include "foldermodel.h" - -namespace Fm { - -class LIBFM_QT_API CachedFolderModel : public FolderModel { - Q_OBJECT -public: - CachedFolderModel(FmFolder* folder); - void ref() { - ++refCount; - } - void unref(); - - static CachedFolderModel* modelFromFolder(FmFolder* folder); - static CachedFolderModel* modelFromPath(FmPath* path); - -private: - virtual ~CachedFolderModel(); - void setFolder(FmFolder* folder); -private: - int refCount; -}; - - -} - -#endif // FM_CACHEDFOLDERMODEL_H diff --git a/libfm-qt/colorbutton.cpp b/libfm-qt/colorbutton.cpp deleted file mode 100644 index 348eab1..0000000 --- a/libfm-qt/colorbutton.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "colorbutton.h" -#include - -using namespace Fm; - -ColorButton::ColorButton(QWidget* parent): QPushButton(parent) { - connect(this, &QPushButton::clicked, this, &ColorButton::onClicked); -} - -ColorButton::~ColorButton() { - -} - -void ColorButton::onClicked() { - QColorDialog dlg(color_); - if(dlg.exec() == QDialog::Accepted) { - setColor(dlg.selectedColor()); - } -} - -void ColorButton::setColor(const QColor& color) { - if(color != color_) { - color_ = color; - // use qss instead of QPalette to set the background color - // otherwise, this won't work when using the gtk style. - QString style = QString("QPushButton{background-color:%1;}").arg(color.name()); - setStyleSheet(style); - Q_EMIT changed(); - } -} - diff --git a/libfm-qt/colorbutton.h b/libfm-qt/colorbutton.h deleted file mode 100644 index 08d7135..0000000 --- a/libfm-qt/colorbutton.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_COLORBUTTON_H -#define FM_COLORBUTTON_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class LIBFM_QT_API ColorButton : public QPushButton { -Q_OBJECT - -public: - explicit ColorButton(QWidget* parent = 0); - virtual ~ColorButton(); - - void setColor(const QColor&); - - QColor color() const { - return color_; - } - -Q_SIGNALS: - void changed(); - -private Q_SLOTS: - void onClicked(); - -private: - QColor color_; -}; - -} - -#endif // FM_COLORBUTTON_H diff --git a/libfm-qt/createnewmenu.cpp b/libfm-qt/createnewmenu.cpp deleted file mode 100644 index 86faf44..0000000 --- a/libfm-qt/createnewmenu.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - Menu with entries to create new folders and files. - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "createnewmenu.h" -#include "folderview.h" -#include "icontheme.h" -#include "utilities.h" - -namespace Fm { - -CreateNewMenu::CreateNewMenu(QWidget* dialogParent, FmPath* dirPath, QWidget* parent): - QMenu(parent), dialogParent_(dialogParent), dirPath_(dirPath) { - QAction* action = new QAction(QIcon::fromTheme("folder-new"), tr("Folder"), this); - connect(action, &QAction::triggered, this, &CreateNewMenu::onCreateNewFolder); - addAction(action); - - action = new QAction(QIcon::fromTheme("document-new"), tr("Blank File"), this); - connect(action, &QAction::triggered, this, &CreateNewMenu::onCreateNewFile); - addAction(action); - - // add more items to "Create New" menu from templates - GList* templates = fm_template_list_all(fm_config->only_user_templates); - if(templates) { - addSeparator(); - for(GList* l = templates; l; l = l->next) { - FmTemplate* templ = (FmTemplate*)l->data; - /* we support directories differently */ - if(fm_template_is_directory(templ)) - continue; - FmMimeType* mime_type = fm_template_get_mime_type(templ); - const char* label = fm_template_get_label(templ); - QString text = QString("%1 (%2)").arg(QString::fromUtf8(label)).arg(QString::fromUtf8(fm_mime_type_get_desc(mime_type))); - FmIcon* icon = fm_template_get_icon(templ); - if(!icon) - icon = fm_mime_type_get_icon(mime_type); - QAction* action = addAction(IconTheme::icon(icon), text); - action->setObjectName(QString::fromUtf8(fm_template_get_name(templ, NULL))); - connect(action, &QAction::triggered, this, &CreateNewMenu::onCreateNew); - } - } -} - -CreateNewMenu::~CreateNewMenu() { -} - -void CreateNewMenu::onCreateNewFile() { - if(dirPath_) - createFileOrFolder(CreateNewTextFile, dirPath_); -} - -void CreateNewMenu::onCreateNewFolder() { - if(dirPath_) - createFileOrFolder(CreateNewFolder, dirPath_); -} - -void CreateNewMenu::onCreateNew() { - QAction* action = static_cast(sender()); - QByteArray name = action->objectName().toUtf8(); - GList* templates = fm_template_list_all(fm_config->only_user_templates); - FmTemplate* templ = NULL; - for(GList* l = templates; l; l = l->next) { - FmTemplate* t = (FmTemplate*)l->data; - if(name == fm_template_get_name(t, NULL)) { - templ = t; - break; - } - } - if(templ) { // template found - if(dirPath_) - createFileOrFolder(CreateWithTemplate, dirPath_, templ, dialogParent_); - } -} - -} // namespace Fm diff --git a/libfm-qt/createnewmenu.h b/libfm-qt/createnewmenu.h deleted file mode 100644 index 30664bf..0000000 --- a/libfm-qt/createnewmenu.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Menu with entries to create new folders and files. - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef FM_CREATENEWMENU_H -#define FM_CREATENEWMENU_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class FolderView; - -class LIBFM_QT_API CreateNewMenu : public QMenu { -Q_OBJECT - -public: - explicit CreateNewMenu(QWidget* dialogParent, FmPath* dirPath, - QWidget* parent = 0); - virtual ~CreateNewMenu(); - -protected Q_SLOTS: - void onCreateNewFolder(); - void onCreateNewFile(); - void onCreateNew(); - -private: - QWidget* dialogParent_; - FmPath* dirPath_; -}; - -} - -#endif // FM_CREATENEWMENU_H diff --git a/libfm-qt/dirtreemodel.cpp b/libfm-qt/dirtreemodel.cpp deleted file mode 100644 index 8d41e52..0000000 --- a/libfm-qt/dirtreemodel.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright 2014 Hong Jen Yee (PCMan) - * - * 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. - * - */ - -#include "dirtreemodel.h" -#include "dirtreemodelitem.h" -#include - -namespace Fm { - -DirTreeModel::DirTreeModel(QObject* parent): - showHidden_(false) { -} - -DirTreeModel::~DirTreeModel() { -} - -// QAbstractItemModel implementation - -Qt::ItemFlags DirTreeModel::flags(const QModelIndex& index) const { - DirTreeModelItem* item = itemFromIndex(index); - if(item && item->isPlaceHolder()) - return Qt::ItemIsEnabled; - return QAbstractItemModel::flags(index); -} - -QVariant DirTreeModel::data(const QModelIndex& index, int role) const { - if(!index.isValid() || index.column() > 1) { - return QVariant(); - } - DirTreeModelItem* item = itemFromIndex(index); - if(item) { - FmFileInfo* info = item->fileInfo_; - switch(role) { - case Qt::ToolTipRole: - return QVariant(item->displayName_); - case Qt::DisplayRole: - return QVariant(item->displayName_); - case Qt::DecorationRole: - return QVariant(item->icon_); - case FileInfoRole: - return qVariantFromValue((void*)info); - } - } - return QVariant(); -} - -int DirTreeModel::columnCount(const QModelIndex& parent) const { - return 1; -} - -int DirTreeModel::rowCount(const QModelIndex& parent) const { - if(!parent.isValid()) - return rootItems_.count(); - DirTreeModelItem* item = itemFromIndex(parent); - if(item) - return item->children_.count(); - return 0; -} - -QModelIndex DirTreeModel::parent(const QModelIndex& child) const { - DirTreeModelItem* item = itemFromIndex(child); - if(item && item->parent_) { - item = item->parent_; // go to parent item - if(item) { - const QList& items = item->parent_ ? item->parent_->children_ : rootItems_; - int row = items.indexOf(item); // this is Q(n) and may be slow :-( - if(row >= 0) - return createIndex(row, 0, (void*)item); - } - } - return QModelIndex(); -} - -QModelIndex DirTreeModel::index(int row, int column, const QModelIndex& parent) const { - if(row >= 0 && column >= 0 && column == 0) { - if(!parent.isValid()) { // root items - if(row < rootItems_.count()) { - const DirTreeModelItem* item = rootItems_.at(row); - return createIndex(row, column, (void*)item); - } - } - else { // child items - DirTreeModelItem* parentItem = itemFromIndex(parent); - if(row < parentItem->children_.count()) { - const DirTreeModelItem* item = parentItem->children_.at(row); - return createIndex(row, column, (void*)item); - } - } - } - return QModelIndex(); // invalid index -} - -bool DirTreeModel::hasChildren(const QModelIndex& parent) const { - DirTreeModelItem* item = itemFromIndex(parent); - return item ? !item->isPlaceHolder() : true; -} - -QModelIndex DirTreeModel::indexFromItem(DirTreeModelItem* item) const { - Q_ASSERT(item); - const QList& items = item->parent_ ? item->parent_->children_ : rootItems_; - int row = items.indexOf(item); - if(row >= 0) - return createIndex(row, 0, (void*)item); - return QModelIndex(); -} - -// public APIs -QModelIndex DirTreeModel::addRoot(FmFileInfo* root) { - DirTreeModelItem* item = new DirTreeModelItem(root, this); - int row = rootItems_.count(); - beginInsertRows(QModelIndex(), row, row); - item->fileInfo_ = fm_file_info_ref(root); - rootItems_.append(item); - // add_place_holder_child_item(model, item_l, NULL, FALSE); - endInsertRows(); - return QModelIndex(); -} - -DirTreeModelItem* DirTreeModel::itemFromIndex(const QModelIndex& index) const { - return reinterpret_cast(index.internalPointer()); -} - -QModelIndex DirTreeModel::indexFromPath(FmPath* path) const { - DirTreeModelItem* item = itemFromPath(path); - return item ? item->index() : QModelIndex(); -} - -DirTreeModelItem* DirTreeModel::itemFromPath(FmPath* path) const { - Q_FOREACH(DirTreeModelItem* item, rootItems_) { - if(item->fileInfo_ && fm_path_equal(path, fm_file_info_get_path(item->fileInfo_))) { - return item; - } - else { - DirTreeModelItem* child = item->childFromPath(path, true); - if(child) - return child; - } - } - return NULL; -} - - -void DirTreeModel::loadRow(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - Q_ASSERT(item); - if(item && !item->isPlaceHolder()) - item->loadFolder(); -} - -void DirTreeModel::unloadRow(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - if(item && !item->isPlaceHolder()) - item->unloadFolder(); -} - -bool DirTreeModel::isLoaded(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - return item ? item->loaded_ : false; -} - -QIcon DirTreeModel::icon(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - return item ? item->icon_ : QIcon(); -} - -FmFileInfo* DirTreeModel::fileInfo(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - return item ? item->fileInfo_ : NULL; -} - -FmPath* DirTreeModel::filePath(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - return item && item->fileInfo_ ? fm_file_info_get_path(item->fileInfo_) : NULL; -} - -QString DirTreeModel::dispName(const QModelIndex& index) { - DirTreeModelItem* item = itemFromIndex(index); - return item ? item->displayName_ : QString(); -} - -void DirTreeModel::setShowHidden(bool show_hidden) { - showHidden_ = show_hidden; - Q_FOREACH(DirTreeModelItem* item, rootItems_) { - item->setShowHidden(show_hidden); - } -} - - -} // namespace Fm diff --git a/libfm-qt/dirtreemodel.h b/libfm-qt/dirtreemodel.h deleted file mode 100644 index d24e9d3..0000000 --- a/libfm-qt/dirtreemodel.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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 FM_DIRTREEMODEL_H -#define FM_DIRTREEMODEL_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include -#include - -namespace Fm { - -class DirTreeModelItem; -class DirTreeView; - -class LIBFM_QT_API DirTreeModel : public QAbstractItemModel { - Q_OBJECT - -public: - friend class DirTreeModelItem; // allow direct access of private members in DirTreeModelItem - friend class DirTreeView; // allow direct access of private members in DirTreeView - - enum Role { - FileInfoRole = Qt::UserRole - }; - - explicit DirTreeModel(QObject* parent); - ~DirTreeModel(); - - QModelIndex addRoot(FmFileInfo* root); - void loadRow(const QModelIndex& index); - void unloadRow(const QModelIndex& index); - - bool isLoaded(const QModelIndex& index); - QIcon icon(const QModelIndex& index); - FmFileInfo* fileInfo(const QModelIndex& index); - FmPath* filePath(const QModelIndex& index); - QString dispName(const QModelIndex& index); - - void setShowHidden(bool show_hidden); - bool showHidden() const { - return showHidden_; - } - - QModelIndex indexFromPath(FmPath* path) const; - - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual int columnCount(const QModelIndex& parent) const; - virtual int rowCount(const QModelIndex& parent) const; - virtual QModelIndex parent(const QModelIndex& child) const; - virtual QModelIndex index(int row, int column, const QModelIndex& parent) const; - virtual bool hasChildren(const QModelIndex& parent = QModelIndex()) const; - -private: - DirTreeModelItem* itemFromPath(FmPath* path) const; - DirTreeModelItem* itemFromIndex(const QModelIndex& index) const; - QModelIndex indexFromItem(DirTreeModelItem* item) const; - -Q_SIGNALS: - void rowLoaded(const QModelIndex& index); - -private: - bool showHidden_; - QList rootItems_; -}; -} - -#endif // FM_DIRTREEMODEL_H diff --git a/libfm-qt/dirtreemodelitem.cpp b/libfm-qt/dirtreemodelitem.cpp deleted file mode 100644 index 1e69af5..0000000 --- a/libfm-qt/dirtreemodelitem.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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. - * - */ - -#include "dirtreemodelitem.h" -#include "dirtreemodel.h" -#include "icontheme.h" -#include - -namespace Fm { - -DirTreeModelItem::DirTreeModelItem(): - model_(NULL), - folder_(NULL), - expanded_(false), - loaded_(false), - fileInfo_(NULL), - placeHolderChild_(NULL), - parent_(NULL) { -} - -DirTreeModelItem::DirTreeModelItem(FmFileInfo* info, DirTreeModel* model, DirTreeModelItem* parent): - model_(model), - folder_(NULL), - expanded_(false), - loaded_(false), - fileInfo_(fm_file_info_ref(info)), - displayName_(QString::fromUtf8(fm_file_info_get_disp_name(info))), - icon_(IconTheme::icon(fm_file_info_get_icon(info))), - placeHolderChild_(NULL), - parent_(parent) { - - if(info) - addPlaceHolderChild(); -} - -DirTreeModelItem::~DirTreeModelItem() { - if(fileInfo_) - fm_file_info_unref(fileInfo_); - - if(folder_) - freeFolder(); - - // delete child items if needed - if(!children_.isEmpty()) { - Q_FOREACH(DirTreeModelItem* item, children_) { - delete item; - } - } - if(!hiddenChildren_.isEmpty()) { - Q_FOREACH(DirTreeModelItem* item, hiddenChildren_) { - delete item; - } - } -} - -void DirTreeModelItem::addPlaceHolderChild() { - placeHolderChild_ = new DirTreeModelItem(); - placeHolderChild_->parent_ = this; - placeHolderChild_->model_ = model_; - placeHolderChild_->displayName_ = DirTreeModel::tr("Loading..."); - children_.append(placeHolderChild_); -} - -void DirTreeModelItem::freeFolder() { - if(folder_) { - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFolderFinishLoading), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFolderFilesAdded), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFolderFilesRemoved), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFolderFilesChanged), this); - g_object_unref(folder_); - folder_ = NULL; - } -} - -void DirTreeModelItem::loadFolder() { - if(!expanded_) { - /* dynamically load content of the folder. */ - folder_ = fm_folder_from_path(fm_file_info_get_path(fileInfo_)); - /* g_debug("fm_dir_tree_model_load_row()"); */ - /* associate the data with loaded handler */ - g_signal_connect(folder_, "finish-loading", G_CALLBACK(onFolderFinishLoading), this); - g_signal_connect(folder_, "files-added", G_CALLBACK(onFolderFilesAdded), this); - g_signal_connect(folder_, "files-removed", G_CALLBACK(onFolderFilesRemoved), this); - g_signal_connect(folder_, "files-changed", G_CALLBACK(onFolderFilesChanged), this); - - /* set 'expanded' flag beforehand as callback may check it */ - expanded_ = true; - /* if the folder is already loaded, call "loaded" handler ourselves */ - if(fm_folder_is_loaded(folder_)) { // already loaded - GList* file_l; - FmFileInfoList* files = fm_folder_get_files(folder_); - for(file_l = fm_file_info_list_peek_head_link(files); file_l; file_l = file_l->next) { - FmFileInfo* fi = FM_FILE_INFO(file_l->data); - if(fm_file_info_is_dir(fi)) { - insertFileInfo(fi); - } - } - onFolderFinishLoading(folder_, this); - } - } -} - -void DirTreeModelItem::unloadFolder() { - if(expanded_) { /* do some cleanup */ - /* remove all children, and replace them with a dummy child - * item to keep expander in the tree view around. */ - - // delete all visible child items - model_->beginRemoveRows(index(), 0, children_.count() - 1); - if(!children_.isEmpty()) { - Q_FOREACH(DirTreeModelItem* item, children_) { - delete item; - } - children_.clear(); - } - model_->endRemoveRows(); - - // remove hidden children - if(!hiddenChildren_.isEmpty()) { - Q_FOREACH(DirTreeModelItem* item, hiddenChildren_) { - delete item; - } - hiddenChildren_.clear(); - } - - /* now, we have no child since all child items are removed. - * So we add a place holder child item to keep the expander around. */ - addPlaceHolderChild(); - /* deactivate folder since it will be reactivated on expand */ - freeFolder(); - expanded_ = false; - loaded_ = false; - } -} - -QModelIndex DirTreeModelItem::index() { - Q_ASSERT(model_); - return model_->indexFromItem(this); -} - -/* Add file info to parent node to proper position. - * GtkTreePath tp is the tree path of parent node. */ -DirTreeModelItem* DirTreeModelItem::insertFileInfo(FmFileInfo* fi) { - // qDebug() << "insertFileInfo: " << fm_file_info_get_disp_name(fi); - DirTreeModelItem* item = new DirTreeModelItem(fi, model_); - insertItem(item); - return item; -} - -// find a good position to insert the new item -int DirTreeModelItem::insertItem(DirTreeModelItem* newItem) { - if(model_->showHidden() || !newItem->fileInfo_ || !fm_file_info_is_hidden(newItem->fileInfo_)) { - const char* new_key = fm_file_info_get_collate_key(newItem->fileInfo_); - int pos = 0; - QList::iterator it; - for(it = children_.begin(); it != children_.end(); ++it) { - DirTreeModelItem* child = *it; - if(G_UNLIKELY(!child->fileInfo_)) - continue; - const char* key = fm_file_info_get_collate_key(child->fileInfo_); - if(strcmp(new_key, key) <= 0) - break; - ++pos; - } - // inform the world that we're about to insert the item - model_->beginInsertRows(index(), pos, pos); - newItem->parent_ = this; - children_.insert(it, newItem); - model_->endInsertRows(); - return pos; - } - else { // hidden folder - hiddenChildren_.append(newItem); - } - return -1; -} - - -// FmFolder signal handlers - -// static -void DirTreeModelItem::onFolderFinishLoading(FmFolder* folder, gpointer user_data) { - DirTreeModelItem* _this = (DirTreeModelItem*)user_data; - DirTreeModel* model = _this->model_; - /* set 'loaded' flag beforehand as callback may check it */ - _this->loaded_ = true; - QModelIndex index = _this->index(); -qDebug() << "folder loaded"; - // remove the placeholder child if needed - if(_this->children_.count() == 1) { // we have no other child other than the place holder item, leave it - _this->placeHolderChild_->displayName_ = DirTreeModel::tr(""); - QModelIndex placeHolderIndex = _this->placeHolderChild_->index(); - // qDebug() << "placeHolderIndex: "<dataChanged(placeHolderIndex, placeHolderIndex); - } - else { - int pos = _this->children_.indexOf(_this->placeHolderChild_); - model->beginRemoveRows(index, pos, pos); - _this->children_.removeAt(pos); - delete _this->placeHolderChild_; - model->endRemoveRows(); - _this->placeHolderChild_ = NULL; - } - - Q_EMIT model->rowLoaded(index); -} - -// static -void DirTreeModelItem::onFolderFilesAdded(FmFolder* folder, GSList* files, gpointer user_data) { - GSList* l; - DirTreeModelItem* _this = (DirTreeModelItem*)user_data; - for(l = files; l; l = l->next) { - FmFileInfo* fi = FM_FILE_INFO(l->data); - if(fm_file_info_is_dir(fi)) { /* FIXME: maybe adding files can be allowed later */ - /* Ideally FmFolder should not emit files-added signals for files that - * already exists. So there is no need to check for duplication here. */ - _this->insertFileInfo(fi); - } - } -} - -// static -void DirTreeModelItem::onFolderFilesRemoved(FmFolder* folder, GSList* files, gpointer user_data) { - DirTreeModelItem* _this = (DirTreeModelItem*)user_data; - DirTreeModel* model = _this->model_; - - for(GSList* l = files; l; l = l->next) { - FmFileInfo* fi = FM_FILE_INFO(l->data); - int pos; - DirTreeModelItem* child = _this->childFromName(fm_file_info_get_name(fi), &pos); - if(child) { - model->beginRemoveRows(_this->index(), pos, pos); - _this->children_.removeAt(pos); - delete child; - model->endRemoveRows(); - } - } -} - -// static -void DirTreeModelItem::onFolderFilesChanged(FmFolder* folder, GSList* files, gpointer user_data) { - DirTreeModelItem* _this = (DirTreeModelItem*)user_data; - DirTreeModel* model = _this->model_; - - for(GSList* l = files; l; l = l->next) { - FmFileInfo* changedFile = FM_FILE_INFO(l->data); - int pos; - DirTreeModelItem* child = _this->childFromName(fm_file_info_get_name(changedFile), &pos); - if(child) { - QModelIndex childIndex = child->index(); - Q_EMIT model->dataChanged(childIndex, childIndex); - } - } -} - -DirTreeModelItem* DirTreeModelItem::childFromName(const char* utf8_name, int* pos) { - int i = 0; - Q_FOREACH(DirTreeModelItem* item, children_) { - if(item->fileInfo_ && strcmp(fm_file_info_get_name(item->fileInfo_), utf8_name) == 0) { - if(pos) - *pos = i; - return item; - } - ++i; - } - return NULL; -} - -DirTreeModelItem* DirTreeModelItem::childFromPath(FmPath* path, bool recursive) const { - Q_ASSERT(path != NULL); - - Q_FOREACH(DirTreeModelItem* item, children_) { - // if(item->fileInfo_) - // qDebug() << "child: " << QString::fromUtf8(fm_file_info_get_disp_name(item->fileInfo_)); - if(item->fileInfo_ && fm_path_equal(fm_file_info_get_path(item->fileInfo_), path)) { - return item; - } - else if(recursive) { - DirTreeModelItem* child = item->childFromPath(path, true); - if(child) - return child; - } - } - return NULL; -} - -void DirTreeModelItem::setShowHidden(bool show) { - if(show) { - // move all hidden children to visible list - Q_FOREACH(DirTreeModelItem* item, hiddenChildren_) { - insertItem(item); - } - hiddenChildren_.clear(); - } - else { // hide hidden folders - QModelIndex _index = index(); - QList::iterator it, next; - int pos = 0; - for(it = children_.begin(); it != children_.end(); ++pos) { - DirTreeModelItem* item = *it; - next = it + 1; - if(item->fileInfo_) { - if(fm_file_info_is_hidden(item->fileInfo_)) { // hidden folder - // remove from the model and add to the hiddenChildren_ list - model_->beginRemoveRows(_index, pos, pos); - children_.erase(it); - hiddenChildren_.append(item); - model_->endRemoveRows(); - } - else { // visible folder, recursively filter its children - item->setShowHidden(show); - } - } - it = next; - } - } -} - - - -} // namespace Fm - diff --git a/libfm-qt/dirtreemodelitem.h b/libfm-qt/dirtreemodelitem.h deleted file mode 100644 index 21b6f98..0000000 --- a/libfm-qt/dirtreemodelitem.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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 FM_DIRTREEMODELITEM_H -#define FM_DIRTREEMODELITEM_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include - -namespace Fm { - -class DirTreeModel; -class DirTreeView; - -class LIBFM_QT_API DirTreeModelItem { -public: - friend class DirTreeModel; // allow direct access of private members in DirTreeModel - friend class DirTreeView; // allow direct access of private members in DirTreeView - - explicit DirTreeModelItem(); - explicit DirTreeModelItem(FmFileInfo* info, DirTreeModel* model, DirTreeModelItem* parent = NULL); - ~DirTreeModelItem(); - - void loadFolder(); - void unloadFolder(); - - bool isPlaceHolder() { - return (fileInfo_ == NULL); - } - - void setShowHidden(bool show); - -private: - void freeFolder(); - void addPlaceHolderChild(); - DirTreeModelItem* childFromName(const char* utf8_name, int* pos); - DirTreeModelItem* childFromPath(FmPath* path, bool recursive) const; - - DirTreeModelItem* insertFileInfo(FmFileInfo* fi); - int insertItem(Fm::DirTreeModelItem* newItem); - QModelIndex index(); - - static void onFolderFinishLoading(FmFolder* folder, gpointer user_data); - static void onFolderFilesAdded(FmFolder* folder, GSList* files, gpointer user_data); - static void onFolderFilesRemoved(FmFolder* folder, GSList* files, gpointer user_data); - static void onFolderFilesChanged(FmFolder* folder, GSList* files, gpointer user_data); - -private: - FmFileInfo* fileInfo_; - FmFolder* folder_; - QString displayName_ ; - QIcon icon_; - bool expanded_; - bool loaded_; - DirTreeModelItem* parent_; - DirTreeModelItem* placeHolderChild_; - QList children_; - QList hiddenChildren_; - DirTreeModel* model_; -}; - -} - -#endif // FM_DIRTREEMODELITEM_H diff --git a/libfm-qt/dirtreeview.cpp b/libfm-qt/dirtreeview.cpp deleted file mode 100644 index f5cadfe..0000000 --- a/libfm-qt/dirtreeview.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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. - * - */ - -#include "dirtreeview.h" -#include -#include -#include -#include -#include -#include "dirtreemodel.h" -#include "dirtreemodelitem.h" -#include "filemenu.h" - -using namespace Fm; - -DirTreeView::DirTreeView(QWidget* parent): - currentExpandingItem_(NULL), - currentPath_(NULL) { - - setSelectionMode(QAbstractItemView::SingleSelection); - setHeaderHidden(true); - setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); - header()->setStretchLastSection(false); - - connect(this, &DirTreeView::collapsed, this, &DirTreeView::onCollapsed); - connect(this, &DirTreeView::expanded, this, &DirTreeView::onExpanded); - - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, &DirTreeView::customContextMenuRequested, - this, &DirTreeView::onCustomContextMenuRequested); -} - -DirTreeView::~DirTreeView() { - if(currentPath_) - fm_path_unref(currentPath_); -} - -void DirTreeView::cancelPendingChdir() { - if(!pathsToExpand_.isEmpty()) { - pathsToExpand_.clear(); - if(!currentExpandingItem_) - return; - DirTreeModel* _model = static_cast(model()); - disconnect(_model, &DirTreeModel::rowLoaded, this, &DirTreeView::onRowLoaded); - currentExpandingItem_ = NULL; - } -} - -void DirTreeView::expandPendingPath() { - if(pathsToExpand_.isEmpty()) - return; - - FmPath* path = pathsToExpand_.first().data(); - // qDebug() << "expanding: " << Path(path).displayBasename(); - DirTreeModel* _model = static_cast(model()); - DirTreeModelItem* item = _model->itemFromPath(path); - // qDebug() << "findItem: " << item; - if(item) { - currentExpandingItem_ = item; - connect(_model, &DirTreeModel::rowLoaded, this, &DirTreeView::onRowLoaded); - if(item->loaded_) { // the node is already loaded - onRowLoaded(item->index()); - } - else { - // _model->loadRow(item->index()); - item->loadFolder(); - } - } - else { - selectionModel()->clear(); - /* since we never get it loaded we need to update cwd here */ - if(currentPath_) - fm_path_unref(currentPath_); - currentPath_ = fm_path_ref(path); - - cancelPendingChdir(); // FIXME: is this correct? this is not done in the gtk+ version of libfm. - } -} - -void DirTreeView::onRowLoaded(const QModelIndex& index) { - DirTreeModel* _model = static_cast(model()); - if(!currentExpandingItem_) - return; - if(currentExpandingItem_ != _model->itemFromIndex(index)) { - return; - } - /* disconnect the handler since we only need it once */ - disconnect(_model, &DirTreeModel::rowLoaded, this, &DirTreeView::onRowLoaded); - - // DirTreeModelItem* item = _model->itemFromIndex(index); - // qDebug() << "row loaded: " << item->displayName_; - /* after the folder is loaded, the files should have been added to - * the tree model */ - expand(index); - - /* remove the expanded path from pending list */ - pathsToExpand_.removeFirst(); - if(pathsToExpand_.isEmpty()) { /* this is the last one and we're done, select the item */ - // qDebug() << "Done!"; - selectionModel()->select(index, QItemSelectionModel::SelectCurrent|QItemSelectionModel::Clear); - scrollTo(index, QAbstractItemView::EnsureVisible); - } - else { /* continue expanding next pending path */ - expandPendingPath(); - } -} - - -void DirTreeView::setCurrentPath(FmPath* path) { - DirTreeModel* _model = static_cast(model()); - if(!_model) - return; - int rowCount = _model->rowCount(QModelIndex()); - if(rowCount <= 0 || fm_path_equal(currentPath_, path)) - return; - - if(currentPath_) - fm_path_unref(currentPath_); - currentPath_ = fm_path_ref(path); - - // NOTE: The content of each node is loaded on demand dynamically. - // So, when we ask for a chdir operation, some nodes do not exists yet. - // We have to wait for the loading of child nodes and continue the - // pending chdir operation after the child nodes become available. - - // cancel previous pending tree expansion - cancelPendingChdir(); - - /* find a root item containing this path */ - FmPath* root; - for(int row = 0; row < rowCount; ++row) { - QModelIndex index = _model->index(row, 0, QModelIndex()); - root = _model->filePath(index); - if(fm_path_has_prefix(path, root)) - break; - root = NULL; - } - - if(root) { /* root item is found */ - do { /* add path elements one by one to a list */ - pathsToExpand_.prepend(path); - // qDebug() << "prepend path: " << Path(path).displayBasename(); - if(fm_path_equal(path, root)) - break; - path = fm_path_get_parent(path); - } - while(path); - - expandPendingPath(); - } -} - -void DirTreeView::setModel(QAbstractItemModel* model) { - Q_ASSERT(model->inherits("Fm::DirTreeModel")); - - if(!pathsToExpand_.isEmpty()) // if a chdir request is in progress, cancel it - cancelPendingChdir(); - - QTreeView::setModel(model); - header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); - connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, &DirTreeView::onSelectionChanged); -} - -void DirTreeView::mousePressEvent(QMouseEvent* event) { - if(event && event->button() == Qt::RightButton && - event->type() == QEvent::MouseButtonPress) { - // Do not change the selection when the context menu is activated. - return; - } - QTreeView::mousePressEvent(event); -} - -void DirTreeView::onCustomContextMenuRequested(const QPoint& pos) { - QModelIndex index = indexAt(pos); - if(index.isValid()) { - QVariant data = index.data(DirTreeModel::FileInfoRole); - FmFileInfo* fileInfo = reinterpret_cast(data.value()); - if(fileInfo) { - FmPath* path = fm_file_info_get_path(fileInfo); - FmFileInfoList* files = fm_file_info_list_new(); - fm_file_info_list_push_tail(files, fileInfo); - Fm::FileMenu* menu = new Fm::FileMenu(files, fileInfo, path); - // FIXME: apply some settings to the menu and set a proper file launcher to it - Q_EMIT prepareFileMenu(menu); - fm_file_info_list_unref(files); - QVariant pathData = qVariantFromValue(reinterpret_cast(path)); - QAction* action = menu->openAction(); - action->disconnect(); - action->setData(index); - connect(action, &QAction::triggered, this, &DirTreeView::onOpen); - action = new QAction(QIcon::fromTheme("window-new"), tr("Open in New T&ab"), menu); - action->setData(pathData); - connect(action, &QAction::triggered, this, &DirTreeView::onNewTab); - menu->insertAction(menu->separator1(), action); - action = new QAction(QIcon::fromTheme("window-new"), tr("Open in New Win&dow"), menu); - action->setData(pathData); - connect(action, &QAction::triggered, this, &DirTreeView::onNewWindow); - menu->insertAction(menu->separator1(), action); - if(fm_file_info_is_native(fileInfo)) { - action = new QAction(QIcon::fromTheme("utilities-terminal"), tr("Open in Termina&l"), menu); - action->setData(pathData); - connect(action, &QAction::triggered, this, &DirTreeView::onOpenInTerminal); - menu->insertAction(menu->separator1(), action); - } - menu->exec(mapToGlobal(pos)); - delete menu; - } - } -} - -void DirTreeView::onOpen() { - if(QAction* action = qobject_cast(sender())) { - setCurrentIndex(action->data().toModelIndex()); - } -} - -void DirTreeView::onNewWindow() { - if(QAction* action = qobject_cast(sender())) { - FmPath* path = reinterpret_cast(action->data().value()); - Q_EMIT openFolderInNewWindowRequested(path); - } -} - -void DirTreeView::onNewTab() { - if(QAction* action = qobject_cast(sender())) { - FmPath* path = reinterpret_cast(action->data().value()); - Q_EMIT openFolderInNewTabRequested(path); - } -} - -void DirTreeView::onOpenInTerminal() { - if(QAction* action = qobject_cast(sender())) { - FmPath* path = reinterpret_cast(action->data().value()); - Q_EMIT openFolderInTerminalRequested(path); - } -} - -void DirTreeView::onNewFolder() { - if(QAction* action = qobject_cast(sender())) { - FmPath* path = reinterpret_cast(action->data().value()); - Q_EMIT createNewFolderRequested(path); - } -} - -void DirTreeView::onCollapsed(const QModelIndex& index) { - DirTreeModel* treeModel = static_cast(model()); - if(treeModel) { - treeModel->unloadRow(index); - } -} - -void DirTreeView::onExpanded(const QModelIndex& index) { - DirTreeModel* treeModel = static_cast(model()); - if(treeModel) { - treeModel->loadRow(index); - } -} - -void DirTreeView::onSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected) { - if(!selected.isEmpty()) { - QModelIndex index = selected.first().topLeft(); - DirTreeModel* _model = static_cast(model()); - FmPath* path = _model->filePath(index); - if(path && currentPath_ && fm_path_equal(path, currentPath_)) - return; - cancelPendingChdir(); - if(!path) - return; - if(currentPath_) - fm_path_unref(currentPath_); - currentPath_ = fm_path_ref(path); - - // FIXME: use enums for type rather than hard-coded values 0 or 1 - int type = 0; - if(QGuiApplication::mouseButtons() & Qt::MiddleButton) - type = 1; - Q_EMIT chdirRequested(type, path); - } -} diff --git a/libfm-qt/dirtreeview.h b/libfm-qt/dirtreeview.h deleted file mode 100644 index c6573bc..0000000 --- a/libfm-qt/dirtreeview.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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 FM_DIRTREEVIEW_H -#define FM_DIRTREEVIEW_H - -#include "libfmqtglobals.h" -#include -#include -#include "path.h" - -class QItemSelection; - -namespace Fm { - -class FileMenu; -class DirTreeModelItem; - -class LIBFM_QT_API DirTreeView : public QTreeView { - Q_OBJECT - -public: - DirTreeView(QWidget* parent); - ~DirTreeView(); - - FmPath* currentPath() { - return currentPath_; - } - - void setCurrentPath(FmPath* path); - - // libfm-gtk compatible alias - FmPath* getCwd() { - return currentPath(); - } - - void chdir(FmPath* path) { - setCurrentPath(path); - } - - virtual void setModel(QAbstractItemModel* model); - -protected: - virtual void mousePressEvent(QMouseEvent* event); - -private: - void cancelPendingChdir(); - void expandPendingPath(); - -Q_SIGNALS: - void chdirRequested(int type, FmPath* path); - void openFolderInNewWindowRequested(FmPath* path); - void openFolderInNewTabRequested(FmPath* path); - void openFolderInTerminalRequested(FmPath* path); - void createNewFolderRequested(FmPath* path); - void prepareFileMenu(Fm::FileMenu* menu); // emit before showing a Fm::FileMenu - -protected Q_SLOTS: - void onCollapsed(const QModelIndex & index); - void onExpanded(const QModelIndex & index); - void onRowLoaded(const QModelIndex& index); - void onSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected); - void onCustomContextMenuRequested(const QPoint& pos); - void onOpen(); - void onNewWindow(); - void onNewTab(); - void onOpenInTerminal(); - void onNewFolder(); - -private: - FmPath* currentPath_; - QList pathsToExpand_; - DirTreeModelItem* currentExpandingItem_; -}; - -} - -#endif // FM_DIRTREEVIEW_H diff --git a/libfm-qt/dndactionmenu.cpp b/libfm-qt/dndactionmenu.cpp deleted file mode 100644 index 62625ea..0000000 --- a/libfm-qt/dndactionmenu.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "dndactionmenu.h" - -using namespace Fm; - -DndActionMenu::DndActionMenu(QWidget* parent): QMenu(parent) { - copyAction = addAction(QIcon::fromTheme("edit-copy"), tr("Copy here")); - moveAction = addAction(tr("Move here")); - linkAction = addAction(tr("Create symlink here")); - addSeparator(); - cancelAction = addAction(tr("Cancel")); -} - -DndActionMenu::~DndActionMenu() { - -} - -Qt::DropAction DndActionMenu::askUser(QPoint pos) { - Qt::DropAction result; - DndActionMenu menu; - QAction* action = menu.exec(pos); - if(action == menu.copyAction) - result = Qt::CopyAction; - else if(action == menu.moveAction) - result = Qt::MoveAction; - else if(action == menu.linkAction) - result = Qt::LinkAction; - else - result = Qt::IgnoreAction; - return result; -} diff --git a/libfm-qt/dndactionmenu.h b/libfm-qt/dndactionmenu.h deleted file mode 100644 index 473c574..0000000 --- a/libfm-qt/dndactionmenu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_DNDACTIONMENU_H -#define FM_DNDACTIONMENU_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class DndActionMenu : public QMenu { -Q_OBJECT -public: - explicit DndActionMenu(QWidget* parent = 0); - virtual ~DndActionMenu(); - - static Qt::DropAction askUser(QPoint pos); - -private: - QAction* copyAction; - QAction* moveAction; - QAction* linkAction; - QAction* cancelAction; -}; - -} - -#endif // FM_DNDACTIONMENU_H diff --git a/libfm-qt/dnddest.cpp b/libfm-qt/dnddest.cpp deleted file mode 100644 index ec7a0bd..0000000 --- a/libfm-qt/dnddest.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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. - * - */ - -#include "dnddest.h" -#include "fileoperation.h" -#include "utilities.h" - -using namespace Fm; - -const char* supportedMimeTypes[] = { - "text/uri-list" - "XdndDirectSave0"/* X direct save */ - /* TODO: add more targets to support: text types, _NETSCAPE_URL, property/bgimage ... */ -}; - -DndDest::DndDest() { - -} - -DndDest::~DndDest() { - -} - -bool DndDest::dropMimeData(const QMimeData* data, Qt::DropAction action) { - // FIXME: should we put this in dropEvent handler of FolderView instead? - if(data->hasUrls()) { - qDebug("drop action: %d", action); - FmPathList* srcPaths = pathListFromQUrls(data->urls()); - switch(action) { - case Qt::CopyAction: - FileOperation::copyFiles(srcPaths, destPath_.data()); - break; - case Qt::MoveAction: - FileOperation::moveFiles(srcPaths, destPath_.data()); - break; - case Qt::LinkAction: - FileOperation::symlinkFiles(srcPaths, destPath_.data()); - default: - fm_path_list_unref(srcPaths); - return false; - } - fm_path_list_unref(srcPaths); - return true; - } - return false; -} - -bool DndDest::isSupported(const QMimeData* data) { - return false; -} - -bool DndDest::isSupported(QString mimeType) { - return false; -} diff --git a/libfm-qt/dnddest.h b/libfm-qt/dnddest.h deleted file mode 100644 index 2084ad5..0000000 --- a/libfm-qt/dnddest.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * 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 FM_DNDDEST_H -#define FM_DNDDEST_H - -#include -#include "path.h" - -namespace Fm { - -class DndDest { -public: - DndDest(); - ~DndDest(); - - void setDestPath(FmPath* dest) { - destPath_ = dest; - } - - const Path& destPath() { - return destPath_; - } - - bool isSupported(const QMimeData* data); - bool isSupported(QString mimeType); - - bool dropMimeData(const QMimeData* data, Qt::DropAction action); - -private: - Path destPath_; -}; - -} - -#endif // FM_DNDDEST_H diff --git a/libfm-qt/edit-bookmarks.ui b/libfm-qt/edit-bookmarks.ui deleted file mode 100644 index 8d989e6..0000000 --- a/libfm-qt/edit-bookmarks.ui +++ /dev/null @@ -1,143 +0,0 @@ - - - EditBookmarksDialog - - - - 0 - 0 - 480 - 320 - - - - Edit Bookmarks - - - - - - true - - - true - - - QAbstractItemView::InternalMove - - - Qt::MoveAction - - - false - - - false - - - 100 - - - - Name - - - - - Location - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - &Add Item - - - - - - - - - - &Remove Item - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Use drag and drop to reorder the items - - - - - - - - - buttonBox - accepted() - EditBookmarksDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - EditBookmarksDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/libfm-qt/editbookmarksdialog.cpp b/libfm-qt/editbookmarksdialog.cpp deleted file mode 100644 index 471db3a..0000000 --- a/libfm-qt/editbookmarksdialog.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - - Copyright (C) 2013 PCMan - - 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. -*/ - - -#include "editbookmarksdialog.h" -#include "ui_edit-bookmarks.h" -#include -#include -#include -#include -#include - -using namespace Fm; - -EditBookmarksDialog::EditBookmarksDialog(FmBookmarks* bookmarks, QWidget* parent, Qt::WindowFlags f): - QDialog(parent, f), - ui(new Ui::EditBookmarksDialog()), - bookmarks_(FM_BOOKMARKS(g_object_ref(bookmarks))) { - - ui->setupUi(this); - setAttribute(Qt::WA_DeleteOnClose); // auto delete on close - - // load bookmarks - GList* allBookmarks = fm_bookmarks_get_all(bookmarks_); - for(GList* l = allBookmarks; l; l = l->next) { - FmBookmarkItem* bookmark = reinterpret_cast(l->data); - QTreeWidgetItem* item = new QTreeWidgetItem(); - char* path_str = fm_path_display_name(bookmark->path, false); - item->setData(0, Qt::DisplayRole, QString::fromUtf8(bookmark->name)); - item->setData(1, Qt::DisplayRole, QString::fromUtf8(path_str)); - item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsDragEnabled|Qt::ItemIsEnabled); - g_free(path_str); - ui->treeWidget->addTopLevelItem(item); - } - g_list_free_full(allBookmarks, (GDestroyNotify)fm_bookmark_item_unref); - - connect(ui->addItem, &QPushButton::clicked, this, &EditBookmarksDialog::onAddItem); - connect(ui->removeItem, &QPushButton::clicked, this, &EditBookmarksDialog::onRemoveItem); -} - -EditBookmarksDialog::~EditBookmarksDialog() { - g_object_unref(bookmarks_); - delete ui; -} - -void EditBookmarksDialog::accept() { - // save bookmarks - // it's easier to recreate the whole bookmark file than - // to manipulate FmBookmarks object. So here we generate the file directly. - // FIXME: maybe in the future we should add a libfm API to easily replace all FmBookmarks. - // Here we use gtk+ 3.0 bookmarks rather than the gtk+ 2.0 one. - // Since gtk+ 2.24.12, gtk+2 reads gtk+3 bookmarks file if it exists. - // So it's safe to only save gtk+3 bookmarks file. - QString path = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); - path += QLatin1String("/gtk-3.0"); - if(!QDir().mkpath(path)) - return; // fail to create ~/.config/gtk-3.0 dir - path += QLatin1String("/bookmarks"); - QSaveFile file(path); // use QSaveFile for atomic file operation - if(file.open(QIODevice::WriteOnly)){ - for(int row = 0; ; ++row) { - QTreeWidgetItem* item = ui->treeWidget->topLevelItem(row); - if(!item) - break; - QString name = item->data(0, Qt::DisplayRole).toString(); - QUrl url = QUrl::fromUserInput(item->data(1, Qt::DisplayRole).toString()); - file.write(url.toEncoded()); - file.write(" "); - file.write(name.toUtf8()); - file.write("\n"); - } - // FIXME: should we support Qt or KDE specific bookmarks in the future? - file.commit(); - } - QDialog::accept(); -} - -void EditBookmarksDialog::onAddItem() { - QTreeWidgetItem* item = new QTreeWidgetItem(); - item->setData(0, Qt::DisplayRole, tr("New bookmark")); - item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsDragEnabled|Qt::ItemIsEnabled); - ui->treeWidget->addTopLevelItem(item); - ui->treeWidget->editItem(item); -} - -void EditBookmarksDialog::onRemoveItem() { - QList sels = ui->treeWidget->selectedItems(); - Q_FOREACH(QTreeWidgetItem* item, sels) { - delete item; - } -} - - diff --git a/libfm-qt/editbookmarksdialog.h b/libfm-qt/editbookmarksdialog.h deleted file mode 100644 index 7b0d74c..0000000 --- a/libfm-qt/editbookmarksdialog.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - - Copyright (C) 2013 PCMan - - 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 FM_EDITBOOKMARKSDIALOG_H -#define FM_EDITBOOKMARKSDIALOG_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Ui { -class EditBookmarksDialog; -}; - -namespace Fm { - -class LIBFM_QT_API EditBookmarksDialog : public QDialog { -Q_OBJECT -public: - explicit EditBookmarksDialog(FmBookmarks* bookmarks, QWidget* parent = 0, Qt::WindowFlags f = 0); - virtual ~EditBookmarksDialog(); - - virtual void accept(); - -private Q_SLOTS: - void onAddItem(); - void onRemoveItem(); - -private: - Ui::EditBookmarksDialog* ui; - FmBookmarks* bookmarks_; -}; - -} - -#endif // FM_EDITBOOKMARKSDIALOG_H diff --git a/libfm-qt/exec-file.ui b/libfm-qt/exec-file.ui deleted file mode 100644 index c5a9ea3..0000000 --- a/libfm-qt/exec-file.ui +++ /dev/null @@ -1,163 +0,0 @@ - - - ExecFileDialog - - - - 0 - 0 - 487 - 58 - - - - Execute file - - - - - - - - - - - - - - true - - - - - - - - - - - &Open - - - - - - true - - - - - - - E&xecute - - - - - - - - - - Execute in &Terminal - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - - - - - - - - cancel - clicked() - ExecFileDialog - reject() - - - 341 - 39 - - - 196 - 28 - - - - - exec - clicked() - ExecFileDialog - accept() - - - 56 - 39 - - - 196 - 28 - - - - - execTerm - clicked() - ExecFileDialog - accept() - - - 201 - 39 - - - 196 - 28 - - - - - open - clicked() - ExecFileDialog - accept() - - - 346 - 39 - - - 250 - 28 - - - - - diff --git a/libfm-qt/execfiledialog.cpp b/libfm-qt/execfiledialog.cpp deleted file mode 100644 index 9bd3b3b..0000000 --- a/libfm-qt/execfiledialog.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "execfiledialog_p.h" -#include "ui_exec-file.h" -#include "icontheme.h" - -namespace Fm { - -ExecFileDialog::ExecFileDialog(FmFileInfo* file, QWidget* parent, Qt::WindowFlags f): - QDialog (parent, f), - fileInfo_(fm_file_info_ref(file)), - result_(FM_FILE_LAUNCHER_EXEC_CANCEL), - ui(new Ui::ExecFileDialog()) { - - ui->setupUi(this); - // show file icon - FmIcon* icon = fm_file_info_get_icon(fileInfo_); - ui->icon->setPixmap(IconTheme::icon(icon).pixmap(QSize(48, 48))); - - QString msg; - if(fm_file_info_is_text(file)) { - msg = tr("This text file '%1' seems to be an executable script.\nWhat do you want to do with it?") - .arg(QString::fromUtf8(fm_file_info_get_disp_name(file))); - ui->execTerm->setDefault(true); - } - else { - msg= tr("This file '%1' is executable. Do you want to execute it?") - .arg(QString::fromUtf8(fm_file_info_get_disp_name(file))); - ui->exec->setDefault(true); - ui->open->hide(); - } - ui->msg->setText(msg); -} - -ExecFileDialog::~ExecFileDialog() { - delete ui; - if(fileInfo_) - fm_file_info_unref(fileInfo_); -} - -void ExecFileDialog::accept() { - QObject* _sender = sender(); - if(_sender == ui->exec) - result_ = FM_FILE_LAUNCHER_EXEC; - else if(_sender == ui->execTerm) - result_ = FM_FILE_LAUNCHER_EXEC_IN_TERMINAL; - else if(_sender == ui->open) - result_ = FM_FILE_LAUNCHER_EXEC_OPEN; - QDialog::accept(); -} - -} // namespace Fm diff --git a/libfm-qt/execfiledialog_p.h b/libfm-qt/execfiledialog_p.h deleted file mode 100644 index 6c62da5..0000000 --- a/libfm-qt/execfiledialog_p.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * Copyright (C) 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FM_EXECFILEDIALOG_H -#define FM_EXECFILEDIALOG_H - -#include -#include - -namespace Ui { - class ExecFileDialog; -} - -namespace Fm { - -class ExecFileDialog : public QDialog { - Q_OBJECT -public: - ~ExecFileDialog(); - ExecFileDialog(FmFileInfo* fileInfo, QWidget* parent = 0, Qt::WindowFlags f = 0); - - FmFileLauncherExecAction result() { - return result_; - } - -protected: - virtual void accept(); - -private: - Ui::ExecFileDialog* ui; - FmFileInfo* fileInfo_; - FmFileLauncherExecAction result_; -}; - -} - -#endif // FM_EXECFILEDIALOG_H diff --git a/libfm-qt/file-operation-dialog.ui b/libfm-qt/file-operation-dialog.ui deleted file mode 100644 index f81018e..0000000 --- a/libfm-qt/file-operation-dialog.ui +++ /dev/null @@ -1,171 +0,0 @@ - - - FileOperationDialog - - - - 0 - 0 - 450 - 246 - - - - - - - - - - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Destination: - - - - - - - - 0 - 0 - - - - - - - true - - - - - - - Processing: - - - - - - - - 0 - 0 - - - - Preparing... - - - - - - - Progress - - - - - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - Time remaining: - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel - - - - - - - - - buttonBox - accepted() - FileOperationDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - FileOperationDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/libfm-qt/file-props.ui b/libfm-qt/file-props.ui deleted file mode 100644 index c0b3918..0000000 --- a/libfm-qt/file-props.ui +++ /dev/null @@ -1,736 +0,0 @@ - - - FilePropsDialog - - - - 0 - 0 - 424 - 456 - - - - File Properties - - - - - - - - - 10 - - - 10 - - - 10 - - - 10 - - - - - 0 - - - - General - - - - 12 - - - 6 - - - - - - 0 - 0 - - - - - - - - - - - - - 32 - 32 - - - - - - - - - - - Location: - - - - - - - - 0 - 0 - - - - - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - File type: - - - - - - - - 0 - 0 - - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Mime type: - - - - - - - - 0 - 0 - - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - File size: - - - - - - - - 0 - 0 - - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - On-disk size: - - - - - - - - 0 - 0 - - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Last modified: - - - - - - - - 0 - 0 - - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Link target: - - - - - - - - 0 - 0 - - - - - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Open With: - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 0 - 0 - - - - - - - - Last accessed: - - - - - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - Permissions - - - - 6 - - - - - - 0 - 0 - - - - Ownership - - - - 12 - - - 6 - - - - - - - - - - - - 0 - 0 - - - - Group: - - - - - - - - 0 - 0 - - - - Owner: - - - - - - - - - - - 0 - 0 - - - - Access Control - - - - - - - 0 - 0 - - - - 0 - - - - - - - Owner: - - - - - - - - 0 - 0 - - - - - - - - Group: - - - - - - - - 0 - 0 - - - - - - - - Other: - - - - - - - - 0 - 0 - - - - - - - - Make the file executable - - - true - - - - - - - - - - - 0 - - - 6 - - - - - - 0 - 0 - - - - Owner: - - - - - - - - 0 - 0 - - - - Read - - - - - - - - 0 - 0 - - - - Write - - - - - - - - 0 - 0 - - - - Execute - - - - - - - - 0 - 0 - - - - Group: - - - - - - - - 0 - 0 - - - - Read - - - - - - - - 0 - 0 - - - - Write - - - - - - - - 0 - 0 - - - - Execute - - - - - - - - 0 - 0 - - - - Other: - - - - - - - - 0 - 0 - - - - Read - - - - - - - - 0 - 0 - - - - Write - - - - - - - - 0 - 0 - - - - Execute - - - - - - - - - Sticky - - - - - - - SetUID - - - - - - - SetGID - - - - - - - Qt::Vertical - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - Advanced Mode - - - true - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - Fm::AppChooserComboBox - QComboBox -
appchoosercombobox.h
-
-
- - - - buttonBox - accepted() - FilePropsDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - FilePropsDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/libfm-qt/filelauncher.cpp b/libfm-qt/filelauncher.cpp deleted file mode 100644 index b44e694..0000000 --- a/libfm-qt/filelauncher.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "filelauncher.h" -#include "applaunchcontext.h" -#include -#include -#include "execfiledialog_p.h" -#include "appchooserdialog.h" -#include "utilities.h" - -using namespace Fm; - -FmFileLauncher FileLauncher::funcs = { - FileLauncher::_getApp, - /* gboolean (*before_open)(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data); */ - (FmLaunchFolderFunc)FileLauncher::_openFolder, - FileLauncher::_execFile, - FileLauncher::_error, - FileLauncher::_ask -}; - -FileLauncher::FileLauncher(): - quickExec_(false) { -} - -FileLauncher::~FileLauncher() { -} - -//static -bool FileLauncher::launchFiles(QWidget* parent, GList* file_infos) { - FmAppLaunchContext* context = fm_app_launch_context_new_for_widget(parent); - bool ret = fm_launch_files(G_APP_LAUNCH_CONTEXT(context), file_infos, &funcs, this); - g_object_unref(context); - return ret; -} - -bool FileLauncher::launchPaths(QWidget* parent, GList* paths) { - FmAppLaunchContext* context = fm_app_launch_context_new_for_widget(parent); - bool ret = fm_launch_paths(G_APP_LAUNCH_CONTEXT(context), paths, &funcs, this); - g_object_unref(context); - return ret; -} - -GAppInfo* FileLauncher::getApp(GList* file_infos, FmMimeType* mime_type, GError** err) { - AppChooserDialog dlg(NULL); - if(mime_type) - dlg.setMimeType(mime_type); - else - dlg.setCanSetDefault(false); - // FIXME: show error properly? - if(execModelessDialog(&dlg) == QDialog::Accepted) { - return dlg.selectedApp(); - } - return NULL; -} - -bool FileLauncher::openFolder(GAppLaunchContext* ctx, GList* folder_infos, GError** err) { - for(GList* l = folder_infos; l; l = l->next) { - FmFileInfo* fi = FM_FILE_INFO(l->data); - qDebug() << " folder:" << QString::fromUtf8(fm_file_info_get_disp_name(fi)); - } - return false; -} - -FmFileLauncherExecAction FileLauncher::execFile(FmFileInfo* file) { - if (quickExec_) { - /* SF bug#838: open terminal for each script may be just a waste. - User should open a terminal and start the script there - in case if user wants to see the script output anyway. - if (fm_file_info_is_text(file)) - return FM_FILE_LAUNCHER_EXEC_IN_TERMINAL; */ - return FM_FILE_LAUNCHER_EXEC; - } - - FmFileLauncherExecAction res = FM_FILE_LAUNCHER_EXEC_CANCEL; - ExecFileDialog dlg(file); - if(execModelessDialog(&dlg) == QDialog::Accepted) { - res = dlg.result(); - } - return res; -} - -int FileLauncher::ask(const char* msg, char* const* btn_labels, int default_btn) { - /* FIXME: set default button properly */ - // return fm_askv(data->parent, NULL, msg, btn_labels); - return -1; -} - -bool FileLauncher::error(GAppLaunchContext* ctx, GError* err, FmPath* path) { - /* ask for mount if trying to launch unmounted path */ - if(err->domain == G_IO_ERROR) { - if(path && err->code == G_IO_ERROR_NOT_MOUNTED) { - //if(fm_mount_path(data->parent, path, TRUE)) - // return FALSE; /* ask to retry */ - } - else if(err->code == G_IO_ERROR_FAILED_HANDLED) - return true; /* don't show error message */ - } - QMessageBox dlg(QMessageBox::Critical, QObject::tr("Error"), QString::fromUtf8(err->message), QMessageBox::Ok); - execModelessDialog(&dlg); - return true; -} - diff --git a/libfm-qt/filelauncher.h b/libfm-qt/filelauncher.h deleted file mode 100644 index 9c3712e..0000000 --- a/libfm-qt/filelauncher.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_FILELAUNCHER_H -#define FM_FILELAUNCHER_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class LIBFM_QT_API FileLauncher { -public: - FileLauncher(); - virtual ~FileLauncher(); - - bool launchFiles(QWidget* parent, FmFileInfoList* file_infos) { - GList* fileList = fm_file_info_list_peek_head_link(file_infos); - return launchFiles(parent, fileList); - } - bool launchPaths(QWidget* parent, FmPathList* paths) { - GList* pathList = fm_path_list_peek_head_link(paths); - return launchPaths(parent, pathList); - } - - bool launchFiles(QWidget* parent, GList* file_infos); - bool launchPaths(QWidget* parent, GList* paths); - - bool quickExec() const { - return quickExec_; - } - - void setQuickExec(bool value) { - quickExec_ = value; - } - -protected: - - virtual GAppInfo* getApp(GList* file_infos, FmMimeType* mime_type, GError** err); - virtual bool openFolder(GAppLaunchContext* ctx, GList* folder_infos, GError** err); - virtual FmFileLauncherExecAction execFile(FmFileInfo* file); - virtual bool error(GAppLaunchContext* ctx, GError* err, FmPath* path); - virtual int ask(const char* msg, char* const* btn_labels, int default_btn); - -private: - static GAppInfo* _getApp(GList* file_infos, FmMimeType* mime_type, gpointer user_data, GError** err) { - return reinterpret_cast(user_data)->getApp(file_infos, mime_type, err); - } - static gboolean _openFolder(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data, GError** err) { - return reinterpret_cast(user_data)->openFolder(ctx, folder_infos, err); - } - static FmFileLauncherExecAction _execFile(FmFileInfo* file, gpointer user_data) { - return reinterpret_cast(user_data)->execFile(file); - } - static gboolean _error(GAppLaunchContext* ctx, GError* err, FmPath* file, gpointer user_data) { - return reinterpret_cast(user_data)->error(ctx, err, file); - } - static int _ask(const char* msg, char* const* btn_labels, int default_btn, gpointer user_data) { - return reinterpret_cast(user_data)->ask(msg, btn_labels, default_btn); - } - -private: - static FmFileLauncher funcs; - bool quickExec_; // Don't ask options on launch executable file -}; - -} - -#endif // FM_FILELAUNCHER_H diff --git a/libfm-qt/filemenu.cpp b/libfm-qt/filemenu.cpp deleted file mode 100644 index 15dcb38..0000000 --- a/libfm-qt/filemenu.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "filemenu.h" -#include "createnewmenu.h" -#include "icontheme.h" -#include "filepropsdialog.h" -#include "utilities.h" -#include "fileoperation.h" -#include "filelauncher.h" -#include "appchooserdialog.h" -#ifdef CUSTOM_ACTIONS -#include -#endif -#include -#include -#include "filemenu_p.h" - -namespace Fm { - -FileMenu::FileMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd, QWidget* parent): - QMenu(parent), - fileLauncher_(NULL) { - createMenu(files, info, cwd); -} - -FileMenu::FileMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd, const QString& title, QWidget* parent): - QMenu(title, parent), - fileLauncher_(NULL), - unTrashAction_(NULL) { - createMenu(files, info, cwd); -} - -FileMenu::~FileMenu() { - if(files_) - fm_file_info_list_unref(files_); - if(info_) - fm_file_info_unref(info_); - if(cwd_) - fm_path_unref(cwd_); -} - -void FileMenu::createMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd) { - useTrash_ = true; - confirmDelete_ = true; - confirmTrash_ = false; // Confirm before moving files into "trash can" - - openAction_ = NULL; - openWithMenuAction_ = NULL; - openWithAction_ = NULL; - separator1_ = NULL; - cutAction_ = NULL; - copyAction_ = NULL; - pasteAction_ = NULL; - deleteAction_ = NULL; - unTrashAction_ = NULL; - renameAction_ = NULL; - separator2_ = NULL; - propertiesAction_ = NULL; - - files_ = fm_file_info_list_ref(files); - info_ = info ? fm_file_info_ref(info) : NULL; - cwd_ = cwd ? fm_path_ref(cwd) : NULL; - - FmFileInfo* first = fm_file_info_list_peek_head(files); - FmMimeType* mime_type = fm_file_info_get_mime_type(first); - FmPath* path = fm_file_info_get_path(first); - // check if the files are of the same type - sameType_ = fm_file_info_list_is_same_type(files); - // check if the files are on the same filesystem - sameFilesystem_ = fm_file_info_list_is_same_fs(files); - // check if the files are all virtual - allVirtual_ = sameFilesystem_ && fm_path_is_virtual(path); - // check if the files are all in the trash can - allTrash_ = sameFilesystem_ && fm_path_is_trash(path); - - openAction_ = new QAction(QIcon::fromTheme("document-open"), tr("Open"), this); - connect(openAction_ , &QAction::triggered, this, &FileMenu::onOpenTriggered); - addAction(openAction_); - - openWithMenuAction_ = new QAction(tr("Open With..."), this); - addAction(openWithMenuAction_); - // create the "Open with..." sub menu - QMenu* menu = new QMenu(); - openWithMenuAction_->setMenu(menu); - - if(sameType_) { /* add specific menu items for this mime type */ - if(mime_type && !allVirtual_) { /* the file has a valid mime-type and its not virtual */ - GList* apps = g_app_info_get_all_for_type(fm_mime_type_get_type(mime_type)); - GList* l; - for(l=apps;l;l=l->next) { - GAppInfo* app = G_APP_INFO(l->data); - - // check if the command really exists - gchar * program_path = g_find_program_in_path(g_app_info_get_executable(app)); - if (!program_path) - continue; - g_free(program_path); - - // create a QAction for the application. - AppInfoAction* action = new AppInfoAction(app); - connect(action, &QAction::triggered, this, &FileMenu::onApplicationTriggered); - menu->addAction(action); - } - g_list_free(apps); /* don't unref GAppInfos now */ - } - } - menu->addSeparator(); - openWithAction_ = new QAction(tr("Other Applications"), this); - connect(openWithAction_ , &QAction::triggered, this, &FileMenu::onOpenWithTriggered); - menu->addAction(openWithAction_); - - separator1_ = addSeparator(); - - QAction* createAction = new QAction(tr("Create &New"), this); - FmPath* dirPath = fm_file_info_list_get_length(files) == 1 && fm_file_info_is_dir(first) - ? path : cwd_; - createAction->setMenu(new CreateNewMenu(NULL, dirPath, this)); - addAction(createAction); - addSeparator(); - - if(allTrash_) { // all selected files are in trash:/// - bool can_restore = true; - /* only immediate children of trash:/// can be restored. */ - for(GList* l = fm_file_info_list_peek_head_link(files_); l; l=l->next) { - FmPath *trash_path = fm_file_info_get_path(FM_FILE_INFO(l->data)); - if(!fm_path_get_parent(trash_path) || - !fm_path_is_trash_root(fm_path_get_parent(trash_path))) { - can_restore = false; - break; - } - } - if(can_restore) { - unTrashAction_ = new QAction(tr("&Restore"), this); - connect(unTrashAction_, &QAction::triggered, this, &FileMenu::onUnTrashTriggered); - addAction(unTrashAction_); - } - } - else { // ordinary files - cutAction_ = new QAction(QIcon::fromTheme("edit-cut"), tr("Cut"), this); - connect(cutAction_, &QAction::triggered, this, &FileMenu::onCutTriggered); - addAction(cutAction_); - - copyAction_ = new QAction(QIcon::fromTheme("edit-copy"), tr("Copy"), this); - connect(copyAction_, &QAction::triggered, this, &FileMenu::onCopyTriggered); - addAction(copyAction_); - - pasteAction_ = new QAction(QIcon::fromTheme("edit-paste"), tr("Paste"), this); - connect(pasteAction_, &QAction::triggered, this, &FileMenu::onPasteTriggered); - addAction(pasteAction_); - - deleteAction_ = new QAction(QIcon::fromTheme("user-trash"), tr("&Move to Trash"), this); - connect(deleteAction_, &QAction::triggered, this, &FileMenu::onDeleteTriggered); - addAction(deleteAction_); - - renameAction_ = new QAction(tr("Rename"), this); - connect(renameAction_, &QAction::triggered, this, &FileMenu::onRenameTriggered); - addAction(renameAction_); - } - -#ifdef CUSTOM_ACTIONS - // DES-EMA custom actions integration - GList* files_list = fm_file_info_list_peek_head_link(files); - GList* items = fm_get_actions_for_files(files_list); - if(items) { - GList* l; - for(l=items; l; l=l->next) { - FmFileActionItem* item = FM_FILE_ACTION_ITEM(l->data); - addCustomActionItem(this, item); - } - } - g_list_foreach(items, (GFunc)fm_file_action_item_unref, NULL); - g_list_free(items); -#endif - // archiver integration - // FIXME: we need to modify upstream libfm to include some Qt-based archiver programs. - if(!allVirtual_) { - if(sameType_) { - FmArchiver* archiver = fm_archiver_get_default(); - if(archiver) { - if(fm_archiver_is_mime_type_supported(archiver, fm_mime_type_get_type(mime_type))) { - if(cwd_ && archiver->extract_to_cmd) { - QAction* action = new QAction(tr("Extract to..."), this); - connect(action, &QAction::triggered, this, &FileMenu::onExtract); - addAction(action); - } - if(archiver->extract_cmd) { - QAction* action = new QAction(tr("Extract Here"), this); - connect(action, &QAction::triggered, this, &FileMenu::onExtractHere); - addAction(action); - } - } - else { - QAction* action = new QAction(tr("Compress"), this); - connect(action, &QAction::triggered, this, &FileMenu::onCompress); - addAction(action); - } - } - } - } - - separator2_ = addSeparator(); - - propertiesAction_ = new QAction(QIcon::fromTheme("document-properties"), tr("Properties"), this); - connect(propertiesAction_, &QAction::triggered, this, &FileMenu::onFilePropertiesTriggered); - addAction(propertiesAction_); -} - -#ifdef CUSTOM_ACTIONS -void FileMenu::addCustomActionItem(QMenu* menu, FmFileActionItem* item) { - if(!item) { // separator - addSeparator(); - return; - } - - // this action is not for context menu - if(fm_file_action_item_is_action(item) && !(fm_file_action_item_get_target(item) & FM_FILE_ACTION_TARGET_CONTEXT)) - return; - - CustomAction* action = new CustomAction(item, menu); - menu->addAction(action); - if(fm_file_action_item_is_menu(item)) { - GList* subitems = fm_file_action_item_get_sub_items(item); - for(GList* l = subitems; l; l = l->next) { - FmFileActionItem* subitem = FM_FILE_ACTION_ITEM(l->data); - QMenu* submenu = new QMenu(menu); - addCustomActionItem(submenu, subitem); - action->setMenu(submenu); - } - } - else if(fm_file_action_item_is_action(item)) { - connect(action, &QAction::triggered, this, &FileMenu::onCustomActionTrigerred); - } -} -#endif - -void FileMenu::onOpenTriggered() { - if(fileLauncher_) { - fileLauncher_->launchFiles(NULL, files_); - } - else { // use the default launcher - Fm::FileLauncher launcher; - launcher.launchFiles(NULL, files_); - } -} - -void FileMenu::onOpenWithTriggered() { - AppChooserDialog dlg(NULL); - if(sameType_) { - dlg.setMimeType(fm_file_info_get_mime_type(info_)); - } - else { // we can only set the selected app as default if all files are of the same type - dlg.setCanSetDefault(false); - } - - if(execModelessDialog(&dlg) == QDialog::Accepted) { - GAppInfo* app = dlg.selectedApp(); - if(app) { - openFilesWithApp(app); - g_object_unref(app); - } - } -} - -void FileMenu::openFilesWithApp(GAppInfo* app) { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - GList* uris = NULL; - for(GList* l = fm_path_list_peek_head_link(paths); l; l = l->next) { - FmPath* path = FM_PATH(l->data); - char* uri = fm_path_to_uri(path); - uris = g_list_prepend(uris, uri); - } - fm_path_list_unref(paths); - fm_app_info_launch_uris(app, uris, NULL, NULL); - g_list_foreach(uris, (GFunc)g_free, NULL); - g_list_free(uris); -} - -void FileMenu::onApplicationTriggered() { - AppInfoAction* action = static_cast(sender()); - openFilesWithApp(action->appInfo()); -} - -#ifdef CUSTOM_ACTIONS -void FileMenu::onCustomActionTrigerred() { - CustomAction* action = static_cast(sender()); - FmFileActionItem* item = action->item(); - - GList* files = fm_file_info_list_peek_head_link(files_); - char* output = NULL; - /* g_debug("item: %s is activated, id:%s", fm_file_action_item_get_name(item), - fm_file_action_item_get_id(item)); */ - fm_file_action_item_launch(item, NULL, files, &output); - if(output) { - QMessageBox::information(this, tr("Output"), QString::fromUtf8(output)); - g_free(output); - } -} -#endif - -void FileMenu::onFilePropertiesTriggered() { - FilePropsDialog::showForFiles(files_); -} - -void FileMenu::onCopyTriggered() { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - Fm::copyFilesToClipboard(paths); - fm_path_list_unref(paths); -} - -void FileMenu::onCutTriggered() { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - Fm::cutFilesToClipboard(paths); - fm_path_list_unref(paths); -} - -void FileMenu::onDeleteTriggered() { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - if(useTrash_) - FileOperation::trashFiles(paths, confirmTrash_); - else - FileOperation::deleteFiles(paths, confirmDelete_); - fm_path_list_unref(paths); -} - -void FileMenu::onUnTrashTriggered() { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - FileOperation::unTrashFiles(paths); -} - -void FileMenu::onPasteTriggered() { - Fm::pasteFilesFromClipboard(cwd_); -} - -void FileMenu::onRenameTriggered() { - for(GList* l = fm_file_info_list_peek_head_link(files_); l; l = l->next) { - FmFileInfo* info = FM_FILE_INFO(l->data); - Fm::renameFile(info, NULL); - } -} - -void FileMenu::setUseTrash(bool trash) { - if(useTrash_ != trash) { - useTrash_ = trash; - if(deleteAction_) { - deleteAction_->setText(useTrash_ ? tr("&Move to Trash") : tr("&Delete")); - deleteAction_->setIcon(useTrash_ ? QIcon::fromTheme("user-trash") : QIcon::fromTheme("edit-delete")); - } - } -} - -void FileMenu::onCompress() { - FmArchiver* archiver = fm_archiver_get_default(); - if(archiver) { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - fm_archiver_create_archive(archiver, NULL, paths); - fm_path_list_unref(paths); - } -} - -void FileMenu::onExtract() { - FmArchiver* archiver = fm_archiver_get_default(); - if(archiver) { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - fm_archiver_extract_archives(archiver, NULL, paths); - fm_path_list_unref(paths); - } -} - -void FileMenu::onExtractHere() { - FmArchiver* archiver = fm_archiver_get_default(); - if(archiver) { - FmPathList* paths = fm_path_list_new_from_file_info_list(files_); - fm_archiver_extract_archives_to(archiver, NULL, paths, cwd_); - fm_path_list_unref(paths); - } -} - -} // namespace Fm diff --git a/libfm-qt/filemenu.h b/libfm-qt/filemenu.h deleted file mode 100644 index 43e11ab..0000000 --- a/libfm-qt/filemenu.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_FILEMENU_H -#define FM_FILEMENU_H - -#include "libfmqtglobals.h" -#include -#include -#include - -class QAction; - -struct _FmFileActionItem; - -namespace Fm { - -class FileLauncher; - -class LIBFM_QT_API FileMenu : public QMenu { -Q_OBJECT - -public: - explicit FileMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd, QWidget* parent = 0); - explicit FileMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd, const QString& title, QWidget* parent = 0); - ~FileMenu(); - - bool useTrash() { - return useTrash_; - } - - void setUseTrash(bool trash); - - bool confirmDelete() { - return confirmDelete_; - } - - void setConfirmDelete(bool confirm) { - confirmDelete_ = confirm; - } - - QAction* openAction() { - return openAction_; - } - - QAction* openWithMenuAction() { - return openWithMenuAction_; - } - - QAction* openWithAction() { - return openWithAction_; - } - - QAction* separator1() { - return separator1_; - } - - QAction* cutAction() { - return cutAction_; - } - - QAction* copyAction() { - return copyAction_; - } - - QAction* pasteAction() { - return pasteAction_; - } - - QAction* deleteAction() { - return deleteAction_; - } - - QAction* unTrashAction() { - return unTrashAction_; - } - - QAction* renameAction() { - return renameAction_; - } - - QAction* separator2() { - return separator2_; - } - - QAction* propertiesAction() { - return propertiesAction_; - } - - FmFileInfoList* files() { - return files_; - } - - FmFileInfo* firstFile() { - return info_; - } - - FmPath* cwd() { - return cwd_; - } - - void setFileLauncher(FileLauncher* launcher) { - fileLauncher_ = launcher; - } - - FileLauncher* fileLauncher() { - return fileLauncher_; - } - - bool sameType() const { - return sameType_; - } - - bool sameFilesystem() const { - return sameFilesystem_; - } - - bool allVirtual() const { - return allVirtual_; - } - - bool allTrash() const { - return allTrash_; - } - - bool confirmTrash() const { - return confirmTrash_; - } - - void setConfirmTrash(bool value) { - confirmTrash_ = value; - } - -protected: - void createMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd); -#ifdef CUSTOM_ACTIONS - void addCustomActionItem(QMenu* menu, struct _FmFileActionItem* item); -#endif - void openFilesWithApp(GAppInfo* app); - -protected Q_SLOTS: - void onOpenTriggered(); - void onOpenWithTriggered(); - void onFilePropertiesTriggered(); - void onApplicationTriggered(); -#ifdef CUSTOM_ACTIONS - void onCustomActionTrigerred(); -#endif - void onCompress(); - void onExtract(); - void onExtractHere(); - - void onCutTriggered(); - void onCopyTriggered(); - void onPasteTriggered(); - void onRenameTriggered(); - void onDeleteTriggered(); - void onUnTrashTriggered(); - -private: - FmFileInfoList* files_; - FmFileInfo* info_; - FmPath* cwd_; - bool useTrash_; - bool confirmDelete_; - bool confirmTrash_; // Confirm before moving files into "trash can" - - bool sameType_; - bool sameFilesystem_; - bool allVirtual_; - bool allTrash_; - - QAction* openAction_; - QAction* openWithMenuAction_; - QAction* openWithAction_; - QAction* separator1_; - QAction* cutAction_; - QAction* copyAction_; - QAction* pasteAction_; - QAction* deleteAction_; - QAction* unTrashAction_; - QAction* renameAction_; - QAction* separator2_; - QAction* propertiesAction_; - - FileLauncher* fileLauncher_; -}; - -} - -#endif // FM_FILEMENU_H diff --git a/libfm-qt/filemenu_p.h b/libfm-qt/filemenu_p.h deleted file mode 100644 index 17e0524..0000000 --- a/libfm-qt/filemenu_p.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef FM_FILEMENU_P_H -#define FM_FILEMENU_P_H - -#include "icontheme.h" -#ifdef CUSTOM_ACTIONS -#include -#endif -#include - -namespace Fm { - -class AppInfoAction : public QAction { - Q_OBJECT -public: - explicit AppInfoAction(GAppInfo* app, QObject* parent = 0): - QAction(QString::fromUtf8(g_app_info_get_name(app)), parent), - appInfo_(G_APP_INFO(g_object_ref(app))) { - setToolTip(QString::fromUtf8(g_app_info_get_description(app))); - GIcon* gicon = g_app_info_get_icon(app); - QIcon icon = IconTheme::icon(gicon); - setIcon(icon); - } - - virtual ~AppInfoAction() { - if(appInfo_) - g_object_unref(appInfo_); - } - - GAppInfo* appInfo() const { - return appInfo_; - } - -private: - GAppInfo* appInfo_; -}; - -#ifdef CUSTOM_ACTIONS -class CustomAction : public QAction { - Q_OBJECT -public: - explicit CustomAction(FmFileActionItem* item, QObject* parent = NULL): - QAction(QString::fromUtf8(fm_file_action_item_get_name(item)), parent), - item_(reinterpret_cast(fm_file_action_item_ref(item))) { - const char* icon_name = fm_file_action_item_get_icon(item); - if(icon_name) - setIcon(QIcon::fromTheme(icon_name)); - } - - virtual ~CustomAction() { - fm_file_action_item_unref(item_); - } - - FmFileActionItem* item() { - return item_; - } - -private: - FmFileActionItem* item_; -}; - -#endif - -} // namespace Fm - -#endif diff --git a/libfm-qt/fileoperation.cpp b/libfm-qt/fileoperation.cpp deleted file mode 100644 index 394be0a..0000000 --- a/libfm-qt/fileoperation.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "fileoperation.h" -#include "fileoperationdialog.h" -#include -#include -#include -#include - -using namespace Fm; - -#define SHOW_DLG_DELAY 1000 - -FileOperation::FileOperation(Type type, FmPathList* srcFiles, QObject* parent): - QObject(parent), - dlg(NULL), - destPath(NULL), - srcPaths(fm_path_list_ref(srcFiles)), - uiTimer(NULL), - elapsedTimer_(NULL), - lastElapsed_(0), - updateRemainingTime_(true), - autoDestroy_(true), - job_(fm_file_ops_job_new((FmFileOpType)type, srcFiles)) { - - g_signal_connect(job_, "ask", G_CALLBACK(onFileOpsJobAsk), this); - g_signal_connect(job_, "ask-rename", G_CALLBACK(onFileOpsJobAskRename), this); - g_signal_connect(job_, "error", G_CALLBACK(onFileOpsJobError), this); - g_signal_connect(job_, "prepared", G_CALLBACK(onFileOpsJobPrepared), this); - g_signal_connect(job_, "cur-file", G_CALLBACK(onFileOpsJobCurFile), this); - g_signal_connect(job_, "percent", G_CALLBACK(onFileOpsJobPercent), this); - g_signal_connect(job_, "finished", G_CALLBACK(onFileOpsJobFinished), this); - g_signal_connect(job_, "cancelled", G_CALLBACK(onFileOpsJobCancelled), this); -} - -void FileOperation::disconnectJob() { - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobAsk), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobAskRename), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobError), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobPrepared), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobCurFile), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobPercent), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobFinished), this); - g_signal_handlers_disconnect_by_func(job_, (gpointer)G_CALLBACK(onFileOpsJobCancelled), this); -} - -FileOperation::~FileOperation() { - if(uiTimer) { - uiTimer->stop(); - delete uiTimer; - uiTimer = NULL; - } - if(elapsedTimer_) { - delete elapsedTimer_; - elapsedTimer_ = NULL; - } - - if(job_) { - disconnectJob(); - g_object_unref(job_); - } - - if(srcPaths) - fm_path_list_unref(srcPaths); - - if(destPath) - fm_path_unref(destPath); -} - -bool FileOperation::run() { - delete uiTimer; - // run the job - uiTimer = new QTimer(); - uiTimer->start(SHOW_DLG_DELAY); - connect(uiTimer, &QTimer::timeout, this, &FileOperation::onUiTimeout); - - return fm_job_run_async(FM_JOB(job_)); -} - -void FileOperation::onUiTimeout() { - if(dlg) { - dlg->setCurFile(curFile); - // estimate remaining time based on past history - // FIXME: avoid directly access data member of FmFileOpsJob - if(Q_LIKELY(job_->percent > 0 && updateRemainingTime_)) { - gint64 remaining = elapsedTime() * ((double(100 - job_->percent) / job_->percent) / 1000); - dlg->setRemainingTime(remaining); - } - // this timeout slot is called every 0.5 second. - // by adding this flag, we can update remaining time every 1 second. - updateRemainingTime_ = !updateRemainingTime_; - } - else{ - showDialog(); - } -} - -void FileOperation::showDialog() { - if(!dlg) { - dlg = new FileOperationDialog(this); - dlg->setSourceFiles(srcPaths); - - if(destPath) - dlg->setDestPath(destPath); - - if(curFile.isEmpty()) { - dlg->setPrepared(); - dlg->setCurFile(curFile); - } - uiTimer->setInterval(500); // change the interval of the timer - // now the timer is used to update current file display - dlg->show(); - } -} - -gint FileOperation::onFileOpsJobAsk(FmFileOpsJob* job, const char* question, char*const* options, FileOperation* pThis) { - pThis->pauseElapsedTimer(); - pThis->showDialog(); - int ret = pThis->dlg->ask(QString::fromUtf8(question), options); - pThis->resumeElapsedTimer(); - return ret; -} - -gint FileOperation::onFileOpsJobAskRename(FmFileOpsJob* job, FmFileInfo* src, FmFileInfo* dest, char** new_name, FileOperation* pThis) { - pThis->pauseElapsedTimer(); - pThis->showDialog(); - QString newName; - int ret = pThis->dlg->askRename(src, dest, newName); - if(!newName.isEmpty()) { - *new_name = g_strdup(newName.toUtf8().constData()); - } - pThis->resumeElapsedTimer(); - return ret; -} - -void FileOperation::onFileOpsJobCancelled(FmFileOpsJob* job, FileOperation* pThis) { - qDebug("file operation is cancelled!"); -} - -void FileOperation::onFileOpsJobCurFile(FmFileOpsJob* job, const char* cur_file, FileOperation* pThis) { - pThis->curFile = QString::fromUtf8(cur_file); - - // We update the current file name in a timeout slot because drawing a string - // in the UI is expansive. Updating the label text too often cause - // significant impact on performance. - // if(pThis->dlg) - // pThis->dlg->setCurFile(pThis->curFile); -} - -FmJobErrorAction FileOperation::onFileOpsJobError(FmFileOpsJob* job, GError* err, FmJobErrorSeverity severity, FileOperation* pThis) { - pThis->pauseElapsedTimer(); - pThis->showDialog(); - FmJobErrorAction act = pThis->dlg->error(err, severity); - pThis->resumeElapsedTimer(); - return act; -} - -void FileOperation::onFileOpsJobFinished(FmFileOpsJob* job, FileOperation* pThis) { - pThis->handleFinish(); -} - -void FileOperation::onFileOpsJobPercent(FmFileOpsJob* job, guint percent, FileOperation* pThis) { - if(pThis->dlg) { - pThis->dlg->setPercent(percent); - } -} - -void FileOperation::onFileOpsJobPrepared(FmFileOpsJob* job, FileOperation* pThis) { - if(!pThis->elapsedTimer_) { - pThis->elapsedTimer_ = new QElapsedTimer(); - pThis->elapsedTimer_->start(); - } - if(pThis->dlg) { - pThis->dlg->setPrepared(); - } -} - -void FileOperation::handleFinish() { - disconnectJob(); - - if(uiTimer) { - uiTimer->stop(); - delete uiTimer; - uiTimer = NULL; - } - - if(dlg) { - dlg->done(QDialog::Accepted); - delete dlg; - dlg = NULL; - } - Q_EMIT finished(); - - /* sepcial handling for trash - * FIXME: need to refactor this to use a more elegant way later. */ - if(job_->type == FM_FILE_OP_TRASH) { /* FIXME: direct access to job struct! */ - FmPathList* unable_to_trash = static_cast(g_object_get_data(G_OBJECT(job_), "trash-unsupported")); - /* some files cannot be trashed because underlying filesystems don't support it. */ - if(unable_to_trash) { /* delete them instead */ - /* FIXME: parent window might be already destroyed! */ - QWidget* parent = NULL; // FIXME: currently, parent window is not set - if(QMessageBox::question(parent, tr("Error"), - tr("Some files cannot be moved to trash can because " - "the underlying file systems don't support this operation.\n" - "Do you want to delete them instead?")) == QMessageBox::Yes) { - deleteFiles(unable_to_trash, false); - } - } - } - g_object_unref(job_); - job_ = NULL; - - if(autoDestroy_) - delete this; -} - -// static -FileOperation* FileOperation::copyFiles(FmPathList* srcFiles, FmPath* dest, QWidget* parent) { - FileOperation* op = new FileOperation(FileOperation::Copy, srcFiles); - op->setDestination(dest); - op->run(); - return op; -} - -// static -FileOperation* FileOperation::moveFiles(FmPathList* srcFiles, FmPath* dest, QWidget* parent) { - FileOperation* op = new FileOperation(FileOperation::Move, srcFiles); - op->setDestination(dest); - op->run(); - return op; -} - -//static -FileOperation* FileOperation::symlinkFiles(FmPathList* srcFiles, FmPath* dest, QWidget* parent) { - FileOperation* op = new FileOperation(FileOperation::Link, srcFiles); - op->setDestination(dest); - op->run(); - return op; -} - -//static -FileOperation* FileOperation::deleteFiles(FmPathList* srcFiles, bool prompt, QWidget* parent) { - if(prompt) { - int result = QMessageBox::warning(parent, tr("Confirm"), - tr("Do you want to delete the selected files?"), - QMessageBox::Yes|QMessageBox::No, - QMessageBox::No); - if(result != QMessageBox::Yes) - return NULL; - } - - FileOperation* op = new FileOperation(FileOperation::Delete, srcFiles); - op->run(); - return op; -} - -//static -FileOperation* FileOperation::trashFiles(FmPathList* srcFiles, bool prompt, QWidget* parent) { - if(prompt) { - int result = QMessageBox::warning(parent, tr("Confirm"), - tr("Do you want to move the selected files to trash can?"), - QMessageBox::Yes|QMessageBox::No, - QMessageBox::No); - if(result != QMessageBox::Yes) - return NULL; - } - - FileOperation* op = new FileOperation(FileOperation::Trash, srcFiles); - op->run(); - return op; -} - -//static -FileOperation* FileOperation::unTrashFiles(FmPathList* srcFiles, QWidget* parent) { - FileOperation* op = new FileOperation(FileOperation::UnTrash, srcFiles); - op->run(); - return op; -} - -// static -FileOperation* FileOperation::changeAttrFiles(FmPathList* srcFiles, QWidget* parent) { - //TODO - FileOperation* op = new FileOperation(FileOperation::ChangeAttr, srcFiles); - op->run(); - return op; -} diff --git a/libfm-qt/fileoperation.h b/libfm-qt/fileoperation.h deleted file mode 100644 index 0acb515..0000000 --- a/libfm-qt/fileoperation.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_FILEOPERATION_H -#define FM_FILEOPERATION_H - -#include "libfmqtglobals.h" -#include -#include -#include - -class QTimer; - -namespace Fm { - -class FileOperationDialog; - -class LIBFM_QT_API FileOperation : public QObject { -Q_OBJECT -public: - enum Type { - Copy = FM_FILE_OP_COPY, - Move = FM_FILE_OP_MOVE, - Link = FM_FILE_OP_LINK, - Delete = FM_FILE_OP_DELETE, - Trash = FM_FILE_OP_TRASH, - UnTrash = FM_FILE_OP_UNTRASH, - ChangeAttr = FM_FILE_OP_CHANGE_ATTR - }; - -public: - explicit FileOperation(Type type, FmPathList* srcFiles, QObject* parent = 0); - virtual ~FileOperation(); - - void setDestination(FmPath* dest) { - destPath = fm_path_ref(dest); - fm_file_ops_job_set_dest(job_, dest); - } - - void setChmod(mode_t newMode, mode_t newModeMask) { - fm_file_ops_job_set_chmod(job_, newMode, newModeMask); - } - - void setChown(gint uid, gint gid) { - fm_file_ops_job_set_chown(job_, uid, gid); - } - - // This only work for change attr jobs. - void setRecursiveChattr(bool recursive) { - fm_file_ops_job_set_recursive(job_, (gboolean)recursive); - } - - bool run(); - - void cancel() { - if(job_) - fm_job_cancel(FM_JOB(job_)); - } - - bool isRunning() const { - return job_ ? fm_job_is_running(FM_JOB(job_)) : false; - } - - bool isCancelled() const { - return job_ ? fm_job_is_cancelled(FM_JOB(job_)) : false; - } - - FmFileOpsJob* job() { - return job_; - } - - bool autoDestroy() { - return autoDestroy_; - } - void setAutoDestroy(bool destroy = true) { - autoDestroy_ = destroy; - } - - Type type() { - return (Type)job_->type; - } - - // convinient static functions - static FileOperation* copyFiles(FmPathList* srcFiles, FmPath* dest, QWidget* parent = 0); - static FileOperation* moveFiles(FmPathList* srcFiles, FmPath* dest, QWidget* parent = 0); - static FileOperation* symlinkFiles(FmPathList* srcFiles, FmPath* dest, QWidget* parent = 0); - static FileOperation* deleteFiles(FmPathList* srcFiles, bool promp = true, QWidget* parent = 0); - static FileOperation* trashFiles(FmPathList* srcFiles, bool promp = true, QWidget* parent = 0); - static FileOperation* unTrashFiles(FmPathList* srcFiles, QWidget* parent = 0); - static FileOperation* changeAttrFiles(FmPathList* srcFiles, QWidget* parent = 0); - -Q_SIGNALS: - void finished(); - -private: - static gint onFileOpsJobAsk(FmFileOpsJob* job, const char* question, char* const* options, FileOperation* pThis); - static gint onFileOpsJobAskRename(FmFileOpsJob* job, FmFileInfo* src, FmFileInfo* dest, char** new_name, FileOperation* pThis); - static FmJobErrorAction onFileOpsJobError(FmFileOpsJob* job, GError* err, FmJobErrorSeverity severity, FileOperation* pThis); - static void onFileOpsJobPrepared(FmFileOpsJob* job, FileOperation* pThis); - static void onFileOpsJobCurFile(FmFileOpsJob* job, const char* cur_file, FileOperation* pThis); - static void onFileOpsJobPercent(FmFileOpsJob* job, guint percent, FileOperation* pThis); - static void onFileOpsJobFinished(FmFileOpsJob* job, FileOperation* pThis); - static void onFileOpsJobCancelled(FmFileOpsJob* job, FileOperation* pThis); - - void handleFinish(); - void disconnectJob(); - void showDialog(); - - void pauseElapsedTimer() { - if(Q_LIKELY(elapsedTimer_ != NULL)) { - lastElapsed_ += elapsedTimer_->elapsed(); - elapsedTimer_->invalidate(); - } - } - - void resumeElapsedTimer() { - if(Q_LIKELY(elapsedTimer_ != NULL)) { - elapsedTimer_->start(); - } - } - - qint64 elapsedTime() { - if(Q_LIKELY(elapsedTimer_ != NULL)) { - return lastElapsed_ + elapsedTimer_->elapsed(); - } - return 0; - } - -private Q_SLOTS: - void onUiTimeout(); - -private: - FmFileOpsJob* job_; - FileOperationDialog* dlg; - FmPath* destPath; - FmPathList* srcPaths; - QTimer* uiTimer; - QElapsedTimer* elapsedTimer_; - qint64 lastElapsed_; - bool updateRemainingTime_; - QString curFile; - bool autoDestroy_; -}; - -} - -#endif // FM_FILEOPERATION_H diff --git a/libfm-qt/fileoperationdialog.cpp b/libfm-qt/fileoperationdialog.cpp deleted file mode 100644 index 6511916..0000000 --- a/libfm-qt/fileoperationdialog.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "fileoperationdialog.h" -#include "fileoperation.h" -#include "renamedialog.h" -#include -#include "ui_file-operation-dialog.h" - -using namespace Fm; - -FileOperationDialog::FileOperationDialog(FileOperation* _operation): - QDialog(NULL), - operation(_operation), - defaultOption(-1) { - - ui = new Ui::FileOperationDialog(); - ui->setupUi(this); - - QString title; - QString message; - switch(_operation->type()) { - case FM_FILE_OP_MOVE: - title = tr("Move files"); - message = tr("Moving the following files to destination folder:"); - break; - case FM_FILE_OP_COPY: - title = tr("Copy Files"); - message = tr("Copying the following files to destination folder:"); - break; - case FM_FILE_OP_TRASH: - title = tr("Trash Files"); - message = tr("Moving the following files to trash can:"); - break; - case FM_FILE_OP_DELETE: - title = tr("Delete Files"); - message = tr("Deleting the following files"); - ui->dest->hide(); - ui->destLabel->hide(); - break; - case FM_FILE_OP_LINK: - title = tr("Create Symlinks"); - message = tr("Creating symlinks for the following files:"); - break; - case FM_FILE_OP_CHANGE_ATTR: - title = tr("Change Attributes"); - message = tr("Changing attributes of the following files:"); - ui->dest->hide(); - ui->destLabel->hide(); - break; - case FM_FILE_OP_UNTRASH: - title = tr("Restore Trashed Files"); - message = tr("Restoring the following files from trash can:"); - ui->dest->hide(); - ui->destLabel->hide(); - break; - } - ui->message->setText(message); - setWindowTitle(title); -} - - -FileOperationDialog::~FileOperationDialog() { - delete ui; -} - -void FileOperationDialog::setDestPath(FmPath* dest) { - char* pathStr = fm_path_display_name(dest, false); - ui->dest->setText(QString::fromUtf8(pathStr)); - g_free(pathStr); -} - -void FileOperationDialog::setSourceFiles(FmPathList* srcFiles) { - GList* l; - for(l = fm_path_list_peek_head_link(srcFiles); l; l = l->next) { - FmPath* path = FM_PATH(l->data); - char* pathStr = fm_path_display_name(path, false); - ui->sourceFiles->addItem(QString::fromUtf8(pathStr)); - g_free(pathStr); - } -} - -int FileOperationDialog::ask(QString question, char*const* options) { - // TODO: implement FileOperationDialog::ask() - return 0; -} - -int FileOperationDialog::askRename(FmFileInfo* src, FmFileInfo* dest, QString& new_name) { - int ret; - if(defaultOption == -1) { // default action is not set, ask the user - RenameDialog dlg(src, dest, this); - dlg.exec(); - switch(dlg.action()) { - case RenameDialog::ActionOverwrite: - ret = FM_FILE_OP_OVERWRITE; - if(dlg.applyToAll()) - defaultOption = ret; - break; - case RenameDialog::ActionRename: - ret = FM_FILE_OP_RENAME; - new_name = dlg.newName(); - break; - case RenameDialog::ActionIgnore: - ret = FM_FILE_OP_SKIP; - if(dlg.applyToAll()) - defaultOption = ret; - break; - default: - ret = FM_FILE_OP_CANCEL; - break; - } - } - else - ret = defaultOption; - return ret; -} - -FmJobErrorAction FileOperationDialog::error(GError* err, FmJobErrorSeverity severity) { - if(severity >= FM_JOB_ERROR_MODERATE) { - QMessageBox::critical(this, tr("Error"), QString::fromUtf8(err->message)); - if(severity == FM_JOB_ERROR_CRITICAL) - return FM_JOB_ABORT; - } - return FM_JOB_CONTINUE; -} - -void FileOperationDialog::setCurFile(QString cur_file) { - ui->curFile->setText(cur_file); -} - -void FileOperationDialog::setPercent(unsigned int percent) { - ui->progressBar->setValue(percent); -} - -void FileOperationDialog::setRemainingTime(unsigned int sec) { - unsigned int min = 0; - unsigned int hr = 0; - if(sec > 60) { - min = sec / 60; - sec %= 60; - if(min > 60) { - hr = min / 60; - min %= 60; - } - } - ui->timeRemaining->setText(QString("%1:%2:%3") - .arg(hr, 2, 10, QChar('0')) - .arg(min, 2, 10, QChar('0')) - .arg(sec, 2, 10, QChar('0'))); -} - -void FileOperationDialog::setPrepared() { -} - -void FileOperationDialog::reject() { - operation->cancel(); - QDialog::reject(); -} - diff --git a/libfm-qt/fileoperationdialog.h b/libfm-qt/fileoperationdialog.h deleted file mode 100644 index b95d6f4..0000000 --- a/libfm-qt/fileoperationdialog.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_FILEOPERATIONDIALOG_H -#define FM_FILEOPERATIONDIALOG_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Ui { - class FileOperationDialog; -}; - -namespace Fm { - -class FileOperation; - -class LIBFM_QT_API FileOperationDialog : public QDialog { -Q_OBJECT -public: - explicit FileOperationDialog(FileOperation* _operation); - virtual ~FileOperationDialog(); - - void setSourceFiles(FmPathList* srcFiles); - void setDestPath(FmPath* dest); - - int ask(QString question, char* const* options); - int askRename(FmFileInfo* src, FmFileInfo* dest, QString& new_name); - FmJobErrorAction error(GError* err, FmJobErrorSeverity severity); - void setPrepared(); - void setCurFile(QString cur_file); - void setPercent(unsigned int percent); - void setRemainingTime(unsigned int sec); - - virtual void reject(); - -private: - Ui::FileOperationDialog* ui; - FileOperation* operation; - int defaultOption; -}; - -} - -#endif // FM_FILEOPERATIONDIALOG_H diff --git a/libfm-qt/filepropsdialog.cpp b/libfm-qt/filepropsdialog.cpp deleted file mode 100644 index 140c630..0000000 --- a/libfm-qt/filepropsdialog.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "filepropsdialog.h" -#include "ui_file-props.h" -#include "icontheme.h" -#include "utilities.h" -#include "fileoperation.h" -#include -#include -#include -#include -#include -#include - -#define DIFFERENT_UIDS ((uid)-1) -#define DIFFERENT_GIDS ((gid)-1) -#define DIFFERENT_PERMS ((mode_t)-1) - -using namespace Fm; - -enum { - ACCESS_NO_CHANGE = 0, - ACCESS_READ_ONLY, - ACCESS_READ_WRITE, - ACCESS_FORBID -}; - -FilePropsDialog::FilePropsDialog(FmFileInfoList* files, QWidget* parent, Qt::WindowFlags f): - QDialog(parent, f), - fileInfos_(fm_file_info_list_ref(files)), - singleType(fm_file_info_list_is_same_type(files)), - singleFile(fm_file_info_list_get_length(files) == 1 ? true:false), - fileInfo(fm_file_info_list_peek_head(files)), - mimeType(NULL) { - - setAttribute(Qt::WA_DeleteOnClose); - - ui = new Ui::FilePropsDialog(); - ui->setupUi(this); - - if(singleType) { - mimeType = fm_mime_type_ref(fm_file_info_get_mime_type(fileInfo)); - } - - FmPathList* paths = fm_path_list_new_from_file_info_list(files); - deepCountJob = fm_deep_count_job_new(paths, FM_DC_JOB_DEFAULT); - fm_path_list_unref(paths); - - initGeneralPage(); - initPermissionsPage(); -} - -FilePropsDialog::~FilePropsDialog() { - delete ui; - - if(fileInfos_) - fm_file_info_list_unref(fileInfos_); - if(deepCountJob) - g_object_unref(deepCountJob); - if(fileSizeTimer) { - fileSizeTimer->stop(); - delete fileSizeTimer; - fileSizeTimer = NULL; - } -} - -void FilePropsDialog::initApplications() { - if(singleType && mimeType && !fm_file_info_is_dir(fileInfo)) { - ui->openWith->setMimeType(mimeType); - } - else { - ui->openWith->hide(); - ui->openWithLabel->hide(); - } -} - -void FilePropsDialog::initPermissionsPage() { - // ownership handling - // get owner/group and mode of the first file in the list - uid = fm_file_info_get_uid(fileInfo); - gid = fm_file_info_get_gid(fileInfo); - mode_t mode = fm_file_info_get_mode(fileInfo); - ownerPerm = (mode & (S_IRUSR|S_IWUSR|S_IXUSR)); - groupPerm = (mode & (S_IRGRP|S_IWGRP|S_IXGRP)); - otherPerm = (mode & (S_IROTH|S_IWOTH|S_IXOTH)); - execPerm = (mode & (S_IXUSR|S_IXGRP|S_IXOTH)); - allNative = fm_file_info_is_native(fileInfo); - hasDir = S_ISDIR(mode); - - // check if all selected files belongs to the same owner/group or have the same mode - // at the same time, check if all files are on native unix filesystems - GList* l; - for(l = fm_file_info_list_peek_head_link(fileInfos_)->next; l; l = l->next) { - FmFileInfo* fi = FM_FILE_INFO(l->data); - if(allNative && !fm_file_info_is_native(fi)) - allNative = false; // not all of the files are native - - mode_t fi_mode = fm_file_info_get_mode(fi); - if(S_ISDIR(fi_mode)) - hasDir = true; // the files list contains dir(s) - - if(uid != DIFFERENT_UIDS && uid != fm_file_info_get_uid(fi)) - uid = DIFFERENT_UIDS; // not all files have the same owner - if(gid != DIFFERENT_GIDS && gid != fm_file_info_get_gid(fi)) - gid = DIFFERENT_GIDS; // not all files have the same owner group - - if(ownerPerm != DIFFERENT_PERMS && ownerPerm != (fi_mode & (S_IRUSR|S_IWUSR|S_IXUSR))) - ownerPerm = DIFFERENT_PERMS; // not all files have the same permission for owner - if(groupPerm != DIFFERENT_PERMS && groupPerm != (fi_mode & (S_IRGRP|S_IWGRP|S_IXGRP))) - groupPerm = DIFFERENT_PERMS; // not all files have the same permission for grop - if(otherPerm != DIFFERENT_PERMS && otherPerm != (fi_mode & (S_IROTH|S_IWOTH|S_IXOTH))) - otherPerm = DIFFERENT_PERMS; // not all files have the same permission for other - if(execPerm != DIFFERENT_PERMS && execPerm != (fi_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) - execPerm = DIFFERENT_PERMS; // not all files have the same executable permission - } - - // init owner/group - initOwner(); - - // if all files are of the same type, and some of them are dirs => all of the items are dirs - // rwx values have different meanings for dirs - // Let's make it clear for the users - // init combo boxes for file permissions here - QStringList comboItems; - comboItems.append("---"); // no change - if(singleType && hasDir) { // all files are dirs - comboItems.append(tr("View folder content")); - comboItems.append(tr("View and modify folder content")); - ui->executable->hide(); - } - else { //not all of the files are dirs - comboItems.append(tr("Read")); - comboItems.append(tr("Read and write")); - } - comboItems.append(tr("Forbidden")); - QStringListModel* comboModel = new QStringListModel(comboItems, this); - ui->ownerPerm->setModel(comboModel); - ui->groupPerm->setModel(comboModel); - ui->otherPerm->setModel(comboModel); - - // owner - ownerPermSel = ACCESS_NO_CHANGE; - if(ownerPerm != DIFFERENT_PERMS) { // permissions for owner are the same among all files - if(ownerPerm & S_IRUSR) { // can read - if(ownerPerm & S_IWUSR) // can write - ownerPermSel = ACCESS_READ_WRITE; - else - ownerPermSel = ACCESS_READ_ONLY; - } - else { - if((ownerPerm & S_IWUSR) == 0) // cannot read or write - ownerPermSel = ACCESS_FORBID; - } - } - ui->ownerPerm->setCurrentIndex(ownerPermSel); - - // owner and group - groupPermSel = ACCESS_NO_CHANGE; - if(groupPerm != DIFFERENT_PERMS) { // permissions for owner are the same among all files - if(groupPerm & S_IRGRP) { // can read - if(groupPerm & S_IWGRP) // can write - groupPermSel = ACCESS_READ_WRITE; - else - groupPermSel = ACCESS_READ_ONLY; - } - else { - if((groupPerm & S_IWGRP) == 0) // cannot read or write - groupPermSel = ACCESS_FORBID; - } - } - ui->groupPerm->setCurrentIndex(groupPermSel); - - // other - otherPermSel = ACCESS_NO_CHANGE; - if(otherPerm != DIFFERENT_PERMS) { // permissions for owner are the same among all files - if(otherPerm & S_IROTH) { // can read - if(otherPerm & S_IWOTH) // can write - otherPermSel = ACCESS_READ_WRITE; - else - otherPermSel = ACCESS_READ_ONLY; - } - else { - if((otherPerm & S_IWOTH) == 0) // cannot read or write - otherPermSel = ACCESS_FORBID; - } - - } - ui->otherPerm->setCurrentIndex(otherPermSel); - - // set the checkbox to partially checked state - // when owner, group, and other have different executable flags set. - // some of them have exec, and others do not have. - execCheckState = Qt::PartiallyChecked; - if(execPerm != DIFFERENT_PERMS) { // if all files have the same executable permission - // check if the files are all executable - if((mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == (S_IXUSR|S_IXGRP|S_IXOTH)) { - // owner, group, and other all have exec permission. - ui->executable->setTristate(false); - execCheckState = Qt::Checked; - } - else if((mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0) { - // owner, group, and other all have no exec permission - ui->executable->setTristate(false); - execCheckState = Qt::Unchecked; - } - } - ui->executable->setCheckState(execCheckState); -} - -void FilePropsDialog::initGeneralPage() { - // update UI - if(singleType) { // all files are of the same mime-type - FmIcon* icon = NULL; - // FIXME: handle custom icons for some files - // FIXME: display special property pages for special files or - // some specified mime-types. - if(singleFile) { // only one file is selected. - icon = fm_file_info_get_icon(fileInfo); - } - if(mimeType) { - if(!icon) // get an icon from mime type if needed - icon = fm_mime_type_get_icon(mimeType); - ui->fileType->setText(QString::fromUtf8(fm_mime_type_get_desc(mimeType))); - ui->mimeType->setText(QString::fromUtf8(fm_mime_type_get_type(mimeType))); - } - if(icon) { - ui->iconButton->setIcon(IconTheme::icon(icon)); - } - - if(singleFile && fm_file_info_is_symlink(fileInfo)) { - ui->target->setText(QString::fromUtf8(fm_file_info_get_target(fileInfo))); - } - else { - ui->target->hide(); - ui->targetLabel->hide(); - } - } // end if(singleType) - else { // not singleType, multiple files are selected at the same time - ui->fileType->setText(tr("Files of different types")); - ui->target->hide(); - ui->targetLabel->hide(); - } - - // FIXME: check if all files has the same parent dir, mtime, or atime - if(singleFile) { // only one file is selected - FmPath* parent_path = fm_path_get_parent(fm_file_info_get_path(fileInfo)); - char* parent_str = parent_path ? fm_path_display_name(parent_path, true) : NULL; - - ui->fileName->setText(QString::fromUtf8(fm_file_info_get_disp_name(fileInfo))); - if(parent_str) { - ui->location->setText(QString::fromUtf8(parent_str)); - g_free(parent_str); - } - else - ui->location->clear(); - - ui->lastModified->setText(QString::fromUtf8(fm_file_info_get_disp_mtime(fileInfo))); - - // FIXME: need to encapsulate this in an libfm API. - time_t atime; - struct tm tm; - atime = fm_file_info_get_atime(fileInfo); - localtime_r(&atime, &tm); - char buf[128]; - strftime(buf, sizeof(buf), "%x %R", &tm); - ui->lastAccessed->setText(QString::fromUtf8(buf)); - } - else { - ui->fileName->setText(tr("Multiple Files")); - ui->fileName->setEnabled(false); - } - - initApplications(); // init applications combo box - - // calculate total file sizes - fileSizeTimer = new QTimer(this); - connect(fileSizeTimer, &QTimer::timeout, this, &FilePropsDialog::onFileSizeTimerTimeout); - fileSizeTimer->start(600); - g_signal_connect(deepCountJob, "finished", G_CALLBACK(onDeepCountJobFinished), this); - fm_job_run_async(FM_JOB(deepCountJob)); -} - -/*static */ void FilePropsDialog::onDeepCountJobFinished(FmDeepCountJob* job, FilePropsDialog* pThis) { - - pThis->onFileSizeTimerTimeout(); // update file size display - - // free the job - g_object_unref(pThis->deepCountJob); - pThis->deepCountJob = NULL; - - // stop the timer - if(pThis->fileSizeTimer) { - pThis->fileSizeTimer->stop(); - delete pThis->fileSizeTimer; - pThis->fileSizeTimer = NULL; - } -} - -void FilePropsDialog::onFileSizeTimerTimeout() { - if(deepCountJob && !fm_job_is_cancelled(FM_JOB(deepCountJob))) { - char size_str[128]; - fm_file_size_to_str(size_str, sizeof(size_str), deepCountJob->total_size, - fm_config->si_unit); - // FIXME: - // OMG! It's really unbelievable that Qt developers only implement - // QObject::tr(... int n). GNU gettext developers are smarter and - // they use unsigned long instead of int. - // We cannot use Qt here to handle plural forms. So sad. :-( - QString str = QString::fromUtf8(size_str) % - QString(" (%1 B)").arg(deepCountJob->total_size); - // tr(" (%n) byte(s)", "", deepCountJob->total_size); - ui->fileSize->setText(str); - - fm_file_size_to_str(size_str, sizeof(size_str), deepCountJob->total_ondisk_size, - fm_config->si_unit); - str = QString::fromUtf8(size_str) % - QString(" (%1 B)").arg(deepCountJob->total_ondisk_size); - // tr(" (%n) byte(s)", "", deepCountJob->total_ondisk_size); - ui->onDiskSize->setText(str); - } -} - -void FilePropsDialog::accept() { - - // applications - if(mimeType && ui->openWith->isChanged()) { - GAppInfo* currentApp = ui->openWith->selectedApp(); - g_app_info_set_as_default_for_type(currentApp, fm_mime_type_get_type(mimeType), NULL); - } - - // check if chown or chmod is needed - guint32 newUid = uidFromName(ui->owner->text()); - guint32 newGid = gidFromName(ui->ownerGroup->text()); - bool needChown = (newUid != -1 && newUid != uid) || (newGid != -1 && newGid != gid); - - int newOwnerPermSel = ui->ownerPerm->currentIndex(); - int newGroupPermSel = ui->groupPerm->currentIndex(); - int newOtherPermSel = ui->otherPerm->currentIndex(); - Qt::CheckState newExecCheckState = ui->executable->checkState(); - bool needChmod = ((newOwnerPermSel != ownerPermSel) || - (newGroupPermSel != groupPermSel) || - (newOtherPermSel != otherPermSel) || - (newExecCheckState != execCheckState)); - - if(needChmod || needChown) { - FmPathList* paths = fm_path_list_new_from_file_info_list(fileInfos_); - FileOperation* op = new FileOperation(FileOperation::ChangeAttr, paths); - fm_path_list_unref(paths); - if(needChown) { - // don't do chown if new uid/gid and the original ones are actually the same. - if(newUid == uid) - newUid = -1; - if(newGid == gid) - newGid = -1; - op->setChown(newUid, newGid); - } - if(needChmod) { - mode_t newMode = 0; - mode_t newModeMask = 0; - // FIXME: we need to make sure that folders with "r" permission also have "x" - // at the same time. Otherwise, it's not able to browse the folder later. - if(newOwnerPermSel != ownerPermSel && newOwnerPermSel != ACCESS_NO_CHANGE) { - // owner permission changed - newModeMask |= (S_IRUSR|S_IWUSR); // affect user bits - if(newOwnerPermSel == ACCESS_READ_ONLY) - newMode |= S_IRUSR; - else if(newOwnerPermSel == ACCESS_READ_WRITE) - newMode |= (S_IRUSR|S_IWUSR); - } - if(newGroupPermSel != groupPermSel && newGroupPermSel != ACCESS_NO_CHANGE) { - qDebug("newGroupPermSel: %d", newGroupPermSel); - // group permission changed - newModeMask |= (S_IRGRP|S_IWGRP); // affect group bits - if(newGroupPermSel == ACCESS_READ_ONLY) - newMode |= S_IRGRP; - else if(newGroupPermSel == ACCESS_READ_WRITE) - newMode |= (S_IRGRP|S_IWGRP); - } - if(newOtherPermSel != otherPermSel && newOtherPermSel != ACCESS_NO_CHANGE) { - // other permission changed - newModeMask |= (S_IROTH|S_IWOTH); // affect other bits - if(newOtherPermSel == ACCESS_READ_ONLY) - newMode |= S_IROTH; - else if(newOtherPermSel == ACCESS_READ_WRITE) - newMode |= (S_IROTH|S_IWOTH); - } - if(newExecCheckState != execCheckState && newExecCheckState != Qt::PartiallyChecked) { - // executable state changed - newModeMask |= (S_IXUSR|S_IXGRP|S_IXOTH); - if(newExecCheckState == Qt::Checked) - newMode |= (S_IXUSR|S_IXGRP|S_IXOTH); - } - op->setChmod(newMode, newModeMask); - - if(hasDir) { // if there are some dirs in our selected files - QMessageBox::StandardButton r = QMessageBox::question(this, - tr("Apply changes"), - tr("Do you want to recursively apply these changes to all files and sub-folders?"), - QMessageBox::Yes|QMessageBox::No); - if(r == QMessageBox::Yes) - op->setRecursiveChattr(true); - } - } - op->setAutoDestroy(true); - op->run(); - } - - QDialog::accept(); -} - -void FilePropsDialog::initOwner() { - if(allNative) { - if(uid != DIFFERENT_UIDS) - ui->owner->setText(uidToName(uid)); - if(gid != DIFFERENT_GIDS) - ui->ownerGroup->setText(gidToName(gid)); - - if(geteuid() != 0) { // on local filesystems, only root can do chown. - ui->owner->setEnabled(false); - ui->ownerGroup->setEnabled(false); - } - } -} diff --git a/libfm-qt/filepropsdialog.h b/libfm-qt/filepropsdialog.h deleted file mode 100644 index a273da3..0000000 --- a/libfm-qt/filepropsdialog.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_FILEPROPSDIALOG_H -#define FM_FILEPROPSDIALOG_H - -#include "libfmqtglobals.h" -#include -#include -#include - -namespace Ui { - class FilePropsDialog; -}; - -namespace Fm { - -class LIBFM_QT_API FilePropsDialog : public QDialog { -Q_OBJECT - -public: - explicit FilePropsDialog(FmFileInfoList* files, QWidget* parent = 0, Qt::WindowFlags f = 0); - virtual ~FilePropsDialog(); - - virtual void accept(); - - static FilePropsDialog* showForFile(FmFileInfo* file, QWidget* parent = 0) { - FmFileInfoList* files = fm_file_info_list_new(); - fm_file_info_list_push_tail(files, file); - FilePropsDialog* dlg = showForFiles(files, parent); - fm_file_info_list_unref(files); - return dlg; - } - - static FilePropsDialog* showForFiles(FmFileInfoList* files, QWidget* parent = 0) { - FilePropsDialog* dlg = new FilePropsDialog(files, parent); - dlg->show(); - return dlg; - } - -private: - void initGeneralPage(); - void initApplications(); - void initPermissionsPage(); - void initOwner(); - - static void onDeepCountJobFinished(FmDeepCountJob* job, FilePropsDialog* pThis); - -private Q_SLOTS: - void onFileSizeTimerTimeout(); - -private: - Ui::FilePropsDialog* ui; - FmFileInfoList* fileInfos_; // list of all file infos - FmFileInfo* fileInfo; // file info of the first file in the list - bool singleType; // all files are of the same type? - bool singleFile; // only one file is selected? - bool hasDir; // is there any dir in the files? - bool allNative; // all files are on native UNIX filesystems (not virtual or remote) - - FmMimeType* mimeType; // mime type of the files - - gint32 uid; // owner uid of the files, -1 means all files do not have the same uid - gint32 gid; // owner gid of the files, -1 means all files do not have the same uid - mode_t ownerPerm; // read permission of the files, -1 means not all files have the same value - int ownerPermSel; - mode_t groupPerm; // read permission of the files, -1 means not all files have the same value - int groupPermSel; - mode_t otherPerm; // read permission of the files, -1 means not all files have the same value - int otherPermSel; - mode_t execPerm; // exec permission of the files - Qt::CheckState execCheckState; - - FmDeepCountJob* deepCountJob; // job used to count total size - QTimer* fileSizeTimer; -}; - -} - -#endif // FM_FILEPROPSDIALOG_H diff --git a/libfm-qt/filesearch.ui b/libfm-qt/filesearch.ui deleted file mode 100644 index f5f6051..0000000 --- a/libfm-qt/filesearch.ui +++ /dev/null @@ -1,449 +0,0 @@ - - - SearchDialog - - - - 0 - 0 - 512 - 420 - - - - Search Files - - - - - - - - - - - 0 - - - - Name/Location - - - - - - File Name Patterns: - - - - - - * - - - - - - - Case insensitive - - - - - - - Use regular expression - - - - - - - - - - Places to Search: - - - - - - - - - - - - - &Add - - - - - - - - - - - - &Remove - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Search in sub directories - - - - - - - Search for hidden files - - - - - - - - - - - File Type - - - - - - Only search for files of following types: - - - - - - Text files - - - - - - - Image files - - - - - - - Audio files - - - - - - - Video files - - - - - - - Documents - - - - - - - Folders - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Content - - - - - - File contains: - - - - - - - - - Case insensiti&ve - - - - - - - &Use regular expression - - - - - - - - - - Qt::Vertical - - - - 20 - 186 - - - - - - - - - Properties - - - - - - File Size: - - - - - - Larger than: - - - - - - - - - - - - 2 - - - - Bytes - - - - - KiB - - - - - MiB - - - - - GiB - - - - - - - - - - Smaller than: - - - - - - - - - - - - 2 - - - - Bytes - - - - - KiB - - - - - MiB - - - - - GiB - - - - - - - - - - - - - Last Modified Time: - - - - - - Earlier than: - - - - - - - Later than: - - - - - - - true - - - - - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - SearchDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - SearchDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/libfm-qt/filesearchdialog.cpp b/libfm-qt/filesearchdialog.cpp deleted file mode 100644 index eeaeaa3..0000000 --- a/libfm-qt/filesearchdialog.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2015 Hong Jen Yee (PCMan) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "filesearchdialog.h" -#include -#include "fm-search.h" -#include "ui_filesearch.h" -#include -#include - -namespace Fm { - -FileSearchDialog::FileSearchDialog(QStringList paths, QWidget* parent, Qt::WindowFlags f): - QDialog(parent, f), - ui(new Ui::SearchDialog()) { - ui->setupUi(this); - ui->minSize->setMaximum(std::numeric_limits().max()); - ui->maxSize->setMaximum(std::numeric_limits().max()); - Q_FOREACH(const QString& path, paths) { - ui->listView->addItem(path); - } - - ui->maxTime->setDate(QDate::currentDate()); - ui->minTime->setDate(QDate::currentDate()); - - connect(ui->addPath, &QPushButton::clicked, this, &FileSearchDialog::onAddPath); - connect(ui->removePath, &QPushButton::clicked, this, &FileSearchDialog::onRemovePath); -} - -FileSearchDialog::~FileSearchDialog() { - delete ui; -} - -void FileSearchDialog::accept() { - // build the search:/// uri - int n = ui->listView->count(); - if(n > 0) { - FmSearch* search = fm_search_new(); - int i; - for(i = 0; i < n; ++i) { // add directories - QListWidgetItem* item = ui->listView->item(i); - fm_search_add_dir(search, item->text().toLocal8Bit().constData()); - } - - fm_search_set_recursive(search, ui->recursiveSearch->isChecked()); - fm_search_set_show_hidden(search, ui->searchHidden->isChecked()); - fm_search_set_name_patterns(search, ui->namePatterns->text().toUtf8().constData()); - fm_search_set_name_ci(search, ui->nameCaseInsensitive->isChecked()); - fm_search_set_name_regex(search, ui->nameRegExp->isChecked()); - - fm_search_set_content_pattern(search, ui->contentPattern->text().toUtf8().constData()); - fm_search_set_content_ci(search, ui->contentCaseInsensitive->isChecked()); - fm_search_set_content_regex(search, ui->contentRegExp->isChecked()); - - // search for the files of specific mime-types - if(ui->searchTextFiles->isChecked()) - fm_search_add_mime_type(search, "text/plain"); - if(ui->searchImages->isChecked()) - fm_search_add_mime_type(search, "image/*"); - if(ui->searchAudio->isChecked()) - fm_search_add_mime_type(search, "audio/*"); - if(ui->searchVideo->isChecked()) - fm_search_add_mime_type(search, "video/*"); - if(ui->searchFolders->isChecked()) - fm_search_add_mime_type(search, "inode/directory"); - if(ui->searchDocuments->isChecked()) { - const char* doc_types[] = { - "application/pdf", - /* "text/html;" */ - "application/vnd.oasis.opendocument.*", - "application/vnd.openxmlformats-officedocument.*", - "application/msword;application/vnd.ms-word", - "application/msexcel;application/vnd.ms-excel" - }; - for(i = 0; i < sizeof(doc_types)/sizeof(char*); ++i) - fm_search_add_mime_type(search, doc_types[i]); - } - - // search based on file size - const unsigned int unit_bytes[] = {1, (1024), (1024*1024), (1024*1024*1024)}; - if(ui->largerThan->isChecked()) { - guint64 size = ui->minSize->value() * unit_bytes[ui->minSizeUnit->currentIndex()]; - fm_search_set_min_size(search, size); - } - - if(ui->smallerThan->isChecked()) { - guint64 size = ui->maxSize->value() * unit_bytes[ui->maxSizeUnit->currentIndex()]; - fm_search_set_min_size(search, size); - } - - // search based on file mtime (we only support date in YYYY-MM-DD format) - if(ui->earlierThan->isChecked()) { - fm_search_set_max_mtime(search, ui->maxTime->date().toString(QStringLiteral("yyyy-MM-dd")).toUtf8().constData()); - } - if(ui->laterThan->isChecked()) { - fm_search_set_min_mtime(search, ui->minTime->date().toString(QStringLiteral("yyyy-MM-dd")).toUtf8().constData()); - } - - searchUri_.take(fm_search_dup_path(search)); - - fm_search_free(search); - } - else { - QMessageBox::critical(this, tr("Error"), tr("You should add at least add one directory to search.")); - return; - } - QDialog::accept(); -} - -void FileSearchDialog::onAddPath() { - QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder")); - if(dir.isEmpty()) - return; - // avoid adding duplicated items - if(ui->listView->findItems(dir, Qt::MatchFixedString|Qt::MatchCaseSensitive).isEmpty()) { - ui->listView->addItem(dir); - } -} - -void FileSearchDialog::onRemovePath() { - // remove selected items - Q_FOREACH(QListWidgetItem* item, ui->listView->selectedItems()) { - delete item; - } -} - -} diff --git a/libfm-qt/filesearchdialog.h b/libfm-qt/filesearchdialog.h deleted file mode 100644 index dc6dc08..0000000 --- a/libfm-qt/filesearchdialog.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2015 Hong Jen Yee (PCMan) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef FM_FILESEARCHDIALOG_H -#define FM_FILESEARCHDIALOG_H - -#include "libfmqtglobals.h" -#include -#include "path.h" - -namespace Ui { - class SearchDialog; -} - -namespace Fm { - -class LIBFM_QT_API FileSearchDialog : public QDialog -{ -public: - FileSearchDialog(QStringList paths = QStringList(), QWidget * parent = 0, Qt::WindowFlags f = 0); - ~FileSearchDialog(); - - Path searchUri() const { - return searchUri_; - } - - virtual void accept(); - -private Q_SLOTS: - void onAddPath(); - void onRemovePath(); - -private: - Ui::SearchDialog* ui; - Path searchUri_; -}; - -} - -#endif // FM_FILESEARCHDIALOG_H diff --git a/libfm-qt/fm-search.c b/libfm-qt/fm-search.c deleted file mode 100644 index b8e26ca..0000000 --- a/libfm-qt/fm-search.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - * fm-search-uri.c - * - * Copyright 2015 Hong Jen Yee (PCMan) - * Copyright 2012-2014 Andriy Grytsenko (LStranger) - * - * 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. - */ - -#include "fm-search.h" -#include - -struct _FmSearch -{ - gboolean recursive; - gboolean show_hidden; - char* name_patterns; - gboolean name_ci; - gboolean name_regex; - char* content_pattern; - gboolean content_ci; - gboolean content_regex; - GList* mime_types; - GList* search_path_list; - guint64 max_size; - guint64 min_size; - char* max_mtime; - char* min_mtime; -}; - -FmSearch* fm_search_new (void) -{ - FmSearch* search = (FmSearch*)g_slice_new0(FmSearch); - return search; -} - -void fm_search_free(FmSearch* search) -{ - g_list_free_full(search->mime_types, (GDestroyNotify)g_free); - g_list_free_full(search->search_path_list, (GDestroyNotify)g_free); - g_free(search->name_patterns); - g_free(search->content_pattern); - g_free(search->max_mtime); - g_free(search->min_mtime); - g_slice_free(FmSearch, search); -} - -gboolean fm_search_get_recursive(FmSearch* search) -{ - return search->recursive; -} - -void fm_search_set_recursive(FmSearch* search, gboolean recursive) -{ - search->recursive = recursive; -} - -gboolean fm_search_get_show_hidden(FmSearch* search) -{ - return search->show_hidden; -} - -void fm_search_set_show_hidden(FmSearch* search, gboolean show_hidden) -{ - search->show_hidden = show_hidden; -} - -const char* fm_search_get_name_patterns(FmSearch* search) -{ - return search->name_patterns; -} - -void fm_search_set_name_patterns(FmSearch* search, const char* name_patterns) -{ - g_free(search->name_patterns); - search->name_patterns = g_strdup(name_patterns); -} - -gboolean fm_search_get_name_ci(FmSearch* search) -{ - return search->name_ci; -} - -void fm_search_set_name_ci(FmSearch* search, gboolean name_ci) -{ - search->name_ci = name_ci; -} - -gboolean fm_search_get_name_regex(FmSearch* search) -{ - return search->name_regex; -} - -void fm_search_set_name_regex(FmSearch* search, gboolean name_regex) -{ - search->name_regex = name_regex; -} - -const char* fm_search_get_content_pattern(FmSearch* search) -{ - return search->content_pattern; -} - -void fm_search_set_content_pattern(FmSearch* search, const char* content_pattern) -{ - g_free(search->content_pattern); - search->content_pattern = g_strdup(content_pattern); -} - -gboolean fm_search_get_content_ci(FmSearch* search) -{ - return search->content_ci; -} - -void fm_search_set_content_ci(FmSearch* search, gboolean content_ci) -{ - search->content_ci = content_ci; -} - -gboolean fm_search_get_content_regex(FmSearch* search) -{ - return search->content_regex; -} - -void fm_search_set_content_regex(FmSearch* search, gboolean content_regex) -{ - search->content_regex = content_regex; -} - -void fm_search_add_dir(FmSearch* search, const char* dir) -{ - GList* l = g_list_find_custom(search->search_path_list, dir, (GCompareFunc)strcmp); - if(!l) - search->search_path_list = g_list_prepend(search->search_path_list, g_strdup(dir)); -} - -void fm_search_remove_dir(FmSearch* search, const char* dir) -{ - GList* l = g_list_find_custom(search->search_path_list, dir, (GCompareFunc)strcmp); - if(G_LIKELY(l)) - { - g_free(l->data); - search->search_path_list = g_list_delete_link(search->search_path_list, l); - } -} - -GList* fm_search_get_dirs(FmSearch* search) -{ - return search->search_path_list; -} - -void fm_search_add_mime_type(FmSearch* search, const char* mime_type) -{ - GList* l = g_list_find_custom(search->mime_types, mime_type, (GCompareFunc)strcmp); - if(!l) - search->mime_types = g_list_prepend(search->mime_types, g_strdup(mime_type)); -} - -void fm_search_remove_mime_type(FmSearch* search, const char* mime_type) -{ - GList* l = g_list_find_custom(search->mime_types, mime_type, (GCompareFunc)strcmp); - if(G_LIKELY(l)) - { - g_free(l->data); - search->mime_types = g_list_delete_link(search->mime_types, l); - } -} - -GList* fm_search_get_mime_types(FmSearch* search) -{ - return search->mime_types; -} - -guint64 fm_search_get_max_size(FmSearch* search) -{ - return search->max_size; -} - -void fm_search_set_max_size(FmSearch* search, guint64 size) -{ - search->max_size = size; -} - -guint64 fm_search_get_min_size(FmSearch* search) -{ - return search->min_size; -} - -void fm_search_set_min_size(FmSearch* search, guint64 size) -{ - search->min_size = size; -} - -/* format of mtime: YYYY-MM-DD */ -const char* fm_search_get_max_mtime(FmSearch* search) -{ - return search->max_mtime; -} - -void fm_search_set_max_mtime(FmSearch* search, const char* mtime) -{ - g_free(search->max_mtime); - search->max_mtime = g_strdup(mtime); -} - -/* format of mtime: YYYY-MM-DD */ -const char* fm_search_get_min_mtime(FmSearch* search) -{ - return search->min_mtime; -} - -void fm_search_set_min_mtime(FmSearch* search, const char* mtime) -{ - g_free(search->min_mtime); - search->min_mtime = g_strdup(mtime); -} - -/* really build the path */ -FmPath* fm_search_dup_path(FmSearch* search) -{ - FmPath* search_path = NULL; - GString* search_str = g_string_sized_new(1024); - /* build the search:// URI to perform the search */ - g_string_append(search_str, "search://"); - - if(search->search_path_list) /* we need to have at least one dir path */ - { - char *escaped; - /* add paths */ - GList* l; - for(l = search->search_path_list; ; ) - { - char *path_str = (char*)l->data; - /* escape possible '?' and ',' */ - escaped = g_uri_escape_string(path_str, "!$&'()*+:;=/@", TRUE); - g_string_append(search_str, escaped); - g_free(escaped); - - l = l->next; - if(!l) /* no more items */ - break; - g_string_append_c(search_str, ','); /* separator for paths */ - } - - g_string_append_c(search_str, '?'); - g_string_append_printf(search_str, "recursive=%c", search->recursive ? '1' : '0'); - g_string_append_printf(search_str, "&show_hidden=%c", search->show_hidden ? '1' : '0'); - if(search->name_patterns && *search->name_patterns) - { - /* escape ampersands in pattern */ - escaped = g_uri_escape_string(search->name_patterns, ":/?#[]@!$'()*+,;", TRUE); - if(search->name_regex) - g_string_append_printf(search_str, "&name_regex=%s", escaped); - else - g_string_append_printf(search_str, "&name=%s", escaped); - if(search->name_ci) - g_string_append_printf(search_str, "&name_ci=%c", search->name_ci ? '1' : '0'); - g_free(escaped); - } - - if(search->content_pattern && *search->content_pattern) - { - /* escape ampersands in pattern */ - escaped = g_uri_escape_string(search->content_pattern, ":/?#[]@!$'()*+,;^<>{}", TRUE); - if(search->content_regex) - g_string_append_printf(search_str, "&content_regex=%s", escaped); - else - g_string_append_printf(search_str, "&content=%s", escaped); - g_free(escaped); - if(search->content_ci) - g_string_append_printf(search_str, "&content_ci=%c", search->content_ci ? '1' : '0'); - } - - /* search for the files of specific mime-types */ - if(search->mime_types) - { - GList* l; - g_string_append(search_str, "&mime_types="); - for(l = search->mime_types; l; l=l->next) - { - const char* mime_type = (const char*)l->data; - g_string_append(search_str, mime_type); - if(l->next) - g_string_append_c(search_str, ';'); - } - } - - if(search->min_size) - g_string_append_printf(search_str, "&min_size=%llu", search->min_size); - - if(search->max_size) - g_string_append_printf(search_str, "&max_size=%llu", search->max_size); - - if(search->min_mtime) - g_string_append_printf(search_str, "&min_mtime=%s", search->min_mtime); - - if(search->max_mtime) - g_string_append_printf(search_str, "&max_mtime=%s", search->max_mtime); - - search_path = fm_path_new_for_uri(search_str->str); - g_string_free(search_str, TRUE); - } - return search_path; -} diff --git a/libfm-qt/fm-search.h b/libfm-qt/fm-search.h deleted file mode 100644 index 1ae397e..0000000 --- a/libfm-qt/fm-search.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * fm-search-uri.h - * - * Copyright 2015 Hong Jen Yee (PCMan) - * - * 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. - */ - -/* FmSearch implements a tool used to generate a search:// URI used by libfm to search for files. - * This API might become part of libfm in the future. - */ - -#ifndef _FM_SEARCH_H_ -#define _FM_SEARCH_H_ - -#include - -G_BEGIN_DECLS - -typedef struct _FmSearch FmSearch; - -FmSearch* fm_search_new(void); -void fm_search_free(FmSearch* search); - -FmPath* fm_search_dup_path(FmSearch* search); - -gboolean fm_search_get_recursive(FmSearch* search); -void fm_search_set_recursive(FmSearch* search, gboolean recursive); - -gboolean fm_search_get_show_hidden(FmSearch* search); -void fm_search_set_show_hidden(FmSearch* search, gboolean show_hidden); - -const char* fm_search_get_name_patterns(FmSearch* search); -void fm_search_set_name_patterns(FmSearch* search, const char* name_patterns); - -gboolean fm_search_get_name_ci(FmSearch* search); -void fm_search_set_name_ci(FmSearch* search, gboolean name_ci); - -gboolean fm_search_get_name_regex(FmSearch* search); -void fm_search_set_name_regex(FmSearch* search, gboolean name_regex); - -const char* fm_search_get_content_pattern(FmSearch* search); -void fm_search_set_content_pattern(FmSearch* search, const char* content_pattern); - -gboolean fm_search_get_content_ci(FmSearch* search); -void fm_search_set_content_ci(FmSearch* search, gboolean content_ci); - -gboolean fm_search_get_content_regex(FmSearch* search); -void fm_search_set_content_regex(FmSearch* search, gboolean content_regex); - -void fm_search_add_dir(FmSearch* search, const char* dir); -void fm_search_remove_dir(FmSearch* search, const char* dir); -GList* fm_search_get_dirs(FmSearch* search); - -void fm_search_add_mime_type(FmSearch* search, const char* mime_type); -void fm_search_remove_mime_type(FmSearch* search, const char* mime_type); -GList* fm_search_get_mime_types(FmSearch* search); - -guint64 fm_search_get_max_size(FmSearch* search); -void fm_search_set_max_size(FmSearch* search, guint64 size); - -guint64 fm_search_get_min_size(FmSearch* search); -void fm_search_set_min_size(FmSearch* search, guint64 size); - -/* format of mtime: YYYY-MM-DD */ -const char* fm_search_get_max_mtime(FmSearch* search); -void fm_search_set_max_mtime(FmSearch* search, const char* mtime); - -/* format of mtime: YYYY-MM-DD */ -const char* fm_search_get_min_mtime(FmSearch* search); -void fm_search_set_min_mtime(FmSearch* search, const char* mtime); - -G_END_DECLS - -#endif /* _FM_SEARCH_H_ */ diff --git a/libfm-qt/folderitemdelegate.cpp b/libfm-qt/folderitemdelegate.cpp deleted file mode 100644 index 23ac67d..0000000 --- a/libfm-qt/folderitemdelegate.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "folderitemdelegate.h" -#include "foldermodel.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Fm { - -FolderItemDelegate::FolderItemDelegate(QAbstractItemView* view, QObject* parent): - QStyledItemDelegate(parent ? parent : view), - symlinkIcon_(QIcon::fromTheme("emblem-symbolic-link")), - view_(view) { -} - -FolderItemDelegate::~FolderItemDelegate() { - -} - -QSize FolderItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const { - QVariant value = index.data(Qt::SizeHintRole); - if(value.isValid()) - return qvariant_cast(value); - if(option.decorationPosition == QStyleOptionViewItem::Top || - option.decorationPosition == QStyleOptionViewItem::Bottom) { - - QStyleOptionViewItemV4 opt = option; - initStyleOption(&opt, index); - opt.decorationAlignment = Qt::AlignHCenter|Qt::AlignTop; - opt.displayAlignment = Qt::AlignTop|Qt::AlignHCenter; - - // FIXME: there're some problems in this size hint calculation. - Q_ASSERT(gridSize_ != QSize()); - QRectF textRect(0, 0, gridSize_.width() - 4, gridSize_.height() - opt.decorationSize.height() - 4); - drawText(NULL, opt, textRect); // passing NULL for painter will calculate the bounding rect only. - int width = qMax((int)textRect.width(), opt.decorationSize.width()) + 4; - int height = opt.decorationSize.height() + textRect.height() + 4; - return QSize(width, height); - } - return QStyledItemDelegate::sizeHint(option, index); -} - -QIcon::Mode FolderItemDelegate::iconModeFromState(QStyle::State state) { - QIcon::Mode iconMode; - if(state & QStyle::State_Enabled) { - if(state & QStyle::State_Selected) - iconMode = QIcon::Selected; - else { - iconMode = QIcon::Normal; - } - } - else - iconMode = QIcon::Disabled; - return iconMode; -} - -// special thanks to Razor-qt developer Alec Moskvin(amoskvin) for providing the fix! -void FolderItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { - Q_ASSERT(index.isValid()); - FmFileInfo* file = static_cast(index.data(FolderModel::FileInfoRole).value()); - bool isSymlink = file && fm_file_info_is_symlink(file); - - if(option.decorationPosition == QStyleOptionViewItem::Top || - option.decorationPosition == QStyleOptionViewItem::Bottom) { - painter->save(); - painter->setClipRect(option.rect); - - QStyleOptionViewItemV4 opt = option; - initStyleOption(&opt, index); - opt.decorationAlignment = Qt::AlignHCenter|Qt::AlignTop; - opt.displayAlignment = Qt::AlignTop|Qt::AlignHCenter; - - // draw the icon - QIcon::Mode iconMode = iconModeFromState(opt.state); - QPoint iconPos(opt.rect.x() + (opt.rect.width() - opt.decorationSize.width()) / 2, opt.rect.y()); - QPixmap pixmap = opt.icon.pixmap(opt.decorationSize, iconMode); - painter->drawPixmap(iconPos, pixmap); - - // draw some emblems for the item if needed - // we only support symlink emblem at the moment - if(isSymlink) - painter->drawPixmap(iconPos, symlinkIcon_.pixmap(opt.decorationSize / 2, iconMode)); - - // draw the text - QRectF textRect(opt.rect.x(), opt.rect.y() + opt.decorationSize.height(), opt.rect.width(), opt.rect.height() - opt.decorationSize.height()); - drawText(painter, opt, textRect); - painter->restore(); - } - else { - // let QStyledItemDelegate does its default painting - QStyledItemDelegate::paint(painter, option, index); - - // draw emblems if needed - if(isSymlink) { - QStyleOptionViewItemV4 opt = option; - initStyleOption(&opt, index); - QIcon::Mode iconMode = iconModeFromState(opt.state); - QPoint iconPos(opt.rect.x(), opt.rect.y() + (opt.rect.height() - opt.decorationSize.height()) / 2); - // draw some emblems for the item if needed - // we only support symlink emblem at the moment - painter->drawPixmap(iconPos, symlinkIcon_.pixmap(opt.decorationSize / 2, iconMode)); - } - } -} - -// if painter is NULL, the method calculate the bounding rectangle of the text and save it to textRect -void FolderItemDelegate::drawText(QPainter* painter, QStyleOptionViewItemV4& opt, QRectF& textRect) const { - QTextLayout layout(opt.text, opt.font); - QTextOption textOption; - textOption.setAlignment(opt.displayAlignment); - textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - textOption.setTextDirection(opt.direction); - layout.setTextOption(textOption); - qreal height = 0; - qreal width = 0; - int visibleLines = 0; - layout.beginLayout(); - QString elidedText; - for(;;) { - QTextLine line = layout.createLine(); - if(!line.isValid()) - break; - line.setLineWidth(textRect.width()); - height += opt.fontMetrics.leading(); - line.setPosition(QPointF(0, height)); - if((height + line.height() + textRect.y()) > textRect.bottom()) { - // if part of this line falls outside the textRect, ignore it and quit. - QTextLine lastLine = layout.lineAt(visibleLines - 1); - elidedText = opt.text.mid(lastLine.textStart()); - elidedText = opt.fontMetrics.elidedText(elidedText, opt.textElideMode, textRect.width()); - if(visibleLines == 1) // this is the only visible line - width = textRect.width(); - break; - } - height += line.height(); - width = qMax(width, line.naturalTextWidth()); - ++ visibleLines; - } - layout.endLayout(); - - // draw background for selected item - QRectF boundRect = layout.boundingRect(); - //qDebug() << "bound rect: " << boundRect << "width: " << width; - boundRect.setWidth(width); - boundRect.moveTo(textRect.x() + (textRect.width() - width)/2, textRect.y()); - - if(!painter) { // no painter, calculate the bounding rect only - textRect = boundRect; - return; - } - - QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; - if(opt.state & QStyle::State_Selected) { - painter->fillRect(boundRect, opt.palette.highlight()); - painter->setPen(opt.palette.color(cg, QPalette::HighlightedText)); - } - else - painter->setPen(opt.palette.color(cg, QPalette::Text)); - - // draw text - for(int i = 0; i < visibleLines; ++i) { - QTextLine line = layout.lineAt(i); - if(i == (visibleLines - 1) && !elidedText.isEmpty()) { // the last line, draw elided text - QPointF pos(textRect.x() + line.position().x(), textRect.y() + line.y() + line.ascent()); - painter->drawText(pos, elidedText); - } - else { - line.draw(painter, textRect.topLeft()); - } - } - - if(opt.state & QStyle::State_HasFocus) { - // draw focus rect - QStyleOptionFocusRect o; - o.QStyleOption::operator=(opt); - o.rect = boundRect.toRect(); // subElementRect(SE_ItemViewItemFocusRect, vopt, widget); - o.state |= QStyle::State_KeyboardFocusChange; - o.state |= QStyle::State_Item; - QPalette::ColorGroup cg = (opt.state & QStyle::State_Enabled) - ? QPalette::Normal : QPalette::Disabled; - o.backgroundColor = opt.palette.color(cg, (opt.state & QStyle::State_Selected) - ? QPalette::Highlight : QPalette::Window); - if (const QWidget* widget = opt.widget) { - QStyle* style = widget->style() ? widget->style() : qApp->style(); - style->drawPrimitive(QStyle::PE_FrameFocusRect, &o, painter, widget); - } - } -} - - -} // namespace Fm diff --git a/libfm-qt/folderitemdelegate.h b/libfm-qt/folderitemdelegate.h deleted file mode 100644 index 825001c..0000000 --- a/libfm-qt/folderitemdelegate.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_FOLDERITEMDELEGATE_H -#define FM_FOLDERITEMDELEGATE_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class LIBFM_QT_API FolderItemDelegate : public QStyledItemDelegate { - Q_OBJECT -public: - explicit FolderItemDelegate(QAbstractItemView* view, QObject* parent = 0); - virtual ~FolderItemDelegate(); - - void setGridSize(QSize size) { - gridSize_ = size; - } - - QSize gridSize() { - return gridSize_; - } - - virtual QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; - virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; - -private: - void drawText(QPainter* painter, QStyleOptionViewItemV4& opt, QRectF& textRect) const; - static QIcon::Mode iconModeFromState(QStyle::State state); - -private: - QAbstractItemView* view_; - QIcon symlinkIcon_; - QSize gridSize_; -}; - -} - -#endif // FM_FOLDERITEMDELEGATE_H diff --git a/libfm-qt/foldermenu.cpp b/libfm-qt/foldermenu.cpp deleted file mode 100644 index f6641e5..0000000 --- a/libfm-qt/foldermenu.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - - Copyright (C) 2013-2014 Hong Jen Yee (PCMan) - Copyright (C) 2012-2014 Andriy Grytsenko (LStranger) - - 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. -*/ - - -#include "foldermenu.h" -#include "createnewmenu.h" -#include "filepropsdialog.h" -#include "folderview.h" -#include "utilities.h" -#include // for memset - -namespace Fm { - -FolderMenu::FolderMenu(FolderView* view, QWidget* parent): - QMenu(parent), - view_(view) { - - ProxyFolderModel* model = view_->model(); - - createAction_ = new QAction(tr("Create &New"), this); - addAction(createAction_); - - createAction_->setMenu(new CreateNewMenu(view_, view_->path(), this)); - - separator1_ = addSeparator(); - - pasteAction_ = new QAction(QIcon::fromTheme("edit-paste"), tr("&Paste"), this); - addAction(pasteAction_); - connect(pasteAction_, &QAction::triggered, this, &FolderMenu::onPasteActionTriggered); - - separator2_ = addSeparator(); - - selectAllAction_ = new QAction(tr("Select &All"), this); - addAction(selectAllAction_); - connect(selectAllAction_, &QAction::triggered, this, &FolderMenu::onSelectAllActionTriggered); - - invertSelectionAction_ = new QAction(tr("Invert Selection"), this); - addAction(invertSelectionAction_); - connect(invertSelectionAction_, &QAction::triggered, this, &FolderMenu::onInvertSelectionActionTriggered); - - separator3_ = addSeparator(); - - sortAction_ = new QAction(tr("Sorting"), this); - addAction(sortAction_); - createSortMenu(); - sortAction_->setMenu(sortMenu_); - - showHiddenAction_ = new QAction(tr("Show Hidden"), this); - addAction(showHiddenAction_); - showHiddenAction_->setCheckable(true); - showHiddenAction_->setChecked(model->showHidden()); - connect(showHiddenAction_, &QAction::triggered, this, &FolderMenu::onShowHiddenActionTriggered); - - separator4_ = addSeparator(); - - propertiesAction_ = new QAction(tr("Folder Pr&operties"), this); - addAction(propertiesAction_); - connect(propertiesAction_, &QAction::triggered, this, &FolderMenu::onPropertiesActionTriggered); -} - -FolderMenu::~FolderMenu() { -} - -void FolderMenu::addSortMenuItem(QString title, int id) { - QAction* action = new QAction(title, this); - sortMenu_->addAction(action); - action->setCheckable(true); - sortActionGroup_->addAction(action); - connect(action, &QAction::triggered, this, &FolderMenu::onSortActionTriggered); - sortActions_[id] = action; -} - -void FolderMenu::createSortMenu() { - ProxyFolderModel* model = view_->model(); - - sortMenu_ = new QMenu(this); - sortActionGroup_ = new QActionGroup(sortMenu_); - sortActionGroup_->setExclusive(true); - - std::memset(sortActions_, 0, sizeof(sortActions_)); - - addSortMenuItem(tr("By File Name"), FolderModel::ColumnFileName); - addSortMenuItem(tr("By Modification Time"), FolderModel::ColumnFileMTime); - addSortMenuItem(tr("By File Size"), FolderModel::ColumnFileSize); - addSortMenuItem(tr("By File Type"), FolderModel::ColumnFileType); - addSortMenuItem(tr("By File Owner"), FolderModel::ColumnFileOwner); - - int col = model->sortColumn(); - - if(col >= 0 && col < FolderModel::NumOfColumns) { - sortActions_[col]->setChecked(true);; - } - - sortMenu_->addSeparator(); - - QActionGroup* group = new QActionGroup(this); - group->setExclusive(true); - actionAscending_ = new QAction(tr("Ascending"), this); - actionAscending_->setCheckable(true); - sortMenu_->addAction(actionAscending_); - group->addAction(actionAscending_); - - actionDescending_ = new QAction(tr("Descending"), this); - actionDescending_->setCheckable(true); - sortMenu_->addAction(actionDescending_); - group->addAction(actionDescending_); - - if(model->sortOrder() == Qt::AscendingOrder) - actionAscending_->setChecked(true); - else - actionDescending_->setChecked(true); - - connect(actionAscending_, &QAction::triggered, this, &FolderMenu::onSortOrderActionTriggered); - connect(actionDescending_, &QAction::triggered, this, &FolderMenu::onSortOrderActionTriggered); - - sortMenu_->addSeparator(); - - QAction* actionFolderFirst = new QAction(tr("Folder First"), this); - sortMenu_->addAction(actionFolderFirst); - actionFolderFirst->setCheckable(true); - - if(model->folderFirst()) - actionFolderFirst->setChecked(true); - - connect(actionFolderFirst, &QAction::triggered, this, &FolderMenu::onFolderFirstActionTriggered); - - QAction* actionCaseSensitive = new QAction(tr("Case Sensitive"), this); - sortMenu_->addAction(actionCaseSensitive); - actionCaseSensitive->setCheckable(true); - - if(model->sortCaseSensitivity() == Qt::CaseSensitive) - actionCaseSensitive->setChecked(true); - - connect(actionCaseSensitive, &QAction::triggered, this, &FolderMenu::onCaseSensitiveActionTriggered); -} - -void FolderMenu::onPasteActionTriggered() { - FmPath* folderPath = view_->path(); - - if(folderPath) - pasteFilesFromClipboard(folderPath); -} - -void FolderMenu::onSelectAllActionTriggered() { - view_->selectAll(); -} - -void FolderMenu::onInvertSelectionActionTriggered() { - view_->invertSelection(); -} - -void FolderMenu::onSortActionTriggered(bool checked) { - ProxyFolderModel* model = view_->model(); - - if(model) { - QAction* action = static_cast(sender()); - - for(int col = 0; col < FolderModel::NumOfColumns; ++col) { - if(action == sortActions_[col]) { - model->sort(col, model->sortOrder()); - break; - } - } - } -} - -void FolderMenu::onSortOrderActionTriggered(bool checked) { - ProxyFolderModel* model = view_->model(); - - if(model) { - QAction* action = static_cast(sender()); - Qt::SortOrder order; - - if(action == actionAscending_) - order = Qt::AscendingOrder; - else - order = Qt::DescendingOrder; - - model->sort(model->sortColumn(), order); - } -} - -void FolderMenu::onShowHiddenActionTriggered(bool checked) { - ProxyFolderModel* model = view_->model(); - - if(model) { - qDebug("show hidden: %d", checked); - model->setShowHidden(checked); - } -} - -void FolderMenu::onCaseSensitiveActionTriggered(bool checked) { - ProxyFolderModel* model = view_->model(); - - if(model) { - model->setSortCaseSensitivity(checked ? Qt::CaseSensitive : Qt::CaseInsensitive); - } -} - -void FolderMenu::onFolderFirstActionTriggered(bool checked) { - ProxyFolderModel* model = view_->model(); - - if(model) { - model->setFolderFirst(checked); - } -} - -void FolderMenu::onPropertiesActionTriggered() { - FmFileInfo* folderInfo = view_->folderInfo(); - - if(folderInfo) - FilePropsDialog::showForFile(folderInfo); -} - -} // namespace Fm diff --git a/libfm-qt/foldermenu.h b/libfm-qt/foldermenu.h deleted file mode 100644 index 46c2687..0000000 --- a/libfm-qt/foldermenu.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_FOLDERMENU_H -#define FM_FOLDERMENU_H - -#include "libfmqtglobals.h" -#include -#include -#include "foldermodel.h" - -class QAction; - -namespace Fm { - -class FolderView; - -class LIBFM_QT_API FolderMenu : public QMenu { -Q_OBJECT - -public: - explicit FolderMenu(FolderView* view, QWidget* parent = 0); - virtual ~FolderMenu(); - - QAction* createAction() { - return createAction_; - } - - QAction* separator1() { - return separator1_; - } - - QAction* pasteAction() { - return pasteAction_; - } - - QAction* separator2() { - return separator2_; - } - - QAction* selectAllAction() { - return selectAllAction_; - } - - QAction* invertSelectionAction() { - return invertSelectionAction_; - } - - QAction* separator3() { - return separator3_; - } - - QAction* sortAction() { - return sortAction_; - } - - QAction* showHiddenAction() { - return showHiddenAction_; - } - - QAction* separator4() { - return separator4_; - } - - QAction* propertiesAction() { - return propertiesAction_; - } - - FolderView* view() { - return view_; - } - -protected Q_SLOTS: - void onPasteActionTriggered(); - void onSelectAllActionTriggered(); - void onInvertSelectionActionTriggered(); - void onSortActionTriggered(bool checked); - void onSortOrderActionTriggered(bool checked); - void onShowHiddenActionTriggered(bool checked); - void onCaseSensitiveActionTriggered(bool checked); - void onFolderFirstActionTriggered(bool checked); - void onPropertiesActionTriggered(); - -private: - void createSortMenu(); - void addSortMenuItem(QString title, int id); - -private: - FolderView* view_; - QAction* createAction_; - QAction* separator1_; - QAction* pasteAction_; - QAction* separator2_; - QAction* selectAllAction_; - QAction* invertSelectionAction_; - QAction* separator3_; - QAction* sortAction_; - QActionGroup* sortActionGroup_; - QMenu* sortMenu_; - QAction* sortActions_[FolderModel::NumOfColumns]; - QAction* actionAscending_; - QAction* actionDescending_; - QAction* showHiddenAction_; - QAction* separator4_; - QAction* propertiesAction_; -}; - -} - -#endif // FM_FOLDERMENU_H diff --git a/libfm-qt/foldermodel.cpp b/libfm-qt/foldermodel.cpp deleted file mode 100644 index b1506e2..0000000 --- a/libfm-qt/foldermodel.cpp +++ /dev/null @@ -1,556 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "foldermodel.h" -#include "icontheme.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "utilities.h" -#include "fileoperation.h" -#include "thumbnailloader.h" - -using namespace Fm; - -FolderModel::FolderModel() : - folder_(NULL) { -/* - ColumnIcon, - ColumnName, - ColumnFileType, - ColumnMTime, - NumOfColumns -*/ - thumbnailRefCounts.reserve(4); - - // reload all icons when the icon theme is changed - connect(IconTheme::instance(), &IconTheme::changed, this, &FolderModel::updateIcons); -} - -FolderModel::~FolderModel() { - qDebug("delete FolderModel"); - - if(folder_) - setFolder(NULL); - - // if the thumbnail requests list is not empty, cancel them - if(!thumbnailResults.empty()) { - Q_FOREACH(FmThumbnailLoader* res, thumbnailResults) { - ThumbnailLoader::cancel(res); - } - } -} - -void FolderModel::setFolder(FmFolder* new_folder) { - if(folder_) { - removeAll(); // remove old items - g_signal_handlers_disconnect_by_func(folder_, gpointer(onStartLoading), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFinishLoading), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFilesAdded), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFilesChanged), this); - g_signal_handlers_disconnect_by_func(folder_, gpointer(onFilesRemoved), this); - g_object_unref(folder_); - } - if(new_folder) { - folder_ = FM_FOLDER(g_object_ref(new_folder)); - g_signal_connect(folder_, "start-loading", G_CALLBACK(onStartLoading), this); - g_signal_connect(folder_, "finish-loading", G_CALLBACK(onFinishLoading), this); - g_signal_connect(folder_, "files-added", G_CALLBACK(onFilesAdded), this); - g_signal_connect(folder_, "files-changed", G_CALLBACK(onFilesChanged), this); - g_signal_connect(folder_, "files-removed", G_CALLBACK(onFilesRemoved), this); - // handle the case if the folder is already loaded - if(fm_folder_is_loaded(folder_)) - insertFiles(0, fm_folder_get_files(folder_)); - } - else - folder_ = NULL; -} - -void FolderModel::onStartLoading(FmFolder* folder, gpointer user_data) { - FolderModel* model = static_cast(user_data); - // remove all items - model->removeAll(); -} - -void FolderModel::onFinishLoading(FmFolder* folder, gpointer user_data) { - Q_UNUSED(folder) - Q_UNUSED(user_data) -} - -void FolderModel::onFilesAdded(FmFolder* folder, GSList* files, gpointer user_data) { - FolderModel* model = static_cast(user_data); - int n_files = g_slist_length(files); - model->beginInsertRows(QModelIndex(), model->items.count(), model->items.count() + n_files - 1); - for(GSList* l = files; l; l = l->next) { - FmFileInfo* info = FM_FILE_INFO(l->data); - FolderModelItem item(info); -/* - if(fm_file_info_is_hidden(info)) { - model->hiddenItems.append(item); - continue; - } -*/ - model->items.append(item); - } - model->endInsertRows(); -} - -//static -void FolderModel::onFilesChanged(FmFolder* folder, GSList* files, gpointer user_data) { - FolderModel* model = static_cast(user_data); - for(GSList* l = files; l; l = l->next) { - FmFileInfo* info = FM_FILE_INFO(l->data); - int row; - QList::iterator it = model->findItemByFileInfo(info, &row); - if(it != model->items.end()) { - FolderModelItem& item = *it; - // try to update the item - item.displayName = QString::fromUtf8(fm_file_info_get_disp_name(info)); - item.updateIcon(); - item.thumbnails.clear(); - QModelIndex index = model->createIndex(row, 0, &item); - Q_EMIT model->dataChanged(index, index); - } - } -} - -//static -void FolderModel::onFilesRemoved(FmFolder* folder, GSList* files, gpointer user_data) { - FolderModel* model = static_cast(user_data); - for(GSList* l = files; l; l = l->next) { - FmFileInfo* info = FM_FILE_INFO(l->data); - const char* name = fm_file_info_get_name(info); - int row; - QList::iterator it = model->findItemByName(name, &row); - if(it != model->items.end()) { - model->beginRemoveRows(QModelIndex(), row, row); - model->items.erase(it); - model->endRemoveRows(); - } - } -} - -void FolderModel::insertFiles(int row, FmFileInfoList* files) { - int n_files = fm_file_info_list_get_length(files); - beginInsertRows(QModelIndex(), row, row + n_files - 1); - for(GList* l = fm_file_info_list_peek_head_link(files); l; l = l->next) { - FolderModelItem item(FM_FILE_INFO(l->data)); - items.append(item); - } - endInsertRows(); -} - -void FolderModel::removeAll() { - if(items.empty()) - return; - beginRemoveRows(QModelIndex(), 0, items.size() - 1); - items.clear(); - endRemoveRows(); -} - -int FolderModel::rowCount(const QModelIndex & parent) const { - if(parent.isValid()) - return 0; - return items.size(); -} - -int FolderModel::columnCount (const QModelIndex & parent = QModelIndex()) const { - if(parent.isValid()) - return 0; - return NumOfColumns; -} - -FolderModelItem* FolderModel::itemFromIndex(const QModelIndex& index) const { - return reinterpret_cast(index.internalPointer()); -} - -FmFileInfo* FolderModel::fileInfoFromIndex(const QModelIndex& index) const { - FolderModelItem* item = itemFromIndex(index); - return item ? item->info : NULL; -} - -QVariant FolderModel::data(const QModelIndex & index, int role = Qt::DisplayRole) const { - if(!index.isValid() || index.row() > items.size() || index.column() >= NumOfColumns) { - return QVariant(); - } - FolderModelItem* item = itemFromIndex(index); - FmFileInfo* info = item->info; - - switch(role) { - case Qt::ToolTipRole: - return QVariant(item->displayName); - case Qt::DisplayRole: { - switch(index.column()) { - case ColumnFileName: { - return QVariant(item->displayName); - } - case ColumnFileType: { - FmMimeType* mime = fm_file_info_get_mime_type(info); - const char* desc = fm_mime_type_get_desc(mime); - return QString::fromUtf8(desc); - } - case ColumnFileMTime: { - const char* name = fm_file_info_get_disp_mtime(info); - return QString::fromUtf8(name); - } - case ColumnFileSize: { - const char* name = fm_file_info_get_disp_size(info); - return QString::fromUtf8(name); - } - case ColumnFileOwner: { - const char* name = fm_file_info_get_disp_owner(info); - return QString::fromUtf8(name); - } - } - } - case Qt::DecorationRole: { - if(index.column() == 0) { - // QPixmap pix = IconTheme::loadIcon(fm_file_info_get_icon(info), iconSize_); - return QVariant(item->icon); - // return QVariant(pix); - } - break; - } - case FileInfoRole: - return qVariantFromValue((void*)info); - } - return QVariant(); -} - -QVariant FolderModel::headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const { - if(role == Qt::DisplayRole) { - if(orientation == Qt::Horizontal) { - QString title; - switch(section) { - case ColumnFileName: - title = tr("Name"); - break; - case ColumnFileType: - title = tr("Type"); - break; - case ColumnFileSize: - title = tr("Size"); - break; - case ColumnFileMTime: - title = tr("Modified"); - break; - case ColumnFileOwner: - title = tr("Owner"); - break; - } - return QVariant(title); - } - } - return QVariant(); -} - -QModelIndex FolderModel::index(int row, int column, const QModelIndex & parent) const { - if(row <0 || row >= items.size() || column < 0 || column >= NumOfColumns) - return QModelIndex(); - const FolderModelItem& item = items.at(row); - return createIndex(row, column, (void*)&item); -} - -QModelIndex FolderModel::parent(const QModelIndex & index) const { - return QModelIndex(); -} - -Qt::ItemFlags FolderModel::flags(const QModelIndex& index) const { - // FIXME: should not return same flags unconditionally for all columns - Qt::ItemFlags flags; - if(index.isValid()) { - flags = Qt::ItemIsEnabled|Qt::ItemIsSelectable; - if(index.column() == ColumnFileName) - flags |= (Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled); - } - else { - flags = Qt::ItemIsDropEnabled; - } - return flags; -} - -// FIXME: this is very inefficient and should be replaced with a -// more reasonable implementation later. -QList::iterator FolderModel::findItemByPath(FmPath* path, int* row) { - QList::iterator it = items.begin(); - int i = 0; - while(it != items.end()) { - FolderModelItem& item = *it; - FmPath* item_path = fm_file_info_get_path(item.info); - if(fm_path_equal(item_path, path)) { - *row = i; - return it; - } - ++it; - ++i; - } - return items.end(); -} - -// FIXME: this is very inefficient and should be replaced with a -// more reasonable implementation later. -QList::iterator FolderModel::findItemByName(const char* name, int* row) { - QList::iterator it = items.begin(); - int i = 0; - while(it != items.end()) { - FolderModelItem& item = *it; - const char* item_name = fm_file_info_get_name(item.info); - if(strcmp(name, item_name) == 0) { - *row = i; - return it; - } - ++it; - ++i; - } - return items.end(); -} - -QList< FolderModelItem >::iterator FolderModel::findItemByFileInfo(FmFileInfo* info, int* row) { - QList::iterator it = items.begin(); - int i = 0; - while(it != items.end()) { - FolderModelItem& item = *it; - if(item.info == info) { - *row = i; - return it; - } - ++it; - ++i; - } - return items.end(); -} - -QStringList FolderModel::mimeTypes() const { - qDebug("FolderModel::mimeTypes"); - QStringList types = QAbstractItemModel::mimeTypes(); - // now types contains "application/x-qabstractitemmodeldatalist" - types << "text/uri-list"; - // types << "x-special/gnome-copied-files"; - return types; -} - -QMimeData* FolderModel::mimeData(const QModelIndexList& indexes) const { - QMimeData* data = QAbstractItemModel::mimeData(indexes); - qDebug("FolderModel::mimeData"); - // build a uri list - QByteArray urilist; - urilist.reserve(4096); - - QModelIndexList::const_iterator it; - for(it = indexes.constBegin(); it != indexes.end(); ++it) { - const QModelIndex index = *it; - FolderModelItem* item = itemFromIndex(index); - if(item) { - FmPath* path = fm_file_info_get_path(item->info); - char* uri = fm_path_to_uri(path); - urilist.append(uri); - urilist.append('\n'); - g_free(uri); - } - } - data->setData("text/uri-list", urilist); - - return data; -} - -bool FolderModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) { - qDebug("FolderModel::dropMimeData"); - if(!folder_) - return false; - FmPath* destPath; - if(parent.isValid()) { // drop on an item - FmFileInfo* info; - if(row == -1 && column == -1) - info = fileInfoFromIndex(parent); - else { - QModelIndex itemIndex = parent.child(row, column); - info = fileInfoFromIndex(itemIndex); - } - if(info) - destPath = fm_file_info_get_path(info); - else - return false; - } - else { // drop on blank area of the folder - destPath = path(); - } - - // FIXME: should we put this in dropEvent handler of FolderView instead? - if(data->hasUrls()) { - qDebug("drop action: %d", action); - FmPathList* srcPaths = pathListFromQUrls(data->urls()); - switch(action) { - case Qt::CopyAction: - FileOperation::copyFiles(srcPaths, destPath); - break; - case Qt::MoveAction: - FileOperation::moveFiles(srcPaths, destPath); - break; - case Qt::LinkAction: - FileOperation::symlinkFiles(srcPaths, destPath); - default: - fm_path_list_unref(srcPaths); - return false; - } - fm_path_list_unref(srcPaths); - return true; - } - else if(data->hasFormat("application/x-qabstractitemmodeldatalist")) { - return true; - } - return QAbstractListModel::dropMimeData(data, action, row, column, parent); -} - -Qt::DropActions FolderModel::supportedDropActions() const { - qDebug("FolderModel::supportedDropActions"); - return Qt::CopyAction|Qt::MoveAction|Qt::LinkAction; -} - -// ask the model to load thumbnails of the specified size -void FolderModel::cacheThumbnails(int size) { - QVector >::iterator it; - for(it = thumbnailRefCounts.begin(); it != thumbnailRefCounts.end(); ++it) { - if(it->first == size) { - break; - } - } - if(it != thumbnailRefCounts.end()) - ++it->second; - else - thumbnailRefCounts.append(QPair(size, 1)); -} - -// ask the model to free cached thumbnails of the specified size -void FolderModel::releaseThumbnails(int size) { - QVector >::iterator it; - for(it = thumbnailRefCounts.begin(); it != thumbnailRefCounts.end(); ++it) { - if(it->first == size) { - break; - } - } - if(it != thumbnailRefCounts.end()) { - --it->second; - if(it->second == 0) { - thumbnailRefCounts.erase(it); - - // remove thumbnails that ara queued for loading from thumbnailResults - QLinkedList::iterator it; - for(it = thumbnailResults.begin(); it != thumbnailResults.end();) { - QLinkedList::iterator next = it + 1; - FmThumbnailLoader* res = *it; - if(ThumbnailLoader::size(res) == size) { - ThumbnailLoader::cancel(res); - thumbnailResults.erase(it); - } - it = next; - } - - // remove all cached thumbnails of the specified size - QList::iterator itemIt; - for(itemIt = items.begin(); itemIt != items.end(); ++itemIt) { - FolderModelItem& item = *itemIt; - item.removeThumbnail(size); - } - } - } -} - -void FolderModel::onThumbnailLoaded(FmThumbnailLoader* res, gpointer user_data) { - FolderModel* pThis = reinterpret_cast(user_data); - QLinkedList::iterator it; - for(it = pThis->thumbnailResults.begin(); it != pThis->thumbnailResults.end(); ++it) { - if(*it == res) { // the thumbnail result is in our list - pThis->thumbnailResults.erase(it); // remove it from the list - FmFileInfo* info = ThumbnailLoader::fileInfo(res); - int row = -1; - // find the model item this thumbnail belongs to - QList::iterator it = pThis->findItemByFileInfo(info, &row); - if(it != pThis->items.end()) { - // the file is found in our model - FolderModelItem& item = *it; - QModelIndex index = pThis->createIndex(row, 0, (void*)&item); - // store the image in the folder model item. - int size = ThumbnailLoader::size(res); - QImage image = ThumbnailLoader::image(res); - FolderModelItem::Thumbnail* thumbnail = item.findThumbnail(size); - thumbnail->image = image; - // qDebug("thumbnail loaded for: %s, size: %d", item.displayName.toUtf8().constData(), size); - if(image.isNull()) - thumbnail->status = FolderModelItem::ThumbnailFailed; - else { - thumbnail->status = FolderModelItem::ThumbnailLoaded; - // FIXME: due to bugs in Qt's QStyledItemDelegate, if the image width and height - // are not the same, painting errors will happen. It's quite unfortunate. - // Let's do some padding to make its width and height equals. - // This greatly decrease performance :-( - // Later if we can re-implement our own item delegate, this can be avoided. - QPixmap pixmap = QPixmap(size, size); - pixmap.fill(QColor(0, 0, 0, 0)); // fill the pixmap with transparent color (alpha:0) - QPainter painter(&pixmap); - int x = (size - image.width()) / 2; - int y = (size - image.height()) / 2; - painter.drawImage(QPoint(x, y), image); // draw the image to the pixmap at center. - // FIXME: should we cache QPixmap instead for performance reason? - thumbnail->image = pixmap.toImage(); // convert it back to image - - // tell the world that we have the thumbnail loaded - Q_EMIT pThis->thumbnailLoaded(index, size); - } - } - break; - } - } -} - -// get a thumbnail of size at the index -// if a thumbnail is not yet loaded, this will initiate loading of the thumbnail. -QImage FolderModel::thumbnailFromIndex(const QModelIndex& index, int size) { - FolderModelItem* item = itemFromIndex(index); - if(item) { - FolderModelItem::Thumbnail* thumbnail = item->findThumbnail(size); - // qDebug("FolderModel::thumbnailFromIndex: %d, %s", thumbnail->status, item->displayName.toUtf8().data()); - switch(thumbnail->status) { - case FolderModelItem::ThumbnailNotChecked: { - // load the thumbnail - FmThumbnailLoader* res = ThumbnailLoader::load(item->info, size, onThumbnailLoaded, this); - thumbnailResults.push_back(res); - thumbnail->status = FolderModelItem::ThumbnailLoading; - break; - } - case FolderModelItem::ThumbnailLoaded: - return thumbnail->image; - default: - break; - } - } - return QImage(); -} - -void FolderModel::updateIcons() { - QList::iterator it = items.begin(); - for(;it != items.end(); ++it) { - (*it).updateIcon(); - } -} diff --git a/libfm-qt/foldermodel.h b/libfm-qt/foldermodel.h deleted file mode 100644 index f34fea8..0000000 --- a/libfm-qt/foldermodel.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_FOLDERMODEL_H -#define FM_FOLDERMODEL_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "foldermodelitem.h" - -namespace Fm { - -class LIBFM_QT_API FolderModel : public QAbstractListModel { -Q_OBJECT -public: - - enum Role { - FileInfoRole = Qt::UserRole - }; - - enum ColumnId { - ColumnFileName, - ColumnFileType, - ColumnFileSize, - ColumnFileMTime, - ColumnFileOwner, - NumOfColumns - }; - -public: - FolderModel(); - virtual ~FolderModel(); - - FmFolder* folder() { - return folder_; - } - void setFolder(FmFolder* new_folder); - - FmPath* path() { - return folder_ ? fm_folder_get_path(folder_) : NULL; - } - - int rowCount(const QModelIndex & parent = QModelIndex()) const; - int columnCount (const QModelIndex & parent) const; - QVariant data(const QModelIndex & index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; - QModelIndex parent( const QModelIndex & index ) const; - // void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); - - Qt::ItemFlags flags(const QModelIndex & index) const; - - virtual QStringList mimeTypes() const; - virtual QMimeData* mimeData(const QModelIndexList & indexes) const; - virtual Qt::DropActions supportedDropActions() const; - virtual bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent); - - FmFileInfo* fileInfoFromIndex(const QModelIndex& index) const; - FolderModelItem* itemFromIndex(const QModelIndex& index) const; - QImage thumbnailFromIndex(const QModelIndex& index, int size); - - void cacheThumbnails(int size); - void releaseThumbnails(int size); - -Q_SIGNALS: - void thumbnailLoaded(const QModelIndex& index, int size); - -public Q_SLOTS: - void updateIcons(); - -protected: - static void onStartLoading(FmFolder* folder, gpointer user_data); - static void onFinishLoading(FmFolder* folder, gpointer user_data); - static void onFilesAdded(FmFolder* folder, GSList* files, gpointer user_data); - static void onFilesChanged(FmFolder* folder, GSList* files, gpointer user_data); - static void onFilesRemoved(FmFolder* folder, GSList* files, gpointer user_data); - static void onThumbnailLoaded(FmThumbnailLoader *res, gpointer user_data); - - void insertFiles(int row, FmFileInfoList* files); - void removeAll(); - QList::iterator findItemByPath(FmPath* path, int* row); - QList::iterator findItemByName(const char* name, int* row); - QList::iterator findItemByFileInfo(FmFileInfo* info, int* row); - -private: - FmFolder* folder_; - // FIXME: should we use a hash table here so item lookup becomes much faster? - QList items; - - // record what size of thumbnails we should cache in an array of pairs. - QVector > thumbnailRefCounts; - QLinkedList thumbnailResults; -}; - -} - -#endif // FM_FOLDERMODEL_H diff --git a/libfm-qt/foldermodelitem.cpp b/libfm-qt/foldermodelitem.cpp deleted file mode 100644 index 927220f..0000000 --- a/libfm-qt/foldermodelitem.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * Copyright (C) 2012 Hong Jen Yee (PCMan) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#include "foldermodelitem.h" - -using namespace Fm; - -FolderModelItem::FolderModelItem(FmFileInfo* _info): - info(fm_file_info_ref(_info)) { - displayName = QString::fromUtf8(fm_file_info_get_disp_name(info)); - icon = IconTheme::icon(fm_file_info_get_icon(_info)); - thumbnails.reserve(2); -} - -FolderModelItem::FolderModelItem(const FolderModelItem& other) { - info = other.info ? fm_file_info_ref(other.info) : NULL; - displayName = QString::fromUtf8(fm_file_info_get_disp_name(info)); - icon = other.icon; - thumbnails = other.thumbnails; -} - -FolderModelItem::~FolderModelItem() { - if(info) - fm_file_info_unref(info); -} - -// find thumbnail of the specified size -// The returned thumbnail item is temporary and short-lived -// If you need to use the struct later, copy it to your own struct to keep it. -FolderModelItem::Thumbnail* FolderModelItem::findThumbnail(int size) { - QVector::iterator it; - for(it = thumbnails.begin(); it != thumbnails.end(); ++it) { - if(it->size == size) { // an image of the same size is found - return it; - } - } - if(it == thumbnails.end()) { - Thumbnail thumbnail; - thumbnail.status = ThumbnailNotChecked; - thumbnail.size = size; - thumbnails.append(thumbnail); - } - return &thumbnails.back(); -} - -// remove cached thumbnail of the specified size -void FolderModelItem::removeThumbnail(int size) { - QVector::iterator it; - for(it = thumbnails.begin(); it != thumbnails.end(); ++it) { - if(it->size == size) { // an image of the same size is found - thumbnails.erase(it); - break; - } - } -} - -#if 0 -// cache the thumbnail of the specified size in the folder item -void FolderModelItem::setThumbnail(int size, QImage image) { - QVector::iterator it; - for(it = thumbnails.begin(); it != thumbnails.end(); ++it) { - if(it->size == size) { // an image of the same size already exists - it->image = image; // replace it - it->status = ThumbnailLoaded; - break; - } - } - if(it == thumbnails.end()) { // the image is not found - Thumbnail thumbnail; - thumbnail.size = size; - thumbnail.status = ThumbnailLoaded; - thumbnail.image = image; - thumbnails.append(thumbnail); // add a new entry - } -} -#endif diff --git a/libfm-qt/foldermodelitem.h b/libfm-qt/foldermodelitem.h deleted file mode 100644 index 3953f15..0000000 --- a/libfm-qt/foldermodelitem.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Copyright (C) 2012 Hong Jen Yee (PCMan) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifndef FM_FOLDERMODELITEM_H -#define FM_FOLDERMODELITEM_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include -#include "icontheme.h" - -namespace Fm { - -class LIBFM_QT_API FolderModelItem { -public: - - enum ThumbnailStatus { - ThumbnailNotChecked, - ThumbnailLoading, - ThumbnailLoaded, - ThumbnailFailed - }; - - struct Thumbnail { - int size; - ThumbnailStatus status; - QImage image; - }; - -public: - FolderModelItem(FmFileInfo* _info); - FolderModelItem(const FolderModelItem& other); - virtual ~FolderModelItem(); - - Thumbnail* findThumbnail(int size); - // void setThumbnail(int size, QImage image); - void removeThumbnail(int size); - - void updateIcon() { - icon = IconTheme::icon(fm_file_info_get_icon(info)); - } - - QString displayName; - QIcon icon; - FmFileInfo* info; - QVector thumbnails; -}; - -} - -#endif // FM_FOLDERMODELITEM_H diff --git a/libfm-qt/folderview.cpp b/libfm-qt/folderview.cpp deleted file mode 100644 index 3ccaf82..0000000 --- a/libfm-qt/folderview.cpp +++ /dev/null @@ -1,970 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "folderview.h" -#include "foldermodel.h" -#include -#include -#include -#include "proxyfoldermodel.h" -#include "folderitemdelegate.h" -#include "dndactionmenu.h" -#include "filemenu.h" -#include "foldermenu.h" -#include "filelauncher.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "folderview_p.h" - -Q_DECLARE_OPAQUE_POINTER(FmFileInfo*) - -namespace Fm { - -FolderViewListView::FolderViewListView(QWidget* parent): - QListView(parent), - activationAllowed_(true) { - connect(this, &QListView::activated, this, &FolderViewListView::activation); -} - -FolderViewListView::~FolderViewListView() { -} - -void FolderViewListView::startDrag(Qt::DropActions supportedActions) { - if(movement() != Static) - QListView::startDrag(supportedActions); - else - QAbstractItemView::startDrag(supportedActions); -} - -void FolderViewListView::mousePressEvent(QMouseEvent* event) { - QListView::mousePressEvent(event); - static_cast(parent())->childMousePressEvent(event); -} - -QModelIndex FolderViewListView::indexAt(const QPoint& point) const { - QModelIndex index = QListView::indexAt(point); - // NOTE: QListView has a severe design flaw here. It does hit-testing based on the - // total bound rect of the item. The width of an item is determined by max(icon_width, text_width). - // So if the text label is much wider than the icon, when you click outside the icon but - // the point is still within the outer bound rect, the item is still selected. - // This results in very poor usability. Let's do precise hit-testing here. - // An item is hit only when the point is in the icon or text label. - // If the point is in the bound rectangle but outside the icon or text, it should not be selected. - if(viewMode() == QListView::IconMode && index.isValid()) { - // FIXME: this hack only improves the usability partially. We still need more precise sizeHint handling. - // FolderItemDelegate* delegate = static_cast(itemDelegateForColumn(FolderModel::ColumnFileName)); - // Q_ASSERT(delegate != NULL); - // We use the grid size - (2, 2) as the size of the bounding rectangle of the whole item. - // The width of the text label hence is gridSize.width - 2, and the width and height of the icon is from iconSize(). - QRect visRect = visualRect(index); // visibal area on the screen - QSize itemSize = gridSize(); - itemSize.setWidth(itemSize.width() - 2); - itemSize.setHeight(itemSize.height() - 2); - QSize _iconSize = iconSize(); - int textHeight = itemSize.height() - _iconSize.height(); - if(point.y() < visRect.bottom() - textHeight) { - // the point is in the icon area, not over the text label - int iconXMargin = (itemSize.width() - _iconSize.width()) / 2; - if(point.x() < (visRect.left() + iconXMargin) || point.x() > (visRect.right() - iconXMargin)) - return QModelIndex(); - } - // qDebug() << "visualRect: " << visRect << "point:" << point; - } - return index; -} - - -// NOTE: -// QListView has a problem which I consider a bug or a design flaw. -// When you set movement property to Static, theoratically the icons -// should not be movable. However, if you turned on icon mode, -// the icons becomes freely movable despite the value of movement is Static. -// To overcome this bug, we override all drag handling methods, and -// call QAbstractItemView directly, bypassing QListView. -// In this way, we can workaround the buggy behavior. -// The drag handlers of QListView basically does the same things -// as its parent QAbstractItemView, but it also stores the currently -// dragged item and paint them in the view as needed. -// TODO: I really should file a bug report to Qt developers. - -void FolderViewListView::dragEnterEvent(QDragEnterEvent* event) { - if(movement() != Static) - QListView::dragEnterEvent(event); - else - QAbstractItemView::dragEnterEvent(event); - qDebug("dragEnterEvent"); - //static_cast(parent())->childDragEnterEvent(event); -} - -void FolderViewListView::dragLeaveEvent(QDragLeaveEvent* e) { - if(movement() != Static) - QListView::dragLeaveEvent(e); - else - QAbstractItemView::dragLeaveEvent(e); - static_cast(parent())->childDragLeaveEvent(e); -} - -void FolderViewListView::dragMoveEvent(QDragMoveEvent* e) { - if(movement() != Static) - QListView::dragMoveEvent(e); - else - QAbstractItemView::dragMoveEvent(e); - static_cast(parent())->childDragMoveEvent(e); -} - -void FolderViewListView::dropEvent(QDropEvent* e) { - - static_cast(parent())->childDropEvent(e); - - if(movement() != Static) - QListView::dropEvent(e); - else - QAbstractItemView::dropEvent(e); -} - -void FolderViewListView::mouseReleaseEvent(QMouseEvent* event) { - bool activationWasAllowed = activationAllowed_; - if ((!style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, NULL, this)) || (event->button() != Qt::LeftButton)) { - activationAllowed_ = false; - } - - QListView::mouseReleaseEvent(event); - - activationAllowed_ = activationWasAllowed; -} - -void FolderViewListView::mouseDoubleClickEvent(QMouseEvent* event) { - bool activationWasAllowed = activationAllowed_; - if ((style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, NULL, this)) || (event->button() != Qt::LeftButton)) { - activationAllowed_ = false; - } - - QListView::mouseDoubleClickEvent(event); - - activationAllowed_ = activationWasAllowed; -} - -void FolderViewListView::activation(const QModelIndex &index) { - if (activationAllowed_) { - Q_EMIT activatedFiltered(index); - } -} - -//----------------------------------------------------------------------------- - -FolderViewTreeView::FolderViewTreeView(QWidget* parent): - QTreeView(parent), - layoutTimer_(NULL), - doingLayout_(false), - activationAllowed_(true) { - - header()->setStretchLastSection(true); - setIndentation(0); - - connect(this, &QTreeView::activated, this, &FolderViewTreeView::activation); -} - -FolderViewTreeView::~FolderViewTreeView() { - if(layoutTimer_) - delete layoutTimer_; -} - -void FolderViewTreeView::setModel(QAbstractItemModel* model) { - QTreeView::setModel(model); - layoutColumns(); - if(ProxyFolderModel* proxyModel = qobject_cast(model)) { - connect(proxyModel, &ProxyFolderModel::sortFilterChanged, this, &FolderViewTreeView::onSortFilterChanged, - Qt::UniqueConnection); - onSortFilterChanged(); - } -} - -void FolderViewTreeView::mousePressEvent(QMouseEvent* event) { - QTreeView::mousePressEvent(event); - static_cast(parent())->childMousePressEvent(event); -} - -void FolderViewTreeView::dragEnterEvent(QDragEnterEvent* event) { - QTreeView::dragEnterEvent(event); - static_cast(parent())->childDragEnterEvent(event); -} - -void FolderViewTreeView::dragLeaveEvent(QDragLeaveEvent* e) { - QTreeView::dragLeaveEvent(e); - static_cast(parent())->childDragLeaveEvent(e); -} - -void FolderViewTreeView::dragMoveEvent(QDragMoveEvent* e) { - QTreeView::dragMoveEvent(e); - static_cast(parent())->childDragMoveEvent(e); -} - -void FolderViewTreeView::dropEvent(QDropEvent* e) { - static_cast(parent())->childDropEvent(e); - QTreeView::dropEvent(e); -} - -// the default list mode of QListView handles column widths -// very badly (worse than gtk+) and it's not very flexible. -// so, let's handle column widths outselves. -void FolderViewTreeView::layoutColumns() { - // qDebug("layoutColumns"); - if(!model()) - return; - doingLayout_ = true; - QHeaderView* headerView = header(); - // the width that's available for showing the columns. - int availWidth = viewport()->contentsRect().width(); - int desiredWidth = 0; - - // get the width that every column want - int numCols = headerView->count(); - if(numCols > 0) { - int* widths = new int[numCols]; // array to store the widths every column needs - int column; - for(column = 0; column < numCols; ++column) { - int columnId = headerView->logicalIndex(column); - // get the size that the column needs - widths[column] = sizeHintForColumn(columnId); - // compute the total width needed - desiredWidth += widths[column]; - } - - int filenameColumn = headerView->visualIndex(FolderModel::ColumnFileName); - // if the total witdh we want exceeds the available space - if(desiredWidth > availWidth) { - // Compute the width available for the filename column - int filenameAvailWidth = availWidth - desiredWidth + widths[filenameColumn]; - - // Compute the minimum acceptable width for the filename column - int filenameMinWidth = qMin(200, sizeHintForColumn(filenameColumn)); - - if (filenameAvailWidth > filenameMinWidth) { - // Shrink the filename column to the available width - widths[filenameColumn] = filenameAvailWidth; - } - else { - // Set the filename column to its minimum width - widths[filenameColumn] = filenameMinWidth; - } - } - else { - // Fill the extra available space with the filename column - widths[filenameColumn] += availWidth - desiredWidth; - } - - // really do the resizing for every column - for(int column = 0; column < numCols; ++column) { - headerView->resizeSection(column, widths[column]); - } - delete []widths; - } - doingLayout_ = false; - - if(layoutTimer_) { - delete layoutTimer_; - layoutTimer_ = NULL; - } -} - -void FolderViewTreeView::resizeEvent(QResizeEvent* event) { - QAbstractItemView::resizeEvent(event); - // prevent endless recursion. - // When manually resizing columns, at the point where a horizontal scroll - // bar has to be inserted or removed, the vertical size changes, a resize - // event occurs and the column headers are flickering badly if the column - // layout is modified at this point. Therefore only layout the columns if - // the horizontal size changes. - if(!doingLayout_ && event->size().width() != event->oldSize().width()) - layoutColumns(); // layoutColumns() also triggers resizeEvent -} - -void FolderViewTreeView::rowsInserted(const QModelIndex& parent, int start, int end) { - QTreeView::rowsInserted(parent, start, end); - queueLayoutColumns(); -} - -void FolderViewTreeView::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) { - QTreeView::rowsAboutToBeRemoved(parent, start, end); - queueLayoutColumns(); -} - -void FolderViewTreeView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - QTreeView::dataChanged(topLeft, bottomRight); - // FIXME: this will be very inefficient - // queueLayoutColumns(); -} - -void FolderViewTreeView::reset() { - // Sometimes when the content of the model is radically changed, Qt does reset() - // on the model rather than doing large amount of insertion and deletion. - // This is for performance reason so in this case rowsInserted() and rowsAboutToBeRemoved() - // might not be called. Hence we also have to re-layout the columns when the model is reset. - // This fixes bug #190 - // https://github.com/lxde/pcmanfm-qt/issues/190 - QTreeView::reset(); - queueLayoutColumns(); -} - -void FolderViewTreeView::queueLayoutColumns() { - // qDebug("queueLayoutColumns"); - if(!layoutTimer_) { - layoutTimer_ = new QTimer(); - layoutTimer_->setSingleShot(true); - layoutTimer_->setInterval(0); - connect(layoutTimer_, &QTimer::timeout, this, &FolderViewTreeView::layoutColumns); - } - layoutTimer_->start(); -} - -void FolderViewTreeView::mouseReleaseEvent(QMouseEvent* event) { - bool activationWasAllowed = activationAllowed_; - if ((!style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, NULL, this)) || (event->button() != Qt::LeftButton)) { - activationAllowed_ = false; - } - - QTreeView::mouseReleaseEvent(event); - - activationAllowed_ = activationWasAllowed; -} - -void FolderViewTreeView::mouseDoubleClickEvent(QMouseEvent* event) { - bool activationWasAllowed = activationAllowed_; - if ((style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, NULL, this)) || (event->button() != Qt::LeftButton)) { - activationAllowed_ = false; - } - - QTreeView::mouseDoubleClickEvent(event); - - activationAllowed_ = activationWasAllowed; -} - -void FolderViewTreeView::activation(const QModelIndex &index) { - if (activationAllowed_) { - Q_EMIT activatedFiltered(index); - } -} - -void FolderViewTreeView::onSortFilterChanged() { - if(QSortFilterProxyModel* proxyModel = qobject_cast(model())) { - header()->setSortIndicatorShown(true); - header()->setSortIndicator(proxyModel->sortColumn(), proxyModel->sortOrder()); - if (!isSortingEnabled()) { - setSortingEnabled(true); - } - } -} - - -//----------------------------------------------------------------------------- - -FolderView::FolderView(ViewMode _mode, QWidget* parent): - QWidget(parent), - view(NULL), - mode((ViewMode)0), - autoSelectionDelay_(600), - autoSelectionTimer_(NULL), - selChangedTimer_(NULL), - fileLauncher_(NULL), - model_(NULL) { - - iconSize_[IconMode - FirstViewMode] = QSize(48, 48); - iconSize_[CompactMode - FirstViewMode] = QSize(24, 24); - iconSize_[ThumbnailMode - FirstViewMode] = QSize(128, 128); - iconSize_[DetailedListMode - FirstViewMode] = QSize(24, 24); - - QVBoxLayout* layout = new QVBoxLayout(); - layout->setMargin(0); - setLayout(layout); - - setViewMode(_mode); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - - connect(this, &FolderView::clicked, this, &FolderView::onFileClicked); -} - -FolderView::~FolderView() { -} - -void FolderView::onItemActivated(QModelIndex index) { - if(index.isValid() && index.model()) { - QVariant data = index.model()->data(index, FolderModel::FileInfoRole); - FmFileInfo* info = (FmFileInfo*)data.value(); - if(info) { - if (!(QApplication::keyboardModifiers() & (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier))) { - Q_EMIT clicked(ActivatedClick, info); - } - } - } -} - -void FolderView::onSelChangedTimeout() { - selChangedTimer_->deleteLater(); - selChangedTimer_ = NULL; - - QItemSelectionModel* selModel = selectionModel(); - int nSel = 0; - if(viewMode() == DetailedListMode) - nSel = selModel->selectedRows().count(); - else { - nSel = selModel->selectedIndexes().count(); - } - // qDebug()<<"selected:" << nSel; - Q_EMIT selChanged(nSel); // FIXME: this is inefficient -} - -void FolderView::onSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) { - // It's possible that the selected items change too often and this slot gets called for thousands of times. - // For example, when you select thousands of files and delete them, we will get one selectionChanged() event - // for every deleted file. So, we use a timer to delay the handling to avoid too frequent updates of the UI. - if(!selChangedTimer_) { - selChangedTimer_ = new QTimer(this); - selChangedTimer_->setSingleShot(true); - connect(selChangedTimer_, &QTimer::timeout, this, &FolderView::onSelChangedTimeout); - selChangedTimer_->start(200); - } -} - - -void FolderView::setViewMode(ViewMode _mode) { - if(_mode == mode) // if it's the same more, ignore - return; - // FIXME: retain old selection - - // since only detailed list mode uses QTreeView, and others - // all use QListView, it's wise to preserve QListView when possible. - bool recreateView = false; - if(view && (mode == DetailedListMode || _mode == DetailedListMode)) { - delete view; // FIXME: no virtual dtor? - view = NULL; - recreateView = true; - } - mode = _mode; - QSize iconSize = iconSize_[mode - FirstViewMode]; - - if(mode == DetailedListMode) { - FolderViewTreeView* treeView = new FolderViewTreeView(this); - connect(treeView, &FolderViewTreeView::activatedFiltered, this, &FolderView::onItemActivated); - - view = treeView; - treeView->setItemsExpandable(false); - treeView->setRootIsDecorated(false); - treeView->setAllColumnsShowFocus(false); - - // set our own custom delegate - FolderItemDelegate* delegate = new FolderItemDelegate(treeView); - treeView->setItemDelegateForColumn(FolderModel::ColumnFileName, delegate); - } - else { - FolderViewListView* listView; - if(view) - listView = static_cast(view); - else { - listView = new FolderViewListView(this); - connect(listView, &FolderViewListView::activatedFiltered, this, &FolderView::onItemActivated); - view = listView; - } - // set our own custom delegate - FolderItemDelegate* delegate = new FolderItemDelegate(listView); - listView->setItemDelegateForColumn(FolderModel::ColumnFileName, delegate); - // FIXME: should we expose the delegate? - listView->setMovement(QListView::Static); - listView->setResizeMode(QListView::Adjust); - listView->setWrapping(true); - switch(mode) { - case IconMode: { - listView->setViewMode(QListView::IconMode); - listView->setWordWrap(true); - listView->setFlow(QListView::LeftToRight); - break; - } - case CompactMode: { - listView->setViewMode(QListView::ListMode); - listView->setWordWrap(false); - listView->setFlow(QListView::QListView::TopToBottom); - break; - } - case ThumbnailMode: { - listView->setViewMode(QListView::IconMode); - listView->setWordWrap(true); - listView->setFlow(QListView::LeftToRight); - break; - } - default:; - } - updateGridSize(); - } - if(view) { - // we have to install the event filter on the viewport instead of the view itself. - view->viewport()->installEventFilter(this); - // we want the QEvent::HoverMove event for single click + auto-selection support - view->viewport()->setAttribute(Qt::WA_Hover, true); - view->setContextMenuPolicy(Qt::NoContextMenu); // defer the context menu handling to parent widgets - view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - view->setIconSize(iconSize); - - view->setSelectionMode(QAbstractItemView::ExtendedSelection); - layout()->addWidget(view); - - // enable dnd - view->setDragEnabled(true); - view->setAcceptDrops(true); - view->setDragDropMode(QAbstractItemView::DragDrop); - view->setDropIndicatorShown(true); - - if(model_) { - // FIXME: preserve selections - model_->setThumbnailSize(iconSize.width()); - view->setModel(model_); - if(recreateView) - connect(view->selectionModel(), &QItemSelectionModel::selectionChanged, this, &FolderView::onSelectionChanged); - } - } -} - -// set proper grid size for the QListView based on current view mode, icon size, and font size. -void FolderView::updateGridSize() { - if(mode == DetailedListMode || !view) - return; - FolderViewListView* listView = static_cast(view); - QSize icon = iconSize(mode); // size of the icon - QFontMetrics fm = fontMetrics(); // size of current font - QSize grid; // the final grid size - switch(mode) { - case IconMode: - case ThumbnailMode: { - // NOTE by PCMan about finding the optimal text label size: - // The average filename length on my root filesystem is roughly 18-20 chars. - // So, a reasonable size for the text label is about 10 chars each line since string of this length - // can be shown in two lines. If you consider word wrap, then the result is around 10 chars per word. - // In average, 10 char per line should be enough to display a "word" in the filename without breaking. - // The values can be estimated with this command: - // > find / | xargs basename -a | sed -e s'/[_-]/ /g' | wc -mcw - // However, this average only applies to English. For some Asian characters, such as Chinese chars, - // each char actually takes doubled space. To be safe, we use 13 chars per line x average char width - // to get a nearly optimal width for the text label. As most of the filenames have less than 40 chars - // 13 chars x 3 lines should be enough to show the full filenames for most files. - int textWidth = fm.averageCharWidth() * 12 + 4; // add 2 px padding for left and right border - int textHeight = fm.height() * 3 + 4; // add 2 px padding for top and bottom border - grid.setWidth(qMax(icon.width(), textWidth) + 8); // add a margin 4 px for every cell - grid.setHeight(icon.height() + textHeight + 8); // add a margin 4 px for every cell - break; - } - default: - ; // do not use grid size - } - listView->setGridSize(grid); - FolderItemDelegate* delegate = static_cast(listView->itemDelegateForColumn(FolderModel::ColumnFileName)); - delegate->setGridSize(grid); -} - -void FolderView::setIconSize(ViewMode mode, QSize size) { - Q_ASSERT(mode >= FirstViewMode && mode <= LastViewMode); - iconSize_[mode - FirstViewMode] = size; - if(viewMode() == mode) { - view->setIconSize(size); - if(model_) - model_->setThumbnailSize(size.width()); - updateGridSize(); - } -} - -QSize FolderView::iconSize(ViewMode mode) const { - Q_ASSERT(mode >= FirstViewMode && mode <= LastViewMode); - return iconSize_[mode - FirstViewMode]; -} - -FolderView::ViewMode FolderView::viewMode() const { - return mode; -} - -void FolderView::setAutoSelectionDelay(int delay) { - autoSelectionDelay_ = delay; -} - -QAbstractItemView* FolderView::childView() const { - return view; -} - -ProxyFolderModel* FolderView::model() const { - return model_; -} - -void FolderView::setModel(ProxyFolderModel* model) { - if(view) { - view->setModel(model); - QSize iconSize = iconSize_[mode - FirstViewMode]; - model->setThumbnailSize(iconSize.width()); - if(view->selectionModel()) - connect(view->selectionModel(), &QItemSelectionModel::selectionChanged, this, &FolderView::onSelectionChanged); - } - if(model_) - delete model_; - model_ = model; -} - -bool FolderView::event(QEvent* event) { - switch(event->type()) { - case QEvent::StyleChange: - break; - case QEvent::FontChange: - updateGridSize(); - break; - }; - return QWidget::event(event); -} - -void FolderView::contextMenuEvent(QContextMenuEvent* event) { - QWidget::contextMenuEvent(event); - QPoint pos = event->pos(); - QPoint view_pos = view->mapFromParent(pos); - QPoint viewport_pos = view->viewport()->mapFromParent(view_pos); - emitClickedAt(ContextMenuClick, viewport_pos); -} - -void FolderView::childMousePressEvent(QMouseEvent* event) { - // called from mousePressEvent() of child view - Qt::MouseButton button = event->button(); - if(button == Qt::MiddleButton) { - emitClickedAt(MiddleClick, event->pos()); - } else if (button == Qt::BackButton) { - Q_EMIT clickedBack(); - } else if (button == Qt::ForwardButton) { - Q_EMIT clickedForward(); - } -} - -void FolderView::emitClickedAt(ClickType type, const QPoint& pos) { - // indexAt() needs a point in "viewport" coordinates. - QModelIndex index = view->indexAt(pos); - if(index.isValid()) { - QVariant data = index.data(FolderModel::FileInfoRole); - FmFileInfo* info = reinterpret_cast(data.value()); - Q_EMIT clicked(type, info); - } - else { - // FIXME: should we show popup menu for the selected files instead - // if there are selected files? - if(type == ContextMenuClick) { - // clear current selection if clicked outside selected files - view->clearSelection(); - Q_EMIT clicked(type, NULL); - } - } -} - -QModelIndexList FolderView::selectedRows(int column) const { - QItemSelectionModel* selModel = selectionModel(); - if(selModel) { - return selModel->selectedRows(column); - } - return QModelIndexList(); -} - -// This returns all selected "cells", which means all cells of the same row are returned. -QModelIndexList FolderView::selectedIndexes() const { - QItemSelectionModel* selModel = selectionModel(); - if(selModel) { - return selModel->selectedIndexes(); - } - return QModelIndexList(); -} - -QItemSelectionModel* FolderView::selectionModel() const { - return view ? view->selectionModel() : NULL; -} - -FmPathList* FolderView::selectedFilePaths() const { - if(model_) { - QModelIndexList selIndexes = mode == DetailedListMode ? selectedRows() : selectedIndexes(); - if(!selIndexes.isEmpty()) { - FmPathList* paths = fm_path_list_new(); - QModelIndexList::const_iterator it; - for(it = selIndexes.begin(); it != selIndexes.end(); ++it) { - FmFileInfo* file = model_->fileInfoFromIndex(*it); - fm_path_list_push_tail(paths, fm_file_info_get_path(file)); - } - return paths; - } - } - return NULL; -} - -FmFileInfoList* FolderView::selectedFiles() const { - if(model_) { - QModelIndexList selIndexes = mode == DetailedListMode ? selectedRows() : selectedIndexes(); - if(!selIndexes.isEmpty()) { - FmFileInfoList* files = fm_file_info_list_new(); - QModelIndexList::const_iterator it; - for(it = selIndexes.constBegin(); it != selIndexes.constEnd(); ++it) { - FmFileInfo* file = model_->fileInfoFromIndex(*it); - fm_file_info_list_push_tail(files, file); - } - return files; - } - } - return NULL; -} - -void FolderView::selectAll() { - if(mode == DetailedListMode) - view->selectAll(); - else { - // NOTE: By default QListView::selectAll() selects all columns in the model. - // However, QListView only show the first column. Normal selection by mouse - // can only select the first column of every row. I consider this discripancy yet - // another design flaw of Qt. To make them consistent, we do it ourselves by only - // selecting the first column of every row and do not select all columns as Qt does. - // This will trigger one selectionChanged event per row, which is very inefficient, - // but we have no other choices to workaround the Qt bug. - // I'll report a Qt bug for this later. - if(model_) { - int rowCount = model_->rowCount(); - for(int row = 0; row < rowCount; ++row) { - QModelIndex index = model_->index(row, 0); - selectionModel()->select(index, QItemSelectionModel::Select); - } - } - } -} - -void FolderView::invertSelection() { - if(model_) { - QItemSelectionModel* selModel = view->selectionModel(); - int rows = model_->rowCount(); - QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::Toggle; - if(mode == DetailedListMode) - flags |= QItemSelectionModel::Rows; - for(int row = 0; row < rows; ++row) { - QModelIndex index = model_->index(row, 0); - selModel->select(index, flags); - } - } -} - -void FolderView::childDragEnterEvent(QDragEnterEvent* event) { - qDebug("drag enter"); - if(event->mimeData()->hasFormat("text/uri-list")) { - event->accept(); - } - else - event->ignore(); -} - -void FolderView::childDragLeaveEvent(QDragLeaveEvent* e) { - qDebug("drag leave"); - e->accept(); -} - -void FolderView::childDragMoveEvent(QDragMoveEvent* e) { - qDebug("drag move"); -} - -void FolderView::childDropEvent(QDropEvent* e) { - qDebug("drop"); - if(e->keyboardModifiers() == Qt::NoModifier) { - // if no key modifiers are used, popup a menu - // to ask the user for the action he/she wants to perform. - Qt::DropAction action = DndActionMenu::askUser(QCursor::pos()); - e->setDropAction(action); - } -} - -bool FolderView::eventFilter(QObject* watched, QEvent* event) { - // NOTE: Instead of simply filtering the drag and drop events of the child view in - // the event filter, we overrided each event handler virtual methods in - // both QListView and QTreeView and added some childXXXEvent() callbacks. - // We did this because of a design flaw of Qt. - // All QAbstractScrollArea derived widgets, including QAbstractItemView - // contains an internal child widget, which is called a viewport. - // The events actually comes from the child viewport, not the parent view itself. - // Qt redirects the events of viewport to the viewportEvent() method of - // QAbstractScrollArea and let the parent widget handle the events. - // Qt implemented this using a event filter installed on the child viewport widget. - // That means, when we try to install an event filter on the viewport, - // there is already a filter installed by Qt which will be called before ours. - // So we can never intercept the event handling of QAbstractItemView by using a filter. - // That's why we override respective virtual methods for different events. - if(view && watched == view->viewport()) { - switch(event->type()) { - case QEvent::HoverMove: - // activate items on single click - if(style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)) { - QHoverEvent* hoverEvent = static_cast(event); - QModelIndex index = view->indexAt(hoverEvent->pos()); // find out the hovered item - if(index.isValid()) { // change the cursor to a hand when hovering on an item - setCursor(Qt::PointingHandCursor); - if(!selectionModel()->hasSelection()) - selectionModel()->setCurrentIndex(index, QItemSelectionModel::Current); - } - else - setCursor(Qt::ArrowCursor); - // turn on auto-selection for hovered item when single click mode is used. - if(autoSelectionDelay_ > 0 && model_) { - if(!autoSelectionTimer_) { - autoSelectionTimer_ = new QTimer(this); - connect(autoSelectionTimer_, &QTimer::timeout, this, &FolderView::onAutoSelectionTimeout); - lastAutoSelectionIndex_ = QModelIndex(); - } - autoSelectionTimer_->start(autoSelectionDelay_); - } - break; - } - case QEvent::HoverLeave: - if(style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)) - setCursor(Qt::ArrowCursor); - break; - case QEvent::Wheel: - // This is to fix #85: Scrolling doesn't work in compact view - // Actually, I think it's the bug of Qt, not ours. - // When in compact mode, only the horizontal scroll bar is used and the vertical one is hidden. - // So, when a user scroll his mouse wheel, it's reasonable to scroll the horizontal scollbar. - // Qt does not implement such a simple feature, unfortunately. - // We do it by forwarding the scroll event in the viewport to the horizontal scrollbar. - // FIXME: if someday Qt supports this, we have to disable the workaround. - if(mode == CompactMode) { - QScrollBar* scroll = view->horizontalScrollBar(); - if(scroll) { - QApplication::sendEvent(scroll, event); - return true; - } - } - break; - } - } - return QObject::eventFilter(watched, event); -} - -// this slot handles auto-selection of items. -void FolderView::onAutoSelectionTimeout() { - if(QApplication::mouseButtons() != Qt::NoButton) - return; - - Qt::KeyboardModifiers mods = QApplication::keyboardModifiers(); - QPoint pos = view->viewport()->mapFromGlobal(QCursor::pos()); // convert to viewport coordinates - QModelIndex index = view->indexAt(pos); // find out the hovered item - QItemSelectionModel::SelectionFlags flags = (mode == DetailedListMode ? QItemSelectionModel::Rows : QItemSelectionModel::NoUpdate); - QItemSelectionModel* selModel = view->selectionModel(); - - if(mods & Qt::ControlModifier) { // Ctrl key is pressed - if(selModel->isSelected(index) && index != lastAutoSelectionIndex_) { - // unselect a previously selected item - selModel->select(index, flags|QItemSelectionModel::Deselect); - lastAutoSelectionIndex_ = QModelIndex(); - } - else { - // select an unselected item - selModel->select(index, flags|QItemSelectionModel::Select); - lastAutoSelectionIndex_ = index; - } - selModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); // move the cursor - } - else if(mods & Qt::ShiftModifier) { // Shift key is pressed - // select all items between current index and the hovered index. - QModelIndex current = selModel->currentIndex(); - if(selModel->hasSelection() && current.isValid()) { - selModel->clear(); // clear old selection - selModel->setCurrentIndex(current, QItemSelectionModel::NoUpdate); - int begin = current.row(); - int end = index.row(); - if(begin > end) - qSwap(begin, end); - for(int row = begin; row <= end; ++row) { - QModelIndex sel = model_->index(row, 0); - selModel->select(sel, flags|QItemSelectionModel::Select); - } - } - else { // no items are selected, select the hovered item. - if(index.isValid()) { - selModel->select(index, flags|QItemSelectionModel::SelectCurrent); - selModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); - } - } - lastAutoSelectionIndex_ = index; - } - else if(mods == Qt::NoModifier) { // no modifier keys are pressed. - if(index.isValid()) { - // select the hovered item - view->clearSelection(); - selModel->select(index, flags|QItemSelectionModel::SelectCurrent); - selModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); - } - lastAutoSelectionIndex_ = index; - } - - autoSelectionTimer_->deleteLater(); - autoSelectionTimer_ = NULL; -} - -void FolderView::onFileClicked(int type, FmFileInfo* fileInfo) { - if(type == ActivatedClick) { - if(fileLauncher_) { - GList* files = g_list_append(NULL, fileInfo); - fileLauncher_->launchFiles(NULL, files); - g_list_free(files); - } - } - else if(type == ContextMenuClick) { - FmPath* folderPath = NULL; - FmFileInfoList* files = selectedFiles(); - if (files) { - FmFileInfo* first = fm_file_info_list_peek_head(files); - if (fm_file_info_list_get_length(files) == 1 && fm_file_info_is_dir(first)) - folderPath = fm_file_info_get_path(first); - } - if (!folderPath) - folderPath = path(); - QMenu* menu = NULL; - if(fileInfo) { - // show context menu - if (FmFileInfoList* files = selectedFiles()) { - Fm::FileMenu* fileMenu = new Fm::FileMenu(files, fileInfo, folderPath); - fileMenu->setFileLauncher(fileLauncher_); - prepareFileMenu(fileMenu); - fm_file_info_list_unref(files); - menu = fileMenu; - } - } - else { - Fm::FolderMenu* folderMenu = new Fm::FolderMenu(this); - prepareFolderMenu(folderMenu); - menu = folderMenu; - } - if (menu) { - menu->exec(QCursor::pos()); - delete menu; - } - } -} - -void FolderView::prepareFileMenu(FileMenu* menu) { -} - -void FolderView::prepareFolderMenu(FolderMenu* menu) { -} - - -} // namespace Fm diff --git a/libfm-qt/folderview.h b/libfm-qt/folderview.h deleted file mode 100644 index 69f004c..0000000 --- a/libfm-qt/folderview.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_FOLDERVIEW_H -#define FM_FOLDERVIEW_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include -#include "foldermodel.h" -#include "proxyfoldermodel.h" - -class QTimer; - -namespace Fm { - -class FileMenu; -class FolderMenu; -class FileLauncher; -class FolderViewStyle; - -class LIBFM_QT_API FolderView : public QWidget { - Q_OBJECT - -public: - enum ViewMode { - FirstViewMode = 1, - IconMode = FirstViewMode, - CompactMode, - DetailedListMode, - ThumbnailMode, - LastViewMode = ThumbnailMode, - NumViewModes = (LastViewMode - FirstViewMode + 1) - }; - - enum ClickType { - ActivatedClick, - MiddleClick, - ContextMenuClick - }; - -public: - - friend class FolderViewTreeView; - friend class FolderViewListView; - - explicit FolderView(ViewMode _mode = IconMode, QWidget* parent = 0); - virtual ~FolderView(); - - void setViewMode(ViewMode _mode); - ViewMode viewMode() const; - - void setIconSize(ViewMode mode, QSize size); - QSize iconSize(ViewMode mode) const; - - QAbstractItemView* childView() const; - - ProxyFolderModel* model() const; - void setModel(ProxyFolderModel* _model); - - FmFolder* folder() { - return model_ ? static_cast(model_->sourceModel())->folder() : NULL; - } - - FmFileInfo* folderInfo() { - FmFolder* _folder = folder(); - return _folder ? fm_folder_get_info(_folder) : NULL; - } - - FmPath* path() { - FmFolder* _folder = folder(); - return _folder ? fm_folder_get_path(_folder) : NULL; - } - - QItemSelectionModel* selectionModel() const; - FmFileInfoList* selectedFiles() const; - FmPathList* selectedFilePaths() const; - - void selectAll(); - - void invertSelection(); - - void setFileLauncher(FileLauncher* launcher) { - fileLauncher_ = launcher; - } - - FileLauncher* fileLauncher() { - return fileLauncher_; - } - - int autoSelectionDelay() const { - return autoSelectionDelay_; - } - - void setAutoSelectionDelay(int delay); - -protected: - virtual bool event(QEvent* event); - virtual void contextMenuEvent(QContextMenuEvent* event); - virtual void childMousePressEvent(QMouseEvent* event); - virtual void childDragEnterEvent(QDragEnterEvent* event); - virtual void childDragMoveEvent(QDragMoveEvent* e); - virtual void childDragLeaveEvent(QDragLeaveEvent* e); - virtual void childDropEvent(QDropEvent* e); - - void emitClickedAt(ClickType type, const QPoint& pos); - - QModelIndexList selectedRows ( int column = 0 ) const; - QModelIndexList selectedIndexes() const; - - virtual void prepareFileMenu(Fm::FileMenu* menu); - virtual void prepareFolderMenu(Fm::FolderMenu* menu); - - virtual bool eventFilter(QObject* watched, QEvent* event); - - void updateGridSize(); // called when view mode, icon size, or font size is changed - -public Q_SLOTS: - void onItemActivated(QModelIndex index); - void onSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected); - virtual void onFileClicked(int type, FmFileInfo* fileInfo); - -private Q_SLOTS: - void onAutoSelectionTimeout(); - void onSelChangedTimeout(); - -Q_SIGNALS: - void clicked(int type, FmFileInfo* file); - void clickedBack(); - void clickedForward(); - void selChanged(int n_sel); - void sortChanged(); - -private: - - QAbstractItemView* view; - ProxyFolderModel* model_; - ViewMode mode; - QSize iconSize_[NumViewModes]; - FileLauncher* fileLauncher_; - int autoSelectionDelay_; - QTimer* autoSelectionTimer_; - QModelIndex lastAutoSelectionIndex_; - QTimer* selChangedTimer_; -}; - -} - -#endif // FM_FOLDERVIEW_H diff --git a/libfm-qt/folderview_p.h b/libfm-qt/folderview_p.h deleted file mode 100644 index c73ef32..0000000 --- a/libfm-qt/folderview_p.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_FOLDERVIEW_P_H -#define FM_FOLDERVIEW_P_H - -#include -#include -#include -#include "folderview.h" - -class QTimer; - -namespace Fm { - -// override these classes for implementing FolderView -class FolderViewListView : public QListView { - Q_OBJECT -public: - friend class FolderView; - FolderViewListView(QWidget* parent = 0); - virtual ~FolderViewListView(); - virtual void startDrag(Qt::DropActions supportedActions); - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void mouseDoubleClickEvent(QMouseEvent* event); - virtual void dragEnterEvent(QDragEnterEvent* event); - virtual void dragMoveEvent(QDragMoveEvent* e); - virtual void dragLeaveEvent(QDragLeaveEvent* e); - virtual void dropEvent(QDropEvent* e); - - virtual QModelIndex indexAt(const QPoint & point) const; - - inline void setPositionForIndex(const QPoint & position, const QModelIndex & index) { - QListView::setPositionForIndex(position, index); - } - - inline QRect rectForIndex(const QModelIndex & index) const { - return QListView::rectForIndex(index); - } - -Q_SIGNALS: - void activatedFiltered(const QModelIndex &index); - -private Q_SLOTS: - void activation(const QModelIndex &index); - -private: - bool activationAllowed_; -}; - -class FolderViewTreeView : public QTreeView { - Q_OBJECT -public: - friend class FolderView; - FolderViewTreeView(QWidget* parent = 0); - virtual ~FolderViewTreeView(); - virtual void setModel(QAbstractItemModel* model); - virtual void mousePressEvent(QMouseEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void mouseDoubleClickEvent(QMouseEvent* event); - virtual void dragEnterEvent(QDragEnterEvent* event); - virtual void dragMoveEvent(QDragMoveEvent* e); - virtual void dragLeaveEvent(QDragLeaveEvent* e); - virtual void dropEvent(QDropEvent* e); - - virtual void rowsInserted(const QModelIndex& parent,int start, int end); - virtual void rowsAboutToBeRemoved(const QModelIndex& parent,int start, int end); - virtual void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); - virtual void reset(); - - virtual void resizeEvent(QResizeEvent* event); - void queueLayoutColumns(); - -Q_SIGNALS: - void activatedFiltered(const QModelIndex &index); - -private Q_SLOTS: - void layoutColumns(); - void activation(const QModelIndex &index); - void onSortFilterChanged(); - -private: - bool doingLayout_; - QTimer* layoutTimer_; - bool activationAllowed_; -}; - - -} // namespace Fm - -#endif // FM_FOLDERVIEW_P_H diff --git a/libfm-qt/fontbutton.cpp b/libfm-qt/fontbutton.cpp deleted file mode 100644 index bfb7a15..0000000 --- a/libfm-qt/fontbutton.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "fontbutton.h" -#include -#include - -using namespace Fm; - -FontButton::FontButton(QWidget* parent): QPushButton(parent) { - connect(this, &QPushButton::clicked, this, &FontButton::onClicked); -} - -FontButton::~FontButton() { -} - -void FontButton::onClicked() { - QFontDialog dlg(font_); - if(dlg.exec() == QDialog::Accepted) { - setFont(dlg.selectedFont()); - } -} - -void FontButton::setFont(QFont font) { - font_ = font; - QString text = font.family(); - if(font.bold()) { - text += " "; - text += tr("Bold"); - } - if(font.italic()) { - text += " "; - text += tr("Italic"); - } - text += QString(" %1").arg(font.pointSize()); - setText(text); - Q_EMIT changed(); -} diff --git a/libfm-qt/fontbutton.h b/libfm-qt/fontbutton.h deleted file mode 100644 index f260f8f..0000000 --- a/libfm-qt/fontbutton.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_FONTBUTTON_H -#define FM_FONTBUTTON_H - -#include "libfmqtglobals.h" -#include - - -namespace Fm { - -class LIBFM_QT_API FontButton : public QPushButton { -Q_OBJECT -public: - explicit FontButton(QWidget* parent = 0); - virtual ~FontButton(); - - QFont font() { - return font_; - } - - void setFont(QFont font); - -Q_SIGNALS: - void changed(); - -private Q_SLOTS: - void onClicked(); - -private: - QFont font_; -}; - -} - -#endif // FM_FONTBUTTON_H diff --git a/libfm-qt/icontheme.cpp b/libfm-qt/icontheme.cpp deleted file mode 100644 index a8b6b86..0000000 --- a/libfm-qt/icontheme.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "icontheme.h" -#include -#include -#include -#include -#include -#include - -using namespace Fm; - -static IconTheme* theIconTheme = NULL; // the global single instance of IconTheme. -static const char* fallbackNames[] = {"unknown", "application-octet-stream", NULL}; - -static void fmIconDataDestroy(gpointer data) { - QIcon* picon = reinterpret_cast(data); - delete picon; -} - -IconTheme::IconTheme(): - currentThemeName_(QIcon::themeName()) { - // NOTE: only one instance is allowed - Q_ASSERT(theIconTheme == NULL); - Q_ASSERT(qApp != NULL); // QApplication should exists before contructing IconTheme. - - theIconTheme = this; - fm_icon_set_user_data_destroy(reinterpret_cast(fmIconDataDestroy)); - fallbackIcon_ = iconFromNames(fallbackNames); - - // We need to get notified when there is a QEvent::StyleChange event so - // we can check if the current icon theme name is changed. - // To do this, we can filter QApplication object itself to intercept - // signals of all widgets, but this may be too inefficient. - // So, we only filter the events on QDesktopWidget instead. - qApp->desktop()->installEventFilter(this); -} - -IconTheme::~IconTheme() { -} - -IconTheme* IconTheme::instance() { - return theIconTheme; -} - -// check if the icon theme name is changed and emit "changed()" signal if any change is detected. -void IconTheme::checkChanged() { - if(QIcon::themeName() != theIconTheme->currentThemeName_) { - // if the icon theme is changed - theIconTheme->currentThemeName_ = QIcon::themeName(); - // invalidate the cached data - fm_icon_reset_user_data_cache(fm_qdata_id); - - theIconTheme->fallbackIcon_ = iconFromNames(fallbackNames); - Q_EMIT theIconTheme->changed(); - } -} - -QIcon IconTheme::iconFromNames(const char* const* names) { - const gchar* const* name; - // qDebug("names: %p", names); - for(name = names; *name; ++name) { - // qDebug("icon name=%s", *name); - QString qname = *name; - QIcon qicon = QIcon::fromTheme(qname); - if(!qicon.isNull()) { - return qicon; - } - } - return QIcon(); -} - -QIcon IconTheme::convertFromGIcon(GIcon* gicon) { - if(G_IS_THEMED_ICON(gicon)) { - const gchar * const * names = g_themed_icon_get_names(G_THEMED_ICON(gicon)); - QIcon icon = iconFromNames(names); - if(!icon.isNull()) - return icon; - } - else if(G_IS_FILE_ICON(gicon)) { - GFile* file = g_file_icon_get_file(G_FILE_ICON(gicon)); - char* fpath = g_file_get_path(file); - QString path = fpath; - g_free(fpath); - return QIcon(path); - } - return theIconTheme->fallbackIcon_; -} - - -//static -QIcon IconTheme::icon(FmIcon* fmicon) { - // check if we have a cached version - QIcon* picon = reinterpret_cast(fm_icon_get_user_data(fmicon)); - if(!picon) { // we don't have a cache yet - picon = new QIcon(); // what a waste! - *picon = convertFromGIcon(G_ICON(fmicon)); - fm_icon_set_user_data(fmicon, picon); // store it in FmIcon - } - return *picon; -} - -//static -QIcon IconTheme::icon(GIcon* gicon) { - if(G_IS_THEMED_ICON(gicon)) { - FmIcon* fmicon = fm_icon_from_gicon(gicon); - QIcon qicon = icon(fmicon); - fm_icon_unref(fmicon); - return qicon; - } - else if(G_IS_FILE_ICON(gicon)) { - // we do not map GFileIcon to FmIcon deliberately. - return convertFromGIcon(gicon); - } - return theIconTheme->fallbackIcon_; -} - -// this method is called whenever there is an event on the QDesktopWidget object. -bool IconTheme::eventFilter(QObject* obj, QEvent* event) { - // we're only interested in the StyleChange event. - if(event->type() == QEvent::StyleChange) { - checkChanged(); // check if the icon theme is changed - } - return QObject::eventFilter(obj, event); -} diff --git a/libfm-qt/icontheme.h b/libfm-qt/icontheme.h deleted file mode 100644 index eee8555..0000000 --- a/libfm-qt/icontheme.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_ICONTHEME_H -#define FM_ICONTHEME_H - -#include "libfmqtglobals.h" -#include -#include -#include "libfm/fm.h" - -namespace Fm { - -// NOTE: -// Qt seems to has its own QIcon pixmap caching mechanism internally. -// Besides, it also caches QIcon objects created by QIcon::fromTheme(). -// So maybe we should not duplicate the work. -// See http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/image/qicon.cpp -// QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state). -// In addition, QPixmap is actually stored in X11 server, not client side. -// Hence maybe we should not cache too many pixmaps, I guess? -// Let's have Qt do its work and only translate GIcon to QIcon here. - -// Nice article about QPixmap from KDE: http://techbase.kde.org/Development/Tutorials/Graphics/Performance - -class LIBFM_QT_API IconTheme: public QObject { - Q_OBJECT -public: - IconTheme(); - ~IconTheme(); - - static IconTheme* instance(); - static QIcon icon(FmIcon* fmicon); - static QIcon icon(GIcon* gicon); - - static void checkChanged(); // check if current icon theme name is changed -Q_SIGNALS: - void changed(); // emitted when the name of current icon theme is changed - -protected: - bool eventFilter(QObject *obj, QEvent *event); - static QIcon convertFromGIcon(GIcon* gicon); - static QIcon iconFromNames(const char * const * names); - -protected: - QIcon fallbackIcon_; - QString currentThemeName_; -}; - -} - -#endif // FM_ICONTHEME_H diff --git a/libfm-qt/libfm-qt.pc.in b/libfm-qt/libfm-qt.pc.in deleted file mode 100644 index ea71465..0000000 --- a/libfm-qt/libfm-qt.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: libfm-qt -Description: A Qt/glib/gio-based lib used to develop file managers providing some file management utilities. (This is a Qt port of the original libfm library) -URL: http://pcmanfm.sourceforge.net/ -Requires: @REQUIRED_QT@ libfm >= 1.2.0 -Version: @LIBFM_QT_VERSION@ -Libs: -L${libdir} -lfm -l@LIBRARY_NAME@ -Cflags: -I${includedir} diff --git a/libfm-qt/libfmqt.cpp b/libfm-qt/libfmqt.cpp deleted file mode 100644 index ba59d2e..0000000 --- a/libfm-qt/libfmqt.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include -#include "libfmqt.h" -#include -#include "icontheme.h" -#include "thumbnailloader.h" - -namespace Fm { - -struct LibFmQtData { - LibFmQtData(); - ~LibFmQtData(); - - IconTheme* iconTheme; - ThumbnailLoader* thumbnailLoader; - QTranslator translator; - int refCount; - Q_DISABLE_COPY(LibFmQtData) -}; - -static LibFmQtData* theLibFmData = NULL; - -LibFmQtData::LibFmQtData(): refCount(1) { -#if !GLIB_CHECK_VERSION(2, 36, 0) - g_type_init(); -#endif - fm_init(NULL); - // turn on glib debug message - // g_setenv("G_MESSAGES_DEBUG", "all", true); - iconTheme = new IconTheme(); - thumbnailLoader = new ThumbnailLoader(); - translator.load("libfm-qt_" + QLocale::system().name(), LIBFM_DATA_DIR "/translations"); -} - -LibFmQtData::~LibFmQtData() { - delete iconTheme; - delete thumbnailLoader; - fm_finalize(); -} - -LibFmQt::LibFmQt() { - if(!theLibFmData) { - theLibFmData = new LibFmQtData(); - } - else - ++theLibFmData->refCount; - d = theLibFmData; -} - -LibFmQt::~LibFmQt() { - if(--d->refCount == 0) { - delete d; - theLibFmData = NULL; - } -} - -QTranslator* LibFmQt::translator() { - return &d->translator; -} - -} // namespace Fm diff --git a/libfm-qt/libfmqt.h b/libfm-qt/libfmqt.h deleted file mode 100644 index 208f164..0000000 --- a/libfm-qt/libfmqt.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_APPLICATION_H -#define FM_APPLICATION_H - -#include "libfmqtglobals.h" -#include -#include -#include - -namespace Fm { - -struct LibFmQtData; - -class LIBFM_QT_API LibFmQt { -public: - LibFmQt(); - ~LibFmQt(); - - QTranslator* translator(); - -private: - LibFmQt(LibFmQt& other); // disable copy - LibFmQtData* d; -}; - -} - -#endif // FM_APPLICATION_H diff --git a/libfm-qt/libfmqtglobals.h b/libfm-qt/libfmqtglobals.h deleted file mode 100644 index 3b3f999..0000000 --- a/libfm-qt/libfmqtglobals.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _LIBFM_QT_GLOBALS_ -#define _LIBFM_QT_GLOBALS_ - -#include - -#ifdef LIBFM_QT_COMPILATION - #define LIBFM_QT_API Q_DECL_EXPORT -#else - #define LIBFM_QT_API Q_DECL_IMPORT -#endif - -#endif diff --git a/libfm-qt/mount-operation-password.ui b/libfm-qt/mount-operation-password.ui deleted file mode 100644 index 75ebf31..0000000 --- a/libfm-qt/mount-operation-password.ui +++ /dev/null @@ -1,205 +0,0 @@ - - - MountOperationPasswordDialog - - - - 0 - 0 - 244 - 302 - - - - - 0 - 0 - - - - Mount - - - - - - false - - - false - - - - - - - 0 - 0 - - - - - - - - - - - Connect &anonymously - - - usernameGroup - - - - - - - Connect as u&ser: - - - usernameGroup - - - - - - - - - - - - - 0 - 0 - - - - &Username: - - - username - - - - - - - QLineEdit::Password - - - - - - - - 0 - 0 - - - - &Password: - - - password - - - - - - - &Domain: - - - domain - - - - - - - - - - - - Forget password &immediately - - - passwordGroup - - - - - - - Remember password until you &logout - - - passwordGroup - - - - - - - Remember &forever - - - passwordGroup - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - MountOperationPasswordDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - MountOperationPasswordDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - - - - - diff --git a/libfm-qt/mountoperation.cpp b/libfm-qt/mountoperation.cpp deleted file mode 100644 index 61956f6..0000000 --- a/libfm-qt/mountoperation.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - - Copyright (C) 2013 - 2014 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "mountoperation.h" -#include // for _() -#include -#include -#include -#include "mountoperationpassworddialog_p.h" -#include "mountoperationquestiondialog_p.h" -#include "ui_mount-operation-password.h" - -namespace Fm { - -MountOperation::MountOperation(bool interactive, QWidget* parent): - QObject(parent), - interactive_(interactive), - running(false), - op(g_mount_operation_new()), - cancellable_(g_cancellable_new()), - eventLoop(NULL), - autoDestroy_(true) { - - g_signal_connect(op, "ask-password", G_CALLBACK(onAskPassword), this); - g_signal_connect(op, "ask-question", G_CALLBACK(onAskQuestion), this); - // g_signal_connect(op, "reply", G_CALLBACK(onReply), this); - -#if GLIB_CHECK_VERSION(2, 20, 0) - g_signal_connect(op, "aborted", G_CALLBACK(onAbort), this); -#endif -#if GLIB_CHECK_VERSION(2, 22, 0) - g_signal_connect(op, "show-processes", G_CALLBACK(onShowProcesses), this); -#endif -#if GLIB_CHECK_VERSION(2, 34, 0) - g_signal_connect(op, "show-unmount-progress", G_CALLBACK(onShowUnmountProgress), this); -#endif - -} - -MountOperation::~MountOperation() { - qDebug("delete MountOperation"); - if(cancellable_) { - cancel(); - g_object_unref(cancellable_); - } - - if(eventLoop) { // if wait() is called to block the main loop, but the event loop is still running - // NOTE: is this possible? - eventLoop->exit(1); - } - - if(op) { - g_signal_handlers_disconnect_by_func(op, (gpointer)G_CALLBACK(onAskPassword), this); - g_signal_handlers_disconnect_by_func(op, (gpointer)G_CALLBACK(onAskQuestion), this); -#if GLIB_CHECK_VERSION(2, 20, 0) - g_signal_handlers_disconnect_by_func(op, (gpointer)G_CALLBACK(onAbort), this); -#endif -#if GLIB_CHECK_VERSION(2, 22, 0) - g_signal_handlers_disconnect_by_func(op, (gpointer)G_CALLBACK(onShowProcesses), this); -#endif -#if GLIB_CHECK_VERSION(2, 34, 0) - g_signal_handlers_disconnect_by_func(op, (gpointer)G_CALLBACK(onShowUnmountProgress), this); -#endif - g_object_unref(op); - } - // qDebug("MountOperation deleted"); -} - -void MountOperation::onAbort(GMountOperation* _op, MountOperation* pThis) { - -} - -void MountOperation::onAskPassword(GMountOperation* _op, gchar* message, gchar* default_user, gchar* default_domain, GAskPasswordFlags flags, MountOperation* pThis) { - qDebug("ask password"); - MountOperationPasswordDialog dlg(pThis, flags); - dlg.setMessage(QString::fromUtf8(message)); - dlg.setDefaultUser(QString::fromUtf8(default_user)); - dlg.setDefaultDomain(QString::fromUtf8(default_domain)); - dlg.exec(); -} - -void MountOperation::onAskQuestion(GMountOperation* _op, gchar* message, GStrv choices, MountOperation* pThis) { - qDebug("ask question"); - MountOperationQuestionDialog dialog(pThis, message, choices); - dialog.exec(); -} - -/* -void MountOperation::onReply(GMountOperation* _op, GMountOperationResult result, MountOperation* pThis) { - qDebug("reply"); -} -*/ - -void MountOperation::onShowProcesses(GMountOperation* _op, gchar* message, GArray* processes, GStrv choices, MountOperation* pThis) { - qDebug("show processes"); -} - -void MountOperation::onShowUnmountProgress(GMountOperation* _op, gchar* message, gint64 time_left, gint64 bytes_left, MountOperation* pThis) { - qDebug("show unmount progress"); -} - -void MountOperation::onEjectMountFinished(GMount* mount, GAsyncResult* res, QPointer< MountOperation >* pThis) { - if(*pThis) { - GError* error = NULL; - g_mount_eject_with_operation_finish(mount, res, &error); - (*pThis)->handleFinish(error); - } - delete pThis; -} - -void MountOperation::onEjectVolumeFinished(GVolume* volume, GAsyncResult* res, QPointer< MountOperation >* pThis) { - if(*pThis) { - GError* error = NULL; - g_volume_eject_with_operation_finish(volume, res, &error); - (*pThis)->handleFinish(error); - } - delete pThis; -} - -void MountOperation::onMountFileFinished(GFile* file, GAsyncResult* res, QPointer< MountOperation >* pThis) { - if(*pThis) { - GError* error = NULL; - g_file_mount_enclosing_volume_finish(file, res, &error); - (*pThis)->handleFinish(error); - } - delete pThis; -} - -void MountOperation::onMountVolumeFinished(GVolume* volume, GAsyncResult* res, QPointer< MountOperation >* pThis) { - if(*pThis) { - GError* error = NULL; - g_volume_mount_finish(volume, res, &error); - (*pThis)->handleFinish(error); - } - delete pThis; -} - -void MountOperation::onUnmountMountFinished(GMount* mount, GAsyncResult* res, QPointer< MountOperation >* pThis) { - if(*pThis) { - GError* error = NULL; - g_mount_unmount_with_operation_finish(mount, res, &error); - (*pThis)->handleFinish(error); - } - delete pThis; -} - -void MountOperation::handleFinish(GError* error) { - qDebug("operation finished: %p", error); - if(error) { - bool showError = interactive_; - if(error->domain == G_IO_ERROR) { - if(error->code == G_IO_ERROR_FAILED) { - // Generate a more human-readable error message instead of using a gvfs one. - // The original error message is something like: - // Error unmounting: umount exited with exit code 1: - // helper failed with: umount: only root can unmount - // UUID=18cbf00c-e65f-445a-bccc-11964bdea05d from /media/sda4 */ - // Why they pass this back to us? This is not human-readable for the users at all. - if(strstr(error->message, "only root can ")) { - g_free(error->message); - error->message = g_strdup(_("Only system administrators have the permission to do this.")); - } - } - else if(error->code == G_IO_ERROR_FAILED_HANDLED) - showError = false; - } - if(showError) - QMessageBox::critical(NULL, QObject::tr("Error"), QString::fromUtf8(error->message)); - } - - Q_EMIT finished(error); - - if(eventLoop) { // if wait() is called to block the main loop - eventLoop->exit(error != NULL ? 1 : 0); - eventLoop = NULL; - } - - if(error) - g_error_free(error); - - // free ourself here!! - if(autoDestroy_) - deleteLater(); -} - -void MountOperation::prepareUnmount(GMount* mount) { - /* ensure that CWD is not on the mounted filesystem. */ - char* cwd_str = g_get_current_dir(); - GFile* cwd = g_file_new_for_path(cwd_str); - GFile* root = g_mount_get_root(mount); - g_free(cwd_str); - /* FIXME: This cannot cover 100% cases since symlinks are not checked. - * There may be other cases that cwd is actually under mount root - * but checking prefix is not enough. We already did our best, though. */ - if(g_file_has_prefix(cwd, root)) - g_chdir("/"); - g_object_unref(cwd); - g_object_unref(root); -} - -// block the operation used an internal QEventLoop and returns -// only after the whole operation is finished. -bool MountOperation::wait() { - QEventLoop loop; - eventLoop = &loop; - int exitCode = loop.exec(); - return exitCode == 0 ? true : false; -} - -} // namespace Fm diff --git a/libfm-qt/mountoperation.h b/libfm-qt/mountoperation.h deleted file mode 100644 index 1209935..0000000 --- a/libfm-qt/mountoperation.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_MOUNTOPERATION_H -#define FM_MOUNTOPERATION_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include - -class QEventLoop; - -namespace Fm { - -// FIXME: the original APIs in gtk+ version of libfm for mounting devices is poor. -// Need to find a better API design which make things fully async and cancellable. - -// FIXME: parent_ does not work. All dialogs shown by the mount operation has no parent window assigned. -// FIXME: Need to reconsider the propery way of API design. Blocking sync calls are handy, but -// indeed causes some problems. :-( - -class LIBFM_QT_API MountOperation: public QObject { -Q_OBJECT - -public: - explicit MountOperation(bool interactive = true, QWidget* parent = 0); - ~MountOperation(); - - void mount(FmPath* path) { - GFile* gf = fm_path_to_gfile(path); - g_file_mount_enclosing_volume(gf, G_MOUNT_MOUNT_NONE, op, cancellable_, (GAsyncReadyCallback)onMountFileFinished, new QPointer(this)); - g_object_unref(gf); - } - - void mount(GVolume* volume) { - g_volume_mount(volume, G_MOUNT_MOUNT_NONE, op, cancellable_, (GAsyncReadyCallback)onMountVolumeFinished, new QPointer(this)); - } - - void unmount(GMount* mount) { - prepareUnmount(mount); - g_mount_unmount_with_operation(mount, G_MOUNT_UNMOUNT_NONE, op, cancellable_, (GAsyncReadyCallback)onUnmountMountFinished, new QPointer(this)); - } - - void unmount(GVolume* volume) { - GMount* mount = g_volume_get_mount(volume); - if(!mount) - return; - unmount(mount); - g_object_unref(mount); - } - - void eject(GMount* mount) { - prepareUnmount(mount); - g_mount_eject_with_operation(mount, G_MOUNT_UNMOUNT_NONE, op, cancellable_, (GAsyncReadyCallback)onEjectMountFinished, new QPointer(this)); - } - - void eject(GVolume* volume) { - GMount* mnt = g_volume_get_mount(volume); - prepareUnmount(mnt); - g_object_unref(mnt); - g_volume_eject_with_operation(volume, G_MOUNT_UNMOUNT_NONE, op, cancellable_, (GAsyncReadyCallback)onEjectVolumeFinished, new QPointer(this)); - } - - QWidget* parent() const { - return parent_; - } - - void setParent(QWidget* parent) { - parent_ = parent; - } - - GCancellable* cancellable() const { - return cancellable_; - } - - GMountOperation* mountOperation() { - return op; - } - - void cancel() { - g_cancellable_cancel(cancellable_); - } - - bool isRunning() const { - return running; - } - - // block the operation used an internal QEventLoop and returns - // only after the whole operation is finished. - bool wait(); - - bool autoDestroy() { - return autoDestroy_; - } - - void setAutoDestroy(bool destroy = true) { - autoDestroy_ = destroy; - } - -Q_SIGNALS: - void finished(GError* error = NULL); - -private: - void prepareUnmount(GMount* mount); - - static void onAskPassword(GMountOperation *_op, gchar* message, gchar* default_user, gchar* default_domain, GAskPasswordFlags flags, MountOperation* pThis); - static void onAskQuestion(GMountOperation *_op, gchar* message, GStrv choices, MountOperation* pThis); - // static void onReply(GMountOperation *_op, GMountOperationResult result, MountOperation* pThis); - - static void onAbort(GMountOperation *_op, MountOperation* pThis); - static void onShowProcesses(GMountOperation *_op, gchar* message, GArray* processes, GStrv choices, MountOperation* pThis); - static void onShowUnmountProgress(GMountOperation *_op, gchar* message, gint64 time_left, gint64 bytes_left, MountOperation* pThis); - - // it's possible that this object is freed when the callback is called by gio, so guarding with QPointer is needed here. - static void onMountFileFinished(GFile* file, GAsyncResult *res, QPointer* pThis); - static void onMountVolumeFinished(GVolume* volume, GAsyncResult *res, QPointer* pThis); - static void onUnmountMountFinished(GMount* mount, GAsyncResult *res, QPointer* pThis); - static void onEjectMountFinished(GMount* mount, GAsyncResult *res, QPointer* pThis); - static void onEjectVolumeFinished(GVolume* volume, GAsyncResult *res, QPointer* pThis); - - void handleFinish(GError* error); - -private: - GMountOperation* op; - GCancellable* cancellable_; - QWidget* parent_; - bool running; - bool interactive_; - QEventLoop* eventLoop; - bool autoDestroy_; -}; - -} - -#endif // FM_MOUNTOPERATION_H diff --git a/libfm-qt/mountoperationpassworddialog.cpp b/libfm-qt/mountoperationpassworddialog.cpp deleted file mode 100644 index 9f0eb0f..0000000 --- a/libfm-qt/mountoperationpassworddialog.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "mountoperationpassworddialog_p.h" -#include "ui_mount-operation-password.h" -#include "mountoperation.h" - -namespace Fm { - -MountOperationPasswordDialog::MountOperationPasswordDialog(MountOperation* op, GAskPasswordFlags flags): - QDialog(), - mountOperation(op), - canAnonymous(flags & G_ASK_PASSWORD_ANONYMOUS_SUPPORTED ? true : false), - canSavePassword(flags & G_ASK_PASSWORD_SAVING_SUPPORTED ? true : false), - needUserName(flags & G_ASK_PASSWORD_NEED_USERNAME ? true : false), - needPassword(flags & G_ASK_PASSWORD_NEED_PASSWORD ? true : false), - needDomain(flags & G_ASK_PASSWORD_NEED_DOMAIN ? true : false) { - - ui = new Ui::MountOperationPasswordDialog(); - ui->setupUi(this); - - // change the text of Ok button to Connect - ui->buttonBox->buttons().first()->setText(tr("&Connect")); - connect(ui->Anonymous, &QAbstractButton::toggled, this, &MountOperationPasswordDialog::onAnonymousToggled); - - if(canAnonymous) { - // select ananymous by default if applicable. - ui->Anonymous->setChecked(true); - } - else { - ui->Anonymous->setEnabled(false); - } - if(!needUserName) { - ui->username->setEnabled(false); - } - if(!needPassword) { - ui->password->setEnabled(false); - } - if(!needDomain) { - ui->domain->hide(); - ui->domainLabel->hide(); - } - if(canSavePassword) { - ui->sessionPassword->setChecked(true); - } - else { - ui->storePassword->setEnabled(false); - ui->sessionPassword->setEnabled(false); - ui->forgetPassword->setChecked(true); - } -} - -MountOperationPasswordDialog::~MountOperationPasswordDialog() { - delete ui; -} - -void MountOperationPasswordDialog::onAnonymousToggled(bool checked) { - // disable username/password entries if anonymous mode is used - bool useUserPassword = !checked; - if(needUserName) - ui->username->setEnabled(useUserPassword); - if(needPassword) - ui->password->setEnabled(useUserPassword); - if(needDomain) - ui->domain->setEnabled(useUserPassword); - - if(canSavePassword) { - ui->forgetPassword->setEnabled(useUserPassword); - ui->sessionPassword->setEnabled(useUserPassword); - ui->storePassword->setEnabled(useUserPassword); - } -} - -void MountOperationPasswordDialog::setMessage(QString message) { - ui->message->setText(message); -} - -void MountOperationPasswordDialog::setDefaultDomain(QString domain) { - ui->domain->setText(domain); -} - -void MountOperationPasswordDialog::setDefaultUser(QString user) { - ui->username->setText(user); -} - -void MountOperationPasswordDialog::done(int r) { - GMountOperation* gmop = mountOperation->mountOperation(); - - if(r == QDialog::Accepted) { - - if(needUserName) - g_mount_operation_set_username(gmop, ui->username->text().toUtf8()); - if(needDomain) - g_mount_operation_set_domain(gmop, ui->domain->text().toUtf8()); - if(needPassword) - g_mount_operation_set_password(gmop, ui->password->text().toUtf8()); - if(canAnonymous) - g_mount_operation_set_anonymous(gmop, ui->Anonymous->isChecked()); - - g_mount_operation_reply(gmop, G_MOUNT_OPERATION_HANDLED); - } - else { - g_mount_operation_reply(gmop, G_MOUNT_OPERATION_ABORTED); - } - QDialog::done(r); -} - -} // namespace Fm diff --git a/libfm-qt/mountoperationpassworddialog_p.h b/libfm-qt/mountoperationpassworddialog_p.h deleted file mode 100644 index 5ce3d7c..0000000 --- a/libfm-qt/mountoperationpassworddialog_p.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_MOUNTOPERATIONPASSWORDDIALOG_H -#define FM_MOUNTOPERATIONPASSWORDDIALOG_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Ui { - class MountOperationPasswordDialog; -}; - -namespace Fm { - -class MountOperation; - -class MountOperationPasswordDialog : public QDialog { -Q_OBJECT - -public: - explicit MountOperationPasswordDialog(MountOperation* op, GAskPasswordFlags flags); - virtual ~MountOperationPasswordDialog(); - - void setMessage(QString message); - void setDefaultUser(QString user); - void setDefaultDomain(QString domain); - - virtual void done(int r); - -private Q_SLOTS: - void onAnonymousToggled(bool checked); - -private: - Ui::MountOperationPasswordDialog* ui; - MountOperation* mountOperation; - bool needPassword; - bool needUserName; - bool needDomain; - bool canSavePassword; - bool canAnonymous; -}; - -} - -#endif // FM_MOUNTOPERATIONPASSWORDDIALOG_H diff --git a/libfm-qt/mountoperationquestiondialog.cpp b/libfm-qt/mountoperationquestiondialog.cpp deleted file mode 100644 index 2c33638..0000000 --- a/libfm-qt/mountoperationquestiondialog.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "mountoperationquestiondialog_p.h" -#include "mountoperation.h" -#include - -namespace Fm { - -MountOperationQuestionDialog::MountOperationQuestionDialog(MountOperation* op, gchar* message, GStrv choices): - QMessageBox(), - mountOperation(op) { - - setIcon(QMessageBox::Question); - setText(QString::fromUtf8(message)); - - choiceCount = g_strv_length(choices); - choiceButtons = new QAbstractButton*[choiceCount]; - for(int i = 0; i < choiceCount; ++i) { - // It's not allowed to add custom buttons without standard roles - // to QMessageBox. So we set role of all buttons to AcceptRole and - // handle their clicked() signals in our own slots. - // When anyone of the buttons is clicked, exec() always returns "accept". - QPushButton* button = new QPushButton(QString::fromUtf8(choices[i])); - addButton(button, QMessageBox::AcceptRole); - choiceButtons[i] = button; - } - connect(this, &MountOperationQuestionDialog::buttonClicked, this, &MountOperationQuestionDialog::onButtonClicked); -} - -MountOperationQuestionDialog::~MountOperationQuestionDialog() { - delete []choiceButtons; -} - -void MountOperationQuestionDialog::done(int r) { - if(r != QDialog::Accepted) { - GMountOperation* op = mountOperation->mountOperation(); - g_mount_operation_reply(op, G_MOUNT_OPERATION_ABORTED); - } - QDialog::done(r); -} - -void MountOperationQuestionDialog::onButtonClicked(QAbstractButton* button) { - GMountOperation* op = mountOperation->mountOperation(); - for(int i = 0; i < choiceCount; ++i) { - if(choiceButtons[i] == button) { - g_mount_operation_set_choice(op, i); - g_mount_operation_reply(op, G_MOUNT_OPERATION_HANDLED); - break; - } - } -} - -} // namespace Fm diff --git a/libfm-qt/mountoperationquestiondialog_p.h b/libfm-qt/mountoperationquestiondialog_p.h deleted file mode 100644 index 0915067..0000000 --- a/libfm-qt/mountoperationquestiondialog_p.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_MOUNTOPERATIONQUESTIONDIALOG_H -#define FM_MOUNTOPERATIONQUESTIONDIALOG_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class MountOperation; - -class MountOperationQuestionDialog : public QMessageBox { -Q_OBJECT -public: - MountOperationQuestionDialog(MountOperation* op, gchar* message, GStrv choices); - virtual ~MountOperationQuestionDialog(); - - virtual void done(int r); - -private Q_SLOTS: - void onButtonClicked(QAbstractButton* button); - -private: - MountOperation* mountOperation; - QAbstractButton** choiceButtons; - int choiceCount; -}; - -} - -#endif // FM_MOUNTOPERATIONQUESTIONDIALOG_H diff --git a/libfm-qt/path.cpp b/libfm-qt/path.cpp deleted file mode 100644 index 044bf2d..0000000 --- a/libfm-qt/path.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2014 Hong Jen Yee (PCMan) - * - * 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. - * - */ - -#include "path.h" - -using namespace Fm; diff --git a/libfm-qt/path.h b/libfm-qt/path.h deleted file mode 100644 index 06238f0..0000000 --- a/libfm-qt/path.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2014 Hong Jen Yee (PCMan) - * - * 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 FM_PATH_H -#define FM_PATH_H - -#include "libfmqtglobals.h" -#include -#include -#include - -namespace Fm { - -class LIBFM_QT_API Path { -public: - - Path(): data_(NULL) { - } - - Path(FmPath* path, bool takeOwnership = false): data_(path) { - if(path && !takeOwnership) - fm_path_ref(data_); - } - - Path(const Path& other): data_(other.data_ ? fm_path_ref(other.data_) : NULL) { - } - - Path(GFile* gf): data_(fm_path_new_for_gfile(gf)) { - } - - ~Path() { - if(data_) - fm_path_unref(data_); - } - - static Path fromPathName(const char* path_name) { - return Path(fm_path_new_for_path(path_name), true); - } - - static Path fromUri(const char* uri) { - return Path(fm_path_new_for_uri(uri), true); - } - - static Path fromDisplayName(const char* path_name) { - return Path(fm_path_new_for_display_name(path_name), true); - } - - static Path fromString(const char* path_str) { - return Path(fm_path_new_for_str(path_str), true); - } - - static Path fromCommandlineArg(const char* arg) { - return Path(fm_path_new_for_commandline_arg(arg), true); - } - - Path child(const char* basename) { - return Path(fm_path_new_child(data_, basename), true); - } - - Path child(const char* basename, int name_len) { - return Path(fm_path_new_child_len(data_, basename, name_len), true); - } - - Path relative(const char* rel) { - return Path(fm_path_new_relative(data_, rel), true); - } - - /* predefined paths */ - static Path root(void) { /* / */ - return Path(fm_path_get_root(), false); - } - - static Path home(void) { /* home directory */ - return Path(fm_path_get_home(), false); - } - - static Path desktop(void) { /* $HOME/Desktop */ - return Path(fm_path_get_desktop(), false); - } - - static Path trash(void) { /* trash:/// */ - return Path(fm_path_get_trash(), false); - } - - static Path appsMenu(void) { /* menu://applications.menu/ */ - return Path(fm_path_get_apps_menu(), false); - } - - Path parent() { - return Path(fm_path_get_parent(data_), false); - } - - const char* basename() { - return fm_path_get_basename(data_); - } - - FmPathFlags flags() { - return fm_path_get_flags(data_); - } - - bool hasPrefix(FmPath* prefix) { - return fm_path_has_prefix(data_, prefix); - } - - Path schemePath() { - return Path(fm_path_get_scheme_path(data_), true); - } - - bool isNative() { - return fm_path_is_native(data_); - } - - bool isTrash() { - return fm_path_is_trash(data_); - } - - bool isTrashRoot() { - return fm_path_is_trash_root(data_); - } - - bool isNativeOrTrash() { - return fm_path_is_native_or_trash(data_); - } - - char* toString() { - return fm_path_to_str(data_); - } - - QByteArray toByteArray() { - char* s = fm_path_to_str(data_); - QByteArray str(s); - g_free(s); - return str; - } - - char* toUri() { - return fm_path_to_uri(data_); - } - - GFile* toGfile() { - return fm_path_to_gfile(data_); - } - - /* - char* displayName(bool human_readable = true) { - return fm_path_display_name(data_, human_readable); - } - */ - - QString displayName(bool human_readable = true) { - char* dispname = fm_path_display_name(data_, human_readable); - QString str = QString::fromUtf8(dispname); - g_free(dispname); - return str; - } - - /* - char* displayBasename() { - return fm_path_display_basename(data_); - } - */ - - QString displayBasename() { - char* basename = fm_path_display_basename(data_); - QString s = QString::fromUtf8(basename); - g_free(basename); - return s; - } - - /* For used in hash tables */ - guint hash() { - return fm_path_hash(data_); - } - - void take(FmPath* path) { // take the ownership of the "path" - if(data_) - fm_path_unref(data_); - data_ = path; - } - - Path& operator = (const Path& other) { - if(data_) - fm_path_unref(data_); - data_ = fm_path_ref(other.data_); - return *this; - } - - bool operator == (const Path& other) const { - return fm_path_equal(data_, other.data_); - } - - bool operator != (const Path& other) const { - return !fm_path_equal(data_, other.data_); - } - - bool operator < (const Path& other) const { - return compare(other); - } - - bool operator > (const Path& other) const { - return (other < *this); - } - - /* can be used for sorting */ - int compare(const Path& other) const { - return fm_path_compare(data_, other.data_); - } - - /* used for completion in entry */ - bool equal(const gchar *str, int n) const { - return fm_path_equal_str(data_, str, n); - } - - /* calculate how many elements are in this path. */ - int depth() const { - return fm_path_depth(data_); - } - - FmPath* data() const { - return data_; - } - -private: - FmPath* data_; -}; - -} - -Q_DECLARE_OPAQUE_POINTER(FmPath*) - -#endif // FM_PATH_H diff --git a/libfm-qt/pathedit.cpp b/libfm-qt/pathedit.cpp deleted file mode 100644 index c6c9e42..0000000 --- a/libfm-qt/pathedit.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "pathedit.h" -#include -#include -#include -#include -#include - -namespace Fm { - -PathEdit::PathEdit(QWidget* parent): - QLineEdit(parent), - cancellable_(NULL), - model_(new QStringListModel()), - completer_(new QCompleter()) { - setCompleter(completer_); - completer_->setModel(model_); - connect(this, &PathEdit::textChanged, this, &PathEdit::onTextChanged); -} - -PathEdit::~PathEdit() { - delete completer_; - if(model_) - delete model_; - if(cancellable_) { - g_cancellable_cancel(cancellable_); - g_object_unref(cancellable_); - } -} - -void PathEdit::focusInEvent(QFocusEvent* e) { - QLineEdit::focusInEvent(e); - // build the completion list only when we have the keyboard focus - reloadCompleter(true); -} - -void PathEdit::focusOutEvent(QFocusEvent* e) { - QLineEdit::focusOutEvent(e); - // free the completion list since we don't need it anymore - freeCompleter(); -} - -void PathEdit::onTextChanged(const QString& text) { - int pos = text.lastIndexOf('/'); - if(pos >= 0) - ++pos; - else - pos = text.length(); - QString newPrefix = text.left(pos); - if(currentPrefix_ != newPrefix) { - currentPrefix_ = newPrefix; - // only build the completion list if we have the keyboard focus - // if we don't have the focus now, then we'll rebuild the completion list - // when focusInEvent happens. this avoid unnecessary dir loading. - if(hasFocus()) - reloadCompleter(false); - } -} - -struct JobData { - GCancellable* cancellable; - GFile* dirName; - QStringList subDirs; - PathEdit* edit; - bool triggeredByFocusInEvent; - - ~JobData() { - g_object_unref(dirName); - g_object_unref(cancellable); - } - - static void freeMe(JobData* data) { - delete data; - } -}; - -void PathEdit::reloadCompleter(bool triggeredByFocusInEvent) { - // parent dir has been changed, reload dir list - // if(currentPrefix_[0] == "~") { // special case for home dir - // cancel running dir-listing jobs, if there's any - if(cancellable_) { - g_cancellable_cancel(cancellable_); - g_object_unref(cancellable_); - } - // launch a new job to do dir listing - JobData* data = new JobData(); - data->edit = this; - data->triggeredByFocusInEvent = triggeredByFocusInEvent; - // need to use fm_file_new_for_commandline_arg() rather than g_file_new_for_commandline_arg(). - // otherwise, our own vfs, such as menu://, won't be loaded. - data->dirName = fm_file_new_for_commandline_arg(currentPrefix_.toLocal8Bit().constData()); - // qDebug("load: %s", g_file_get_uri(data->dirName)); - cancellable_ = g_cancellable_new(); - data->cancellable = (GCancellable*)g_object_ref(cancellable_); - g_io_scheduler_push_job((GIOSchedulerJobFunc)jobFunc, - data, (GDestroyNotify)JobData::freeMe, - G_PRIORITY_LOW, cancellable_); -} - -void PathEdit::freeCompleter() { - if(cancellable_) { - g_cancellable_cancel(cancellable_); - g_object_unref(cancellable_); - cancellable_ = NULL; - } - model_->setStringList(QStringList()); -} - -gboolean PathEdit::jobFunc(GIOSchedulerJob* job, GCancellable* cancellable, gpointer user_data) { - JobData* data = reinterpret_cast(user_data); - GError *err = NULL; - GFileEnumerator* enu = g_file_enumerate_children(data->dirName, - // G_FILE_ATTRIBUTE_STANDARD_NAME"," - G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME"," - G_FILE_ATTRIBUTE_STANDARD_TYPE, - G_FILE_QUERY_INFO_NONE, cancellable, - &err); - if(enu) { - while(!g_cancellable_is_cancelled(cancellable)) { - GFileInfo* inf = g_file_enumerator_next_file(enu, cancellable, &err); - if(inf) { - GFileType type = g_file_info_get_file_type(inf); - if(type == G_FILE_TYPE_DIRECTORY) { - const char* name = g_file_info_get_display_name(inf); - // FIXME: encoding conversion here? - data->subDirs.append(QString::fromUtf8(name)); - } - g_object_unref(inf); - } - else { - if(err) { - g_error_free(err); - err = NULL; - } - else /* EOF */ - break; - } - } - g_file_enumerator_close(enu, cancellable, NULL); - g_object_unref(enu); - } - // finished! let's update the UI in the main thread - g_io_scheduler_job_send_to_mainloop(job, _onJobFinished, data, NULL); - return FALSE; -} - -// static -gboolean PathEdit::_onJobFinished(gpointer user_data) { - JobData* data = reinterpret_cast(user_data); - data->edit->onJobFinished(data); - return TRUE; -} - -// This callback function is called from main thread so it's safe to access the GUI -void PathEdit::onJobFinished(JobData* data) { - if(!g_cancellable_is_cancelled(data->cancellable)) { - // update the completer only if the job is not cancelled - QStringList::iterator it; - for(it = data->subDirs.begin(); it != data->subDirs.end(); ++it) { - // qDebug("%s", it->toUtf8().constData()); - *it = (currentPrefix_ % *it); - } - model_->setStringList(data->subDirs); - // trigger completion manually - if(hasFocus() && !data->triggeredByFocusInEvent) - completer_->complete(); - } - else - model_->setStringList(QStringList()); - if(cancellable_) { - g_object_unref(cancellable_); - cancellable_ = NULL; - } -} - -} // namespace Fm diff --git a/libfm-qt/pathedit.h b/libfm-qt/pathedit.h deleted file mode 100644 index e5cab4c..0000000 --- a/libfm-qt/pathedit.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_PATHEDIT_H -#define FM_PATHEDIT_H - -#include "libfmqtglobals.h" -#include -#include - -class QCompleter; -class QStringListModel; - -namespace Fm { - -struct JobData; - -class LIBFM_QT_API PathEdit : public QLineEdit { -Q_OBJECT -public: - explicit PathEdit(QWidget* parent = 0); - virtual ~PathEdit(); - -protected: - virtual void focusInEvent(QFocusEvent* e); - virtual void focusOutEvent(QFocusEvent* e); - -private Q_SLOTS: - void onTextChanged(const QString & text); - -private: - void reloadCompleter(bool triggeredByFocusInEvent = false); - void freeCompleter(); - static gboolean jobFunc(GIOSchedulerJob *job, GCancellable *cancellable, gpointer user_data); - static gboolean _onJobFinished(gpointer user_data); - void onJobFinished(JobData* data); - -private: - QCompleter* completer_; - QStringListModel* model_; - QString currentPrefix_; - GCancellable* cancellable_; -}; - -} - -#endif // FM_PATHEDIT_H diff --git a/libfm-qt/placesmodel.cpp b/libfm-qt/placesmodel.cpp deleted file mode 100644 index 2434a94..0000000 --- a/libfm-qt/placesmodel.cpp +++ /dev/null @@ -1,521 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "placesmodel.h" -#include "icontheme.h" -#include -#include -#include -#include -#include "utilities.h" -#include "placesmodelitem.h" - -using namespace Fm; - -PlacesModel::PlacesModel(QObject* parent): - QStandardItemModel(parent), - showApplications_(true), - showDesktop_(true), - ejectIcon_(QIcon::fromTheme("media-eject")) { - - setColumnCount(2); - - placesRoot = new QStandardItem(tr("Places")); - placesRoot->setSelectable(false); - placesRoot->setColumnCount(2); - appendRow(placesRoot); - - homeItem = new PlacesModelItem("user-home", g_get_user_name(), fm_path_get_home()); - placesRoot->appendRow(homeItem); - - desktopItem = new PlacesModelItem("user-desktop", tr("Desktop"), fm_path_get_desktop()); - placesRoot->appendRow(desktopItem); - - createTrashItem(); - - FmPath* path; - // FIXME: add an option to hide network:/// - if(true) { - path = fm_path_new_for_uri("computer:///"); - computerItem = new PlacesModelItem("computer", tr("Computer"), path); - fm_path_unref(path); - placesRoot->appendRow(computerItem); - } - else - computerItem = NULL; - - // FIXME: add an option to hide applications:/// - const char* applicaion_icon_names[] = {"system-software-install", "applications-accessories", "application-x-executable"}; - // NOTE: g_themed_icon_new_from_names() accepts char**, but actually const char** is OK. - GIcon* gicon = g_themed_icon_new_from_names((char**)applicaion_icon_names, G_N_ELEMENTS(applicaion_icon_names)); - FmIcon* fmicon = fm_icon_from_gicon(gicon); - g_object_unref(gicon); - applicationsItem = new PlacesModelItem(fmicon, tr("Applications"), fm_path_get_apps_menu()); - fm_icon_unref(fmicon); - placesRoot->appendRow(applicationsItem); - - // FIXME: add an option to hide network:/// - if(true) { - const char* network_icon_names[] = {"network", "folder-network", "folder"}; - // NOTE: g_themed_icon_new_from_names() accepts char**, but actually const char** is OK. - gicon = g_themed_icon_new_from_names((char**)network_icon_names, G_N_ELEMENTS(network_icon_names)); - fmicon = fm_icon_from_gicon(gicon); - g_object_unref(gicon); - path = fm_path_new_for_uri("network:///"); - networkItem = new PlacesModelItem(fmicon, tr("Network"), path); - fm_icon_unref(fmicon); - fm_path_unref(path); - placesRoot->appendRow(networkItem); - } - else - networkItem = NULL; - - devicesRoot = new QStandardItem(tr("Devices")); - devicesRoot->setSelectable(false); - devicesRoot->setColumnCount(2); - appendRow(devicesRoot); - - // volumes - volumeMonitor = g_volume_monitor_get(); - if(volumeMonitor) { - g_signal_connect(volumeMonitor, "volume-added", G_CALLBACK(onVolumeAdded), this); - g_signal_connect(volumeMonitor, "volume-removed", G_CALLBACK(onVolumeRemoved), this); - g_signal_connect(volumeMonitor, "volume-changed", G_CALLBACK(onVolumeChanged), this); - g_signal_connect(volumeMonitor, "mount-added", G_CALLBACK(onMountAdded), this); - g_signal_connect(volumeMonitor, "mount-changed", G_CALLBACK(onMountChanged), this); - g_signal_connect(volumeMonitor, "mount-removed", G_CALLBACK(onMountRemoved), this); - - // add volumes to side-pane - GList* vols = g_volume_monitor_get_volumes(volumeMonitor); - GList* l; - for(l = vols; l; l = l->next) { - GVolume* volume = G_VOLUME(l->data); - onVolumeAdded(volumeMonitor, volume, this); - g_object_unref(volume); - } - g_list_free(vols); - - /* add mounts to side-pane */ - vols = g_volume_monitor_get_mounts(volumeMonitor); - for(l = vols; l; l = l->next) { - GMount* mount = G_MOUNT(l->data); - GVolume* volume = g_mount_get_volume(mount); - if(volume) - g_object_unref(volume); - else { /* network mounts or others */ - PlacesModelItem* item = new PlacesModelMountItem(mount); - devicesRoot->appendRow(item); - } - g_object_unref(mount); - } - g_list_free(vols); - } - - // bookmarks - bookmarksRoot = new QStandardItem(tr("Bookmarks")); - bookmarksRoot->setSelectable(false); - bookmarksRoot->setColumnCount(2); - appendRow(bookmarksRoot); - - bookmarks = fm_bookmarks_dup(); - loadBookmarks(); - g_signal_connect(bookmarks, "changed", G_CALLBACK(onBookmarksChanged), this); - - // update some icons when the icon theme is changed - connect(IconTheme::instance(), &IconTheme::changed, this, &PlacesModel::updateIcons); -} - -void PlacesModel::loadBookmarks() { - GList* allBookmarks = fm_bookmarks_get_all(bookmarks); - for(GList* l = allBookmarks; l; l = l->next) { - FmBookmarkItem* bm_item = (FmBookmarkItem*)l->data; - PlacesModelBookmarkItem* item = new PlacesModelBookmarkItem(bm_item); - bookmarksRoot->appendRow(item); - } - g_list_free_full(allBookmarks, (GDestroyNotify)fm_bookmark_item_unref); -} - -PlacesModel::~PlacesModel() { - if(bookmarks) { - g_signal_handlers_disconnect_by_func(bookmarks, (gpointer)onBookmarksChanged, this); - g_object_unref(bookmarks); - } - if(volumeMonitor) { - g_signal_handlers_disconnect_by_func(volumeMonitor, (gpointer)G_CALLBACK(onVolumeAdded), this); - g_signal_handlers_disconnect_by_func(volumeMonitor, (gpointer)G_CALLBACK(onVolumeRemoved), this); - g_signal_handlers_disconnect_by_func(volumeMonitor, (gpointer)G_CALLBACK(onVolumeChanged), this); - g_signal_handlers_disconnect_by_func(volumeMonitor, (gpointer)G_CALLBACK(onMountAdded), this); - g_signal_handlers_disconnect_by_func(volumeMonitor, (gpointer)G_CALLBACK(onMountChanged), this); - g_signal_handlers_disconnect_by_func(volumeMonitor, (gpointer)G_CALLBACK(onMountRemoved), this); - g_object_unref(volumeMonitor); - } - if(trashMonitor_) { - g_signal_handlers_disconnect_by_func(trashMonitor_, (gpointer)G_CALLBACK(onTrashChanged), this); - g_object_unref(trashMonitor_); - } -} - -// static -void PlacesModel::onTrashChanged(GFileMonitor* monitor, GFile* gf, GFile* other, GFileMonitorEvent evt, PlacesModel* pThis) { - QTimer::singleShot(0, pThis, SLOT(updateTrash())); -} - -void PlacesModel::updateTrash() { - if(trashItem_) { - GFile* gf = fm_file_new_for_uri("trash:///"); - GFileInfo* inf = g_file_query_info(gf, G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT, G_FILE_QUERY_INFO_NONE, NULL, NULL); - g_object_unref(gf); - if(inf) { - guint32 n = g_file_info_get_attribute_uint32(inf, G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT); - g_object_unref(inf); - const char* icon_name = n > 0 ? "user-trash-full" : "user-trash"; - FmIcon* icon = fm_icon_from_name(icon_name); - trashItem_->setIcon(icon); - fm_icon_unref(icon); - } - } -} - -void PlacesModel::createTrashItem() { - GFile* gf; - gf = fm_file_new_for_uri("trash:///"); - // check if trash is supported by the current vfs - // if gvfs is not installed, this can be unavailable. - if(!g_file_query_exists(gf, NULL)) { - g_object_unref(gf); - trashItem_ = NULL; - trashMonitor_ = NULL; - return; - } - trashItem_ = new PlacesModelItem("user-trash", tr("Trash"), fm_path_get_trash()); - - trashMonitor_ = fm_monitor_directory(gf, NULL); - if(trashMonitor_) - g_signal_connect(trashMonitor_, "changed", G_CALLBACK(onTrashChanged), this); - g_object_unref(gf); - - placesRoot->insertRow(desktopItem->row() + 1, trashItem_); - QTimer::singleShot(0, this, SLOT(updateTrash())); -} - -void PlacesModel::setShowApplications(bool show) { - if(showApplications_ != show) { - showApplications_ = show; - } -} - -void PlacesModel::setShowDesktop(bool show) { - if(showDesktop_ != show) { - showDesktop_ = show; - } -} - -void PlacesModel::setShowTrash(bool show) { - if(show) { - if(!trashItem_) - createTrashItem(); - } - else { - if(trashItem_) { - if(trashMonitor_) { - g_signal_handlers_disconnect_by_func(trashMonitor_, (gpointer)G_CALLBACK(onTrashChanged), this); - g_object_unref(trashMonitor_); - trashMonitor_ = NULL; - } - placesRoot->removeRow(trashItem_->row()); // delete trashItem_; - trashItem_ = NULL; - } - } -} - -PlacesModelItem* PlacesModel::itemFromPath(FmPath* path) { - PlacesModelItem* item = itemFromPath(placesRoot, path); - if(!item) - item = itemFromPath(devicesRoot, path); - if(!item) - item = itemFromPath(bookmarksRoot, path); - return item; -} - -PlacesModelItem* PlacesModel::itemFromPath(QStandardItem* rootItem, FmPath* path) { - int rowCount = rootItem->rowCount(); - for(int i = 0; i < rowCount; ++i) { - PlacesModelItem* item = static_cast(rootItem->child(i, 0)); - if(fm_path_equal(item->path(), path)) - return item; - } - return NULL; -} - -PlacesModelVolumeItem* PlacesModel::itemFromVolume(GVolume* volume) { - int rowCount = devicesRoot->rowCount(); - for(int i = 0; i < rowCount; ++i) { - PlacesModelItem* item = static_cast(devicesRoot->child(i, 0)); - if(item->type() == PlacesModelItem::Volume) { - PlacesModelVolumeItem* volumeItem = static_cast(item); - if(volumeItem->volume() == volume) - return volumeItem; - } - } - return NULL; -} - -PlacesModelMountItem* PlacesModel::itemFromMount(GMount* mount) { - int rowCount = devicesRoot->rowCount(); - for(int i = 0; i < rowCount; ++i) { - PlacesModelItem* item = static_cast(devicesRoot->child(i, 0)); - if(item->type() == PlacesModelItem::Mount) { - PlacesModelMountItem* mountItem = static_cast(item); - if(mountItem->mount() == mount) - return mountItem; - } - } - return NULL; -} - -PlacesModelBookmarkItem* PlacesModel::itemFromBookmark(FmBookmarkItem* bkitem) { - int rowCount = bookmarksRoot->rowCount(); - for(int i = 0; i < rowCount; ++i) { - PlacesModelBookmarkItem* item = static_cast(bookmarksRoot->child(i, 0)); - if(item->bookmark() == bkitem) - return item; - } - return NULL; -} - -void PlacesModel::onMountAdded(GVolumeMonitor* monitor, GMount* mount, PlacesModel* pThis) { - GVolume* vol = g_mount_get_volume(mount); - if(vol) { // mount-added is also emitted when a volume is newly mounted. - PlacesModelVolumeItem* item = pThis->itemFromVolume(vol); - if(item && !item->path()) { - // update the mounted volume and show a button for eject. - GFile* gf = g_mount_get_root(mount); - FmPath* path = fm_path_new_for_gfile(gf); - g_object_unref(gf); - item->setPath(path); - if(path) - fm_path_unref(path); - // update the mount indicator (eject button) - QStandardItem* ejectBtn = item->parent()->child(item->row(), 1); - Q_ASSERT(ejectBtn); - ejectBtn->setIcon(pThis->ejectIcon_); - } - g_object_unref(vol); - } - else { // network mounts and others - PlacesModelMountItem* item = pThis->itemFromMount(mount); - /* for some unknown reasons, sometimes we get repeated mount-added - * signals and added a device more than one. So, make a sanity check here. */ - if(!item) { - item = new PlacesModelMountItem(mount); - QStandardItem* eject_btn = new QStandardItem(pThis->ejectIcon_, ""); - pThis->devicesRoot->appendRow(QList() << item << eject_btn); - } - } -} - -void PlacesModel::onMountChanged(GVolumeMonitor* monitor, GMount* mount, PlacesModel* pThis) { - PlacesModelMountItem* item = pThis->itemFromMount(mount); - if(item) - item->update(); -} - -void PlacesModel::onMountRemoved(GVolumeMonitor* monitor, GMount* mount, PlacesModel* pThis) { - GVolume* vol = g_mount_get_volume(mount); - qDebug() << "volume umounted: " << vol; - if(vol) { - // a volume is unmounted - g_object_unref(vol); - } - else { // network mounts and others - PlacesModelMountItem* item = pThis->itemFromMount(mount); - if(item) { - pThis->devicesRoot->removeRow(item->row()); - } - } -} - -void PlacesModel::onVolumeAdded(GVolumeMonitor* monitor, GVolume* volume, PlacesModel* pThis) { - // for some unknown reasons, sometimes we get repeated volume-added - // signals and added a device more than one. So, make a sanity check here. - PlacesModelVolumeItem* volumeItem = pThis->itemFromVolume(volume); - if(!volumeItem) { - volumeItem = new PlacesModelVolumeItem(volume); - QStandardItem* ejectBtn = new QStandardItem(); - if(volumeItem->isMounted()) - ejectBtn->setIcon(pThis->ejectIcon_); - pThis->devicesRoot->appendRow(QList() << volumeItem << ejectBtn); - } -} - -void PlacesModel::onVolumeChanged(GVolumeMonitor* monitor, GVolume* volume, PlacesModel* pThis) { - PlacesModelVolumeItem* item = pThis->itemFromVolume(volume); - if(item) { - item->update(); - if(!item->isMounted()) { // the volume is unmounted, remove the eject button if needed - // remove the eject button for the volume (at column 1 of the same row) - QStandardItem* ejectBtn = item->parent()->child(item->row(), 1); - Q_ASSERT(ejectBtn); - ejectBtn->setIcon(QIcon()); - } - } -} - -void PlacesModel::onVolumeRemoved(GVolumeMonitor* monitor, GVolume* volume, PlacesModel* pThis) { - PlacesModelVolumeItem* item = pThis->itemFromVolume(volume); - if(item) { - pThis->devicesRoot->removeRow(item->row()); - } -} - -void PlacesModel::onBookmarksChanged(FmBookmarks* bookmarks, PlacesModel* pThis) { - // remove all items - pThis->bookmarksRoot->removeRows(0, pThis->bookmarksRoot->rowCount()); - pThis->loadBookmarks(); -} - -void PlacesModel::updateIcons() { - // the icon theme is changed and we need to update the icons - PlacesModelItem* item; - int row; - int n = placesRoot->rowCount(); - for(row = 0; row < n; ++row) { - item = static_cast(placesRoot->child(row)); - item->updateIcon(); - } - n = devicesRoot->rowCount(); - for(row = 0; row < n; ++row) { - item = static_cast(devicesRoot->child(row)); - item->updateIcon(); - } -} - -Qt::ItemFlags PlacesModel::flags(const QModelIndex& index) const { - if(index.column() == 1) // make 2nd column of every row selectable. - return Qt::ItemIsSelectable | Qt::ItemIsEnabled; - if(!index.parent().isValid()) { // root items - if(index.row() == 2) // bookmarks root - return Qt::ItemIsEnabled | Qt::ItemIsDropEnabled; - else - return Qt::ItemIsEnabled; - } - return QStandardItemModel::flags(index); -} - -bool PlacesModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) { - QStandardItem* item = itemFromIndex(parent); - if(data->hasFormat("application/x-bookmark-row")) { // the data being dopped is a bookmark row - // decode it and do bookmark reordering - QByteArray buf = data->data("application/x-bookmark-row"); - QDataStream stream(&buf, QIODevice::ReadOnly); - int oldPos = -1; - char* pathStr = NULL; - stream >> oldPos >> pathStr; - // find the source bookmark item being dragged - GList* allBookmarks = fm_bookmarks_get_all(bookmarks); - FmBookmarkItem* draggedItem = static_cast(g_list_nth_data(allBookmarks, oldPos)); - // If we cannot find the dragged bookmark item at position , or we find an item, - // but the path of the item is not the same as what we expected, than it's the wrong item. - // This means that the bookmarks are changed during our dnd processing, which is an extremely rare case. - if(!draggedItem || !fm_path_equal_str(draggedItem->path, pathStr, -1)) { - delete []pathStr; - return false; - } - delete []pathStr; - - int newPos = -1; - if(row == -1 && column == -1) { // drop on an item - // we only allow dropping on an bookmark item - if(item && item->parent() == bookmarksRoot) - newPos = parent.row(); - } - else { // drop on a position between items - if(item == bookmarksRoot) // we only allow dropping on a bookmark item - newPos = row; - } - if(newPos != -1 && newPos != oldPos) // reorder the bookmark item - fm_bookmarks_reorder(bookmarks, draggedItem, newPos); - } - else if(data->hasUrls()) { // files uris are dropped - if(row == -1 && column == -1) { // drop uris on an item - if(item && item->parent()) { // need to be a child item - PlacesModelItem* placesItem = static_cast(item); - if(placesItem->path()) { - qDebug() << "dropped dest:" << placesItem->text(); - // TODO: copy or move the dragged files to the dir pointed by the item. - qDebug() << "drop on" << item->text(); - } - } - } - else { // drop uris on a position between items - if(item == bookmarksRoot) { // we only allow dropping on blank row of bookmarks section - FmPathList* paths = pathListFromQUrls(data->urls()); - for(GList* l = fm_path_list_peek_head_link(paths); l; l = l->next) { - FmPath* path = FM_PATH(l->data); - GFile* gf = fm_path_to_gfile(path); - // FIXME: this is a blocking call - if(g_file_query_file_type(gf, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, - NULL) == G_FILE_TYPE_DIRECTORY) { - char* disp_name = fm_path_display_basename(path); - fm_bookmarks_insert(bookmarks, path, disp_name, row); - g_free(disp_name); - } - g_object_unref(gf); - return true; - } - } - } - } - return false; -} - -// we only support dragging bookmark items and use our own -// custom pseudo-mime-type: application/x-bookmark-row -QMimeData* PlacesModel::mimeData(const QModelIndexList& indexes) const { - if(!indexes.isEmpty()) { - // we only allow dragging one bookmark item at a time, so handle the first index only. - QModelIndex index = indexes.first(); - QStandardItem* item = itemFromIndex(index); - // ensure that it's really a bookmark item - if(item && item->parent() == bookmarksRoot) { - PlacesModelBookmarkItem* bookmarkItem = static_cast(item); - QMimeData* mime = new QMimeData(); - QByteArray data; - QDataStream stream(&data, QIODevice::WriteOnly); - // There is no safe and cross-process way to store a reference of a row. - // Let's store the pos, name, and path of the bookmark item instead. - char* pathStr = fm_path_to_str(bookmarkItem->path()); - stream << index.row() << pathStr; - g_free(pathStr); - mime->setData("application/x-bookmark-row", data); - return mime; - } - } - return NULL; -} - -QStringList PlacesModel::mimeTypes() const { - return QStringList() << "application/x-bookmark-row" << "text/uri-list"; -} - -Qt::DropActions PlacesModel::supportedDropActions() const { - return QStandardItemModel::supportedDropActions(); -} - diff --git a/libfm-qt/placesmodel.h b/libfm-qt/placesmodel.h deleted file mode 100644 index 6a6cc2a..0000000 --- a/libfm-qt/placesmodel.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_PLACESMODEL_H -#define FM_PLACESMODEL_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include - -namespace Fm { - -class PlacesModelItem; -class PlacesModelVolumeItem; -class PlacesModelMountItem; -class PlacesModelBookmarkItem; - -class LIBFM_QT_API PlacesModel : public QStandardItemModel { -Q_OBJECT -friend class PlacesView; -public: - - // QAction used for popup menus - class ItemAction : public QAction { - public: - ItemAction(const QModelIndex& index, QString text, QObject* parent = 0): - QAction(text, parent), - index_(index) { - } - - QPersistentModelIndex& index() { - return index_; - } - private: - QPersistentModelIndex index_; - }; - -public: - explicit PlacesModel(QObject* parent = 0); - virtual ~PlacesModel(); - - bool showTrash() { - return trashItem_ != NULL; - } - void setShowTrash(bool show); - - bool showApplications() { - return showApplications_; - } - void setShowApplications(bool show); - - bool showDesktop() { - return showDesktop_; - } - void setShowDesktop(bool show); - -public Q_SLOTS: - void updateIcons(); - void updateTrash(); - -protected: - - PlacesModelItem* itemFromPath(FmPath* path); - PlacesModelItem* itemFromPath(QStandardItem* rootItem, FmPath* path); - PlacesModelVolumeItem* itemFromVolume(GVolume* volume); - PlacesModelMountItem* itemFromMount(GMount* mount); - PlacesModelBookmarkItem* itemFromBookmark(FmBookmarkItem* bkitem); - - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - virtual QStringList mimeTypes() const; - virtual QMimeData* mimeData(const QModelIndexList& indexes) const; - virtual bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent); - Qt::DropActions supportedDropActions() const; - - void createTrashItem(); - -private: - void loadBookmarks(); - - static void onVolumeAdded(GVolumeMonitor* monitor, GVolume* volume, PlacesModel* pThis); - static void onVolumeRemoved(GVolumeMonitor* monitor, GVolume* volume, PlacesModel* pThis); - static void onVolumeChanged(GVolumeMonitor* monitor, GVolume* volume, PlacesModel* pThis); - static void onMountAdded(GVolumeMonitor* monitor, GMount* mount, PlacesModel* pThis); - static void onMountRemoved(GVolumeMonitor* monitor, GMount* mount, PlacesModel* pThis); - static void onMountChanged(GVolumeMonitor* monitor, GMount* mount, PlacesModel* pThis); - - static void onBookmarksChanged(FmBookmarks* bookmarks, PlacesModel* pThis); - - static void onTrashChanged(GFileMonitor *monitor, GFile *gf, GFile *other, GFileMonitorEvent evt, PlacesModel* pThis); -private: - FmBookmarks* bookmarks; - GVolumeMonitor* volumeMonitor; - QList jobs; - bool showApplications_; - bool showDesktop_; - QStandardItem* placesRoot; - QStandardItem* devicesRoot; - QStandardItem* bookmarksRoot; - PlacesModelItem* trashItem_; - GFileMonitor* trashMonitor_; - PlacesModelItem* desktopItem; - PlacesModelItem* homeItem; - PlacesModelItem* computerItem; - PlacesModelItem* networkItem; - PlacesModelItem* applicationsItem; - QIcon ejectIcon_; -}; - -} - -#endif // FM_PLACESMODEL_H diff --git a/libfm-qt/placesmodelitem.cpp b/libfm-qt/placesmodelitem.cpp deleted file mode 100644 index cb999e3..0000000 --- a/libfm-qt/placesmodelitem.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "placesmodelitem.h" -#include "icontheme.h" -#include - -namespace Fm { - -PlacesModelItem::PlacesModelItem(): - QStandardItem(), - path_(NULL), - icon_(NULL), - fileInfo_(NULL) { -} - -PlacesModelItem::PlacesModelItem(const char* iconName, QString title, FmPath* path): - QStandardItem(title), - path_(path ? fm_path_ref(path) : NULL), - icon_(fm_icon_from_name(iconName)), - fileInfo_(NULL) { - if(icon_) - QStandardItem::setIcon(IconTheme::icon(icon_)); - setEditable(false); -} - -PlacesModelItem::PlacesModelItem(FmIcon* icon, QString title, FmPath* path): - QStandardItem(title), - path_(path ? fm_path_ref(path) : NULL), - icon_(icon ? fm_icon_ref(icon) : NULL), - fileInfo_(NULL) { - if(icon_) - QStandardItem::setIcon(IconTheme::icon(icon)); - setEditable(false); -} - -PlacesModelItem::PlacesModelItem(QIcon icon, QString title, FmPath* path): - QStandardItem(icon, title), - icon_(NULL), - path_(path ? fm_path_ref(path) : NULL), - fileInfo_(NULL) { - setEditable(false); -} - -PlacesModelItem::~PlacesModelItem() { - if(path_) - fm_path_unref(path_); - if(fileInfo_) - g_object_unref(fileInfo_); - if(icon_) - fm_icon_unref(icon_); -} - -void PlacesModelItem::setPath(FmPath* path) { - if(path_) - fm_path_unref(path_); - path_ = path ? fm_path_ref(path) : NULL; -} - -void PlacesModelItem::setIcon(FmIcon* icon) { - if(icon_) - fm_icon_unref(icon_); - if(icon) { - icon_ = fm_icon_ref(icon); - QStandardItem::setIcon(IconTheme::icon(icon_)); - } - else { - icon_ = NULL; - QStandardItem::setIcon(QIcon()); - } -} - -void PlacesModelItem::setIcon(GIcon* gicon) { - FmIcon* icon = gicon ? fm_icon_from_gicon(gicon) : NULL; - setIcon(icon); - fm_icon_unref(icon); -} - -void PlacesModelItem::updateIcon() { - if(icon_) - QStandardItem::setIcon(IconTheme::icon(icon_)); -} - -QVariant PlacesModelItem::data(int role) const { - // we use a QPixmap from FmIcon cache rather than QIcon object for decoration role. - return QStandardItem::data(role); -} - -void PlacesModelItem::setFileInfo(FmFileInfo* fileInfo) { - // FIXME: how can we correctly update icon? - if(fileInfo_) - fm_file_info_unref(fileInfo_); - - if(fileInfo) { - fileInfo_ = fm_file_info_ref(fileInfo); - } - else - fileInfo_ = NULL; -} - -PlacesModelBookmarkItem::PlacesModelBookmarkItem(FmBookmarkItem* bm_item): - PlacesModelItem(QIcon::fromTheme("folder"), QString::fromUtf8(bm_item->name), bm_item->path), - bookmarkItem_(fm_bookmark_item_ref(bm_item)) { - setEditable(true); -} - -PlacesModelVolumeItem::PlacesModelVolumeItem(GVolume* volume): - PlacesModelItem(), - volume_(reinterpret_cast(g_object_ref(volume))) { - update(); - setEditable(false); -} - -void PlacesModelVolumeItem::update() { - // set title - char* volumeName = g_volume_get_name(volume_); - setText(QString::fromUtf8(volumeName)); - g_free(volumeName); - - // set icon - GIcon* gicon = g_volume_get_icon(volume_); - setIcon(gicon); - g_object_unref(gicon); - - // set dir path - GMount* mount = g_volume_get_mount(volume_); - if(mount) { - GFile* mount_root = g_mount_get_root(mount); - FmPath* mount_path = fm_path_new_for_gfile(mount_root); - setPath(mount_path); - fm_path_unref(mount_path); - g_object_unref(mount_root); - g_object_unref(mount); - } - else { - setPath(NULL); - } -} - - -bool PlacesModelVolumeItem::isMounted() { - GMount* mount = g_volume_get_mount(volume_); - if(mount) - g_object_unref(mount); - return mount != NULL ? true : false; -} - - -PlacesModelMountItem::PlacesModelMountItem(GMount* mount): - PlacesModelItem(), - mount_(reinterpret_cast(mount)) { - update(); - setEditable(false); -} - -void PlacesModelMountItem::update() { - // set title - setText(QString::fromUtf8(g_mount_get_name(mount_))); - - // set path - GFile* mount_root = g_mount_get_root(mount_); - FmPath* mount_path = fm_path_new_for_gfile(mount_root); - setPath(mount_path); - fm_path_unref(mount_path); - g_object_unref(mount_root); - - // set icon - GIcon* gicon = g_mount_get_icon(mount_); - setIcon(gicon); - g_object_unref(gicon); -} - -} diff --git a/libfm-qt/placesmodelitem.h b/libfm-qt/placesmodelitem.h deleted file mode 100644 index 7f07661..0000000 --- a/libfm-qt/placesmodelitem.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_PLACESMODELITEM_H -#define FM_PLACESMODELITEM_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include - -namespace Fm { - -// model item -class LIBFM_QT_API PlacesModelItem : public QStandardItem { -public: - enum Type { - Places = QStandardItem::UserType + 1, - Volume, - Mount, - Bookmark - }; - -public: - PlacesModelItem(); - PlacesModelItem(QIcon icon, QString title, FmPath* path = NULL); - PlacesModelItem(const char* iconName, QString title, FmPath* path = NULL); - PlacesModelItem(FmIcon* icon, QString title, FmPath* path = NULL); - ~PlacesModelItem(); - - FmFileInfo* fileInfo() { - return fileInfo_; - } - void setFileInfo(FmFileInfo* fileInfo); - - FmPath* path() { - return path_; - } - void setPath(FmPath* path); - - FmIcon* icon() { - return icon_; - } - void setIcon(FmIcon* icon); - void setIcon(GIcon* gicon); - void updateIcon(); - - QVariant data(int role = Qt::UserRole + 1) const; - - virtual int type() const { - return Places; - } - -private: - FmPath* path_; - FmFileInfo* fileInfo_; - FmIcon* icon_; -}; - -class LIBFM_QT_API PlacesModelVolumeItem : public PlacesModelItem { -public: - PlacesModelVolumeItem(GVolume* volume); - bool isMounted(); - bool canEject() { - return g_volume_can_eject(volume_); - } - virtual int type() const { - return Volume; - } - GVolume* volume() { - return volume_; - } - void update(); -private: - GVolume* volume_; -}; - -class LIBFM_QT_API PlacesModelMountItem : public PlacesModelItem { -public: - PlacesModelMountItem(GMount* mount); - virtual int type() const { - return Mount; - } - GMount* mount() const { - return mount_; - } - void update(); -private: - GMount* mount_; -}; - -class LIBFM_QT_API PlacesModelBookmarkItem : public PlacesModelItem { -public: - virtual int type() const { - return Bookmark; - } - PlacesModelBookmarkItem(FmBookmarkItem* bm_item); - virtual ~PlacesModelBookmarkItem() { - if(bookmarkItem_) - fm_bookmark_item_unref(bookmarkItem_); - } - FmBookmarkItem* bookmark() const { - return bookmarkItem_; - } -private: - FmBookmarkItem* bookmarkItem_; -}; - -} - -#endif // FM_PLACESMODELITEM_H diff --git a/libfm-qt/placesview.cpp b/libfm-qt/placesview.cpp deleted file mode 100644 index 0f880f0..0000000 --- a/libfm-qt/placesview.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "placesview.h" -#include "placesmodel.h" -#include "placesmodelitem.h" -#include "mountoperation.h" -#include "fileoperation.h" -#include -#include -#include -#include -#include - -using namespace Fm; - -PlacesView::PlacesView(QWidget* parent): - QTreeView(parent), - currentPath_(NULL) { - setRootIsDecorated(false); - setHeaderHidden(true); - setIndentation(12); - - connect(this, &QTreeView::clicked, this, &PlacesView::onClicked); - connect(this, &QTreeView::pressed, this, &PlacesView::onPressed); - - setIconSize(QSize(24, 24)); - - // FIXME: we may share this model amont all views - model_ = new PlacesModel(this); - setModel(model_); - - QHeaderView* headerView = header(); - headerView->setSectionResizeMode(0, QHeaderView::Stretch); - headerView->setSectionResizeMode(1, QHeaderView::Fixed); - headerView->setStretchLastSection(false); - expandAll(); - - // FIXME: is there any better way to make the first column span the whole row? - setFirstColumnSpanned(0, QModelIndex(), true); // places root - setFirstColumnSpanned(1, QModelIndex(), true); // devices root - setFirstColumnSpanned(2, QModelIndex(), true); // bookmarks root - - // the 2nd column is for the eject buttons - setSelectionBehavior(QAbstractItemView::SelectRows); // FIXME: why this does not work? - setAllColumnsShowFocus(false); - - setAcceptDrops(true); - setDragEnabled(true); - - // update the umount button's column width based on icon size - onIconSizeChanged(iconSize()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) // this signal requires Qt >= 5.5 - connect(this, &QAbstractItemView::iconSizeChanged, this, &PlacesView::onIconSizeChanged); -#endif -} - -PlacesView::~PlacesView() { - if(currentPath_) - fm_path_unref(currentPath_); - // qDebug("delete PlacesView"); -} - -void PlacesView::activateRow(int type, const QModelIndex& index) { - if(!index.parent().isValid()) // ignore root items - return; - PlacesModelItem* item = static_cast(model_->itemFromIndex(index)); - if(item) { - FmPath* path = item->path(); - if(!path) { - // check if mounting volumes is needed - if(item->type() == PlacesModelItem::Volume) { - PlacesModelVolumeItem* volumeItem = static_cast(item); - if(!volumeItem->isMounted()) { - // Mount the volume - GVolume* volume = volumeItem->volume(); - MountOperation* op = new MountOperation(true, this); - op->mount(volume); - // connect(op, SIGNAL(finished(GError*)), SLOT(onMountOperationFinished(GError*))); - // blocking here until the mount operation is finished? - - // FIXME: update status of the volume after mount is finished!! - if(!op->wait()) - return; - path = item->path(); - } - } - } - if(path) { - Q_EMIT chdirRequested(type, path); - } - } -} - -// mouse button pressed -void PlacesView::onPressed(const QModelIndex& index) { - // if middle button is pressed - if(QGuiApplication::mouseButtons() & Qt::MiddleButton) { - // the real item is at column 0 - activateRow(1, 0 == index.column() ? index : index.sibling(index.row(), 0)); - } -} - -void PlacesView::onIconSizeChanged(const QSize& size) { - setColumnWidth(1, size.width() + 5); -} - -void PlacesView::onEjectButtonClicked(PlacesModelItem* item) { - // The eject button is clicked for a device item (volume or mount) - if(item->type() == PlacesModelItem::Volume) { - PlacesModelVolumeItem* volumeItem = static_cast(item); - MountOperation* op = new MountOperation(true, this); - if(volumeItem->canEject()) // do eject if applicable - op->eject(volumeItem->volume()); - else // otherwise, do unmount instead - op->unmount(volumeItem->volume()); - } - else if(item->type() == PlacesModelItem::Mount) { - PlacesModelMountItem* mountItem = static_cast(item); - MountOperation* op = new MountOperation(true, this); - op->unmount(mountItem->mount()); - } - qDebug("PlacesView::onEjectButtonClicked"); -} - -void PlacesView::onClicked(const QModelIndex& index) { - if(!index.parent().isValid()) // ignore root items - return; - - if(index.column() == 0) { - activateRow(0, index); - } - else if(index.column() == 1) { // column 1 contains eject buttons of the mounted devices - if(index.parent() == model_->devicesRoot->index()) { // this is a mounted device - // the eject button is clicked - QModelIndex itemIndex = index.sibling(index.row(), 0); // the real item is at column 0 - PlacesModelItem* item = static_cast(model_->itemFromIndex(itemIndex)); - if(item) { - // eject the volume or the mount - onEjectButtonClicked(item); - } - } - else - activateRow(0, index.sibling(index.row(), 0)); - } -} - -void PlacesView::setCurrentPath(FmPath* path) { - if(currentPath_) - fm_path_unref(currentPath_); - if(path) { - currentPath_ = fm_path_ref(path); - // TODO: search for item with the path in model_ and select it. - PlacesModelItem* item = model_->itemFromPath(currentPath_); - if(item) { - selectionModel()->select(item->index(), QItemSelectionModel::SelectCurrent|QItemSelectionModel::Rows); - } - else - clearSelection(); - } - else { - currentPath_ = NULL; - clearSelection(); - } -} - - -void PlacesView::dragMoveEvent(QDragMoveEvent* event) { - QTreeView::dragMoveEvent(event); - /* - QModelIndex index = indexAt(event->pos()); - if(event->isAccepted() && index.isValid() && index.parent() == model_->bookmarksRoot->index()) { - if(dropIndicatorPosition() != OnItem) { - event->setDropAction(Qt::LinkAction); - event->accept(); - } - } - */ -} - -void PlacesView::dropEvent(QDropEvent* event) { - QTreeView::dropEvent(event); -} - -void PlacesView::onEmptyTrash() { - FmPathList* files = fm_path_list_new(); - fm_path_list_push_tail(files, fm_path_get_trash()); - Fm::FileOperation::deleteFiles(files); - fm_path_list_unref(files); -} - -void PlacesView::onMoveBookmarkUp() -{ - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelBookmarkItem* item = static_cast(model_->itemFromIndex(action->index())); - - int row = item->row(); - if(row > 0) { - FmBookmarkItem* bookmarkItem = item->bookmark(); - FmBookmarks* bookmarks = fm_bookmarks_dup(); - fm_bookmarks_reorder(bookmarks, bookmarkItem, row - 1); - g_object_unref(bookmarks); - } -} - -void PlacesView::onMoveBookmarkDown() -{ - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelBookmarkItem* item = static_cast(model_->itemFromIndex(action->index())); - - int row = item->row(); - if(row < model_->rowCount()) { - FmBookmarkItem* bookmarkItem = item->bookmark(); - FmBookmarks* bookmarks = fm_bookmarks_dup(); - fm_bookmarks_reorder(bookmarks, bookmarkItem, row + 1); - g_object_unref(bookmarks); - } -} - -void PlacesView::onDeleteBookmark() { - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelBookmarkItem* item = static_cast(model_->itemFromIndex(action->index())); - FmBookmarkItem* bookmarkItem = item->bookmark(); - FmBookmarks* bookmarks = fm_bookmarks_dup(); - fm_bookmarks_remove(bookmarks, bookmarkItem); - g_object_unref(bookmarks); -} - -// virtual -void PlacesView::commitData(QWidget * editor) { - QTreeView::commitData(editor); - PlacesModelBookmarkItem* item = static_cast(model_->itemFromIndex(currentIndex())); - FmBookmarkItem* bookmarkItem = item->bookmark(); - FmBookmarks* bookmarks = fm_bookmarks_dup(); - // rename bookmark - fm_bookmarks_rename(bookmarks, bookmarkItem, item->text().toUtf8().constData()); - g_object_unref(bookmarks); -} - -void PlacesView::onOpenNewTab() -{ - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelItem* item = static_cast(model_->itemFromIndex(action->index())); - if(item) - Q_EMIT chdirRequested(1, item->path()); -} - -void PlacesView::onOpenNewWindow() -{ - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelItem* item = static_cast(model_->itemFromIndex(action->index())); - if(item) - Q_EMIT chdirRequested(2, item->path()); -} - -void PlacesView::onRenameBookmark() { - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelBookmarkItem* item = static_cast(model_->itemFromIndex(action->index())); - setFocus(); - setCurrentIndex(item->index()); - edit(item->index()); -} - -void PlacesView::onMountVolume() { - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelVolumeItem* item = static_cast(model_->itemFromIndex(action->index())); - MountOperation* op = new MountOperation(true, this); - op->mount(item->volume()); - op->wait(); -} - -void PlacesView::onUnmountVolume() { - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelVolumeItem* item = static_cast(model_->itemFromIndex(action->index())); - MountOperation* op = new MountOperation(true, this); - op->unmount(item->volume()); - op->wait(); -} - -void PlacesView::onUnmountMount() { - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelMountItem* item = static_cast(model_->itemFromIndex(action->index())); - GMount* mount = item->mount(); - MountOperation* op = new MountOperation(true, this); - op->unmount(mount); - op->wait(); -} - -void PlacesView::onEjectVolume() { - PlacesModel::ItemAction* action = static_cast(sender()); - if(!action->index().isValid()) - return; - PlacesModelVolumeItem* item = static_cast(model_->itemFromIndex(action->index())); - MountOperation* op = new MountOperation(true, this); - op->eject(item->volume()); - op->wait(); -} - -void PlacesView::contextMenuEvent(QContextMenuEvent* event) { - QModelIndex index = indexAt(event->pos()); - if(index.isValid() && index.parent().isValid()) { - if(index.column() != 0) // the real item is at column 0 - index = index.sibling(index.row(), 0); - QMenu* menu = new QMenu(this); - QAction* action; - PlacesModelItem* item = static_cast(model_->itemFromIndex(index)); - - if(item->type() != PlacesModelItem::Mount - && (item->type() != PlacesModelItem::Volume - || static_cast(item)->isMounted())) { - action = new PlacesModel::ItemAction(item->index(), tr("Open in New Tab"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onOpenNewTab); - menu->addAction(action); - action = new PlacesModel::ItemAction(item->index(), tr("Open in New Window"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onOpenNewWindow); - menu->addAction(action); - } - - switch(item->type()) { - case PlacesModelItem::Places: { - FmPath* path = item->path(); - if(path && fm_path_equal(fm_path_get_trash(), path)) { - action = new PlacesModel::ItemAction(item->index(), tr("Empty Trash"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onEmptyTrash); - menu->addAction(action); - } - break; - } - case PlacesModelItem::Bookmark: { - // create context menu for bookmark item - if(item->index().row() > 0) { - action = new PlacesModel::ItemAction(item->index(), tr("Move Bookmark Up"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onMoveBookmarkUp); - menu->addAction(action); - } - if(item->index().row() < model_->rowCount()) { - action = new PlacesModel::ItemAction(item->index(), tr("Move Bookmark Down"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onMoveBookmarkDown); - menu->addAction(action); - } - action = new PlacesModel::ItemAction(item->index(), tr("Rename Bookmark"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onRenameBookmark); - menu->addAction(action); - action = new PlacesModel::ItemAction(item->index(), tr("Remove Bookmark"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onDeleteBookmark); - menu->addAction(action); - break; - } - case PlacesModelItem::Volume: { - PlacesModelVolumeItem* volumeItem = static_cast(item); - - if(volumeItem->isMounted()) { - action = new PlacesModel::ItemAction(item->index(), tr("Unmount"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onUnmountVolume); - } - else { - action = new PlacesModel::ItemAction(item->index(), tr("Mount"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onMountVolume); - } - menu->addAction(action); - - if(volumeItem->canEject()) { - action = new PlacesModel::ItemAction(item->index(), tr("Eject"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onEjectVolume); - menu->addAction(action); - } - break; - } - case PlacesModelItem::Mount: { - action = new PlacesModel::ItemAction(item->index(), tr("Unmount"), menu); - connect(action, &QAction::triggered, this, &PlacesView::onUnmountMount); - menu->addAction(action); - break; - } - } - if(menu->actions().size()) { - menu->popup(mapToGlobal(event->pos())); - connect(menu, &QMenu::aboutToHide, menu, &QMenu::deleteLater); - } else { - menu->deleteLater(); - } - } -} diff --git a/libfm-qt/placesview.h b/libfm-qt/placesview.h deleted file mode 100644 index c129d42..0000000 --- a/libfm-qt/placesview.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - 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 FM_PLACESVIEW_H -#define FM_PLACESVIEW_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Fm { - -class PlacesModel; -class PlacesModelItem; - -class LIBFM_QT_API PlacesView : public QTreeView { -Q_OBJECT - -public: - explicit PlacesView(QWidget* parent = 0); - virtual ~PlacesView(); - - void setCurrentPath(FmPath* path); - FmPath* currentPath() { - return currentPath_; - } - - // libfm-gtk compatible alias - FmPath* getCwd() { - return currentPath(); - } - - void chdir(FmPath* path) { - setCurrentPath(path); - } - -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - void setIconSize(const QSize &size) { - // The signal QAbstractItemView::iconSizeChanged is only available after Qt 5.5. - // To simulate the effect for older Qt versions, we override setIconSize(). - QAbstractItemView::setIconSize(size); - onIconSizeChanged(size); - } -#endif - -Q_SIGNALS: - void chdirRequested(int type, FmPath* path); - -protected Q_SLOTS: - void onClicked(const QModelIndex & index); - void onPressed(const QModelIndex & index); - void onIconSizeChanged(const QSize & size); - // void onMountOperationFinished(GError* error); - - void onOpenNewTab(); - void onOpenNewWindow(); - - void onEmptyTrash(); - - void onMountVolume(); - void onUnmountVolume(); - void onEjectVolume(); - void onUnmountMount(); - - void onMoveBookmarkUp(); - void onMoveBookmarkDown(); - void onDeleteBookmark(); - void onRenameBookmark(); - -protected: - void drawBranches ( QPainter * painter, const QRect & rect, const QModelIndex & index ) const { - // override this method to inhibit drawing of the branch grid lines by Qt. - } - - virtual void dragMoveEvent(QDragMoveEvent* event); - virtual void dropEvent(QDropEvent* event); - virtual void contextMenuEvent(QContextMenuEvent* event); - - virtual void commitData(QWidget * editor); - -private: - void onEjectButtonClicked(PlacesModelItem* item); - void activateRow(int type, const QModelIndex& index); - -private: - PlacesModel* model_; - FmPath* currentPath_; -}; - -} - -#endif // FM_PLACESVIEW_H diff --git a/libfm-qt/proxyfoldermodel.cpp b/libfm-qt/proxyfoldermodel.cpp deleted file mode 100644 index 4c7538b..0000000 --- a/libfm-qt/proxyfoldermodel.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#include "proxyfoldermodel.h" -#include "foldermodel.h" -#include - -using namespace Fm; - -ProxyFolderModel::ProxyFolderModel(QObject * parent): - QSortFilterProxyModel(parent), - thumbnailSize_(0), - showHidden_(false), - showThumbnails_(false), - folderFirst_(true) { - setDynamicSortFilter(true); - setSortCaseSensitivity(Qt::CaseInsensitive); -} - -ProxyFolderModel::~ProxyFolderModel() { - qDebug("delete ProxyFolderModel"); - - if(showThumbnails_ && thumbnailSize_ != 0) { - FolderModel* srcModel = static_cast(sourceModel()); - // tell the source model that we don't need the thumnails anymore - if(srcModel) { - srcModel->releaseThumbnails(thumbnailSize_); - disconnect(srcModel, SIGNAL(thumbnailLoaded(QModelIndex,int))); - } - } -} - -void ProxyFolderModel::setSourceModel(QAbstractItemModel* model) { - if(model) { - // we only support Fm::FolderModel - Q_ASSERT(model->inherits("Fm::FolderModel")); - - if(showThumbnails_ && thumbnailSize_ != 0) { // if we're showing thumbnails - FolderModel* oldSrcModel = static_cast(sourceModel()); - FolderModel* newSrcModel = static_cast(model); - if(oldSrcModel) { // we need to release cached thumbnails for the old source model - oldSrcModel->releaseThumbnails(thumbnailSize_); - disconnect(oldSrcModel, SIGNAL(thumbnailLoaded(QModelIndex,int))); - } - if(newSrcModel) { // tell the new source model that we want thumbnails of this size - newSrcModel->cacheThumbnails(thumbnailSize_); - connect(newSrcModel, &FolderModel::thumbnailLoaded, this, &ProxyFolderModel::onThumbnailLoaded); - } - } - } - QSortFilterProxyModel::setSourceModel(model); -} - -void ProxyFolderModel::sort(int column, Qt::SortOrder order) { - int oldColumn = sortColumn(); - Qt::SortOrder oldOrder = sortOrder(); - QSortFilterProxyModel::sort(column, order); - if(column != oldColumn || order != oldOrder) { - Q_EMIT sortFilterChanged(); - } -} - -void ProxyFolderModel::setShowHidden(bool show) { - if(show != showHidden_) { - showHidden_ = show; - invalidateFilter(); - Q_EMIT sortFilterChanged(); - } -} - -// need to call invalidateFilter() manually. -void ProxyFolderModel::setFolderFirst(bool folderFirst) { - if(folderFirst != folderFirst_) { - folderFirst_ = folderFirst; - invalidate(); - Q_EMIT sortFilterChanged(); - } -} - -bool ProxyFolderModel::filterAcceptsRow(int source_row, const QModelIndex & source_parent) const { - if(!showHidden_) { - QAbstractItemModel* srcModel = sourceModel(); - QString name = srcModel->data(srcModel->index(source_row, 0, source_parent)).toString(); - if(name.startsWith(".") || name.endsWith("~")) - return false; - } - // apply additional filters if there're any - Q_FOREACH(ProxyFolderModelFilter* filter, filters_) { - FolderModel* srcModel = static_cast(sourceModel()); - FmFileInfo* fileInfo = srcModel->fileInfoFromIndex(srcModel->index(source_row, 0, source_parent)); - if(!filter->filterAcceptsRow(this, fileInfo)) - return false; - } - return true; -} - -bool ProxyFolderModel::lessThan(const QModelIndex& left, const QModelIndex& right) const { - FolderModel* srcModel = static_cast(sourceModel()); - // left and right are indexes of source model, not the proxy model. - if(srcModel) { - FmFileInfo* leftInfo = srcModel->fileInfoFromIndex(left); - FmFileInfo* rightInfo = srcModel->fileInfoFromIndex(right); - - if(Q_UNLIKELY(!leftInfo || !rightInfo)) { - // In theory, this should not happen, but it's safer to add the null check. - // This is reported in https://github.com/lxde/pcmanfm-qt/issues/205 - return false; - } - - if(folderFirst_) { - bool leftIsFolder = (bool)fm_file_info_is_dir(leftInfo); - bool rightIsFolder = (bool)fm_file_info_is_dir(rightInfo); - if(leftIsFolder != rightIsFolder) - return sortOrder() == Qt::AscendingOrder ? leftIsFolder : rightIsFolder; - } - - switch(sortColumn()) { - case FolderModel::ColumnFileName: - if(sortCaseSensitivity() == Qt::CaseSensitive) { - // fm_file_info_get_collate_key_nocasefold() uses g_utf8_casefold() from glib internally, which - // is only an approximation not working correctly in some locales. - // FIXME: we may use QCollator (since Qt 5.2) for this, but the performance impact is unknown - return strcmp(fm_file_info_get_collate_key_nocasefold(leftInfo), fm_file_info_get_collate_key_nocasefold(rightInfo)) < 0; - /* - QCollator coll; - coll.setCaseSensitivity(Qt::CaseSensitive); - coll.setIgnorePunctuation(false); - coll.setNumericMode(true); - return coll.compare(QString::fromUtf8(fm_file_info_get_disp_name(leftInfo)), QString::fromUtf8(fm_file_info_get_disp_name(rightInfo))) < 0; - */ - } - else { - // linguistic case insensitive ordering - return strcmp(fm_file_info_get_collate_key(leftInfo), fm_file_info_get_collate_key(rightInfo)) < 0; - } - case FolderModel::ColumnFileMTime: - return fm_file_info_get_mtime(leftInfo) < fm_file_info_get_mtime(rightInfo); - case FolderModel::ColumnFileSize: - return fm_file_info_get_size(leftInfo) < fm_file_info_get_size(rightInfo); - case FolderModel::ColumnFileOwner: - // TODO: sort by owner - break; - case FolderModel::ColumnFileType: - break; - } - } - return QSortFilterProxyModel::lessThan(left, right); -} - -FmFileInfo* ProxyFolderModel::fileInfoFromIndex(const QModelIndex& index) const { - FolderModel* srcModel = static_cast(sourceModel()); - if(srcModel) { - QModelIndex srcIndex = mapToSource(index); - return srcModel->fileInfoFromIndex(srcIndex); - } - return NULL; -} - -void ProxyFolderModel::setShowThumbnails(bool show) { - if(show != showThumbnails_) { - showThumbnails_ = show; - FolderModel* srcModel = static_cast(sourceModel()); - if(srcModel && thumbnailSize_ != 0) { - if(show) { - // ask for cache of thumbnails of the new size in source model - srcModel->cacheThumbnails(thumbnailSize_); - // connect to the srcModel so we can be notified when a thumbnail is loaded. - connect(srcModel, &FolderModel::thumbnailLoaded, this, &ProxyFolderModel::onThumbnailLoaded); - } - else { // turn off thumbnails - // free cached old thumbnails in souce model - srcModel->releaseThumbnails(thumbnailSize_); - disconnect(srcModel, SIGNAL(thumbnailLoaded(QModelIndex,int))); - } - // reload all items, FIXME: can we only update items previously having thumbnails - Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0)); - } - } -} - -void ProxyFolderModel::setThumbnailSize(int size) { - if(size != thumbnailSize_) { - FolderModel* srcModel = static_cast(sourceModel()); - if(showThumbnails_ && srcModel) { - // free cached thumbnails of the old size - if(thumbnailSize_ != 0) - srcModel->releaseThumbnails(thumbnailSize_); - else { - // if the old thumbnail size is 0, we did not turn on thumbnail initially - connect(srcModel, &FolderModel::thumbnailLoaded, this, &ProxyFolderModel::onThumbnailLoaded); - } - // ask for cache of thumbnails of the new size in source model - srcModel->cacheThumbnails(size); - // reload all items, FIXME: can we only update items previously having thumbnails - Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0)); - } - - thumbnailSize_ = size; - } -} - -QVariant ProxyFolderModel::data(const QModelIndex& index, int role) const { - if(index.column() == 0) { // only show the decoration role for the first column - if(role == Qt::DecorationRole && showThumbnails_ && thumbnailSize_) { - // we need to show thumbnails instead of icons - FolderModel* srcModel = static_cast(sourceModel()); - QModelIndex srcIndex = mapToSource(index); - QImage image = srcModel->thumbnailFromIndex(srcIndex, thumbnailSize_); - if(!image.isNull()) // if we got a thumbnail of the desired size, use it - return QVariant(image); - } - } - // fallback to icons if thumbnails are not available - return QSortFilterProxyModel::data(index, role); -} - -void ProxyFolderModel::onThumbnailLoaded(const QModelIndex& srcIndex, int size) { - // FolderModel* srcModel = static_cast(sourceModel()); - // FolderModelItem* item = srcModel->itemFromIndex(srcIndex); - // qDebug("ProxyFolderModel::onThumbnailLoaded: %d, %s", size, item->displayName.toUtf8().data()); - - if(size == thumbnailSize_) { // if a thumbnail of the size we want is loaded - QModelIndex index = mapFromSource(srcIndex); - Q_EMIT dataChanged(index, index); - } -} - -void ProxyFolderModel::addFilter(ProxyFolderModelFilter* filter) { - filters_.append(filter); - invalidateFilter(); - Q_EMIT sortFilterChanged(); -} - -void ProxyFolderModel::removeFilter(ProxyFolderModelFilter* filter) { - filters_.removeOne(filter); - invalidateFilter(); - Q_EMIT sortFilterChanged(); -} - -void ProxyFolderModel::updateFilters() { - invalidate(); - Q_EMIT sortFilterChanged(); -} - -#if 0 -void ProxyFolderModel::reloadAllThumbnails() { - // reload all thumbnails and update UI - FolderModel* srcModel = static_cast(sourceModel()); - if(srcModel) { - int rows= rowCount(); - for(int row = 0; row < rows; ++row) { - QModelIndex index = this->index(row, 0); - QModelIndex srcIndex = mapToSource(index); - QImage image = srcModel->thumbnailFromIndex(srcIndex, size); - // tell the world that the item is changed to trigger a UI update - if(!image.isNull()) - Q_EMIT dataChanged(index, index); - } - } -} -#endif diff --git a/libfm-qt/proxyfoldermodel.h b/libfm-qt/proxyfoldermodel.h deleted file mode 100644 index 091fda0..0000000 --- a/libfm-qt/proxyfoldermodel.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - - Copyright (C) 2012 Hong Jen Yee (PCMan) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#ifndef FM_PROXYFOLDERMODEL_H -#define FM_PROXYFOLDERMODEL_H - -#include "libfmqtglobals.h" -#include -#include -#include - -namespace Fm { - -// a proxy model used to sort and filter FolderModel - -class FolderModelItem; -class ProxyFolderModel; - -class LIBFM_QT_API ProxyFolderModelFilter { -public: - virtual bool filterAcceptsRow(const ProxyFolderModel* model, FmFileInfo* info) const = 0; - virtual ~ProxyFolderModelFilter() {} -}; - - -class LIBFM_QT_API ProxyFolderModel : public QSortFilterProxyModel { - Q_OBJECT -public: - explicit ProxyFolderModel(QObject * parent = 0); - virtual ~ProxyFolderModel(); - - // only Fm::FolderModel is allowed for being sourceModel - virtual void setSourceModel(QAbstractItemModel* model); - - void setShowHidden(bool show); - bool showHidden() const { - return showHidden_; - } - - void setFolderFirst(bool folderFirst); - bool folderFirst() { - return folderFirst_; - } - - void setSortCaseSensitivity(Qt::CaseSensitivity cs) { - QSortFilterProxyModel::setSortCaseSensitivity(cs); - Q_EMIT sortFilterChanged(); - } - - bool showThumbnails() { - return showThumbnails_; - } - void setShowThumbnails(bool show); - - int thumbnailSize() { - return thumbnailSize_; - } - void setThumbnailSize(int size); - - FmFileInfo* fileInfoFromIndex(const QModelIndex& index) const; - - virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); - virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; - - void addFilter(ProxyFolderModelFilter* filter); - void removeFilter(ProxyFolderModelFilter* filter); - void updateFilters(); - -Q_SIGNALS: - void sortFilterChanged(); - -protected Q_SLOTS: - void onThumbnailLoaded(const QModelIndex& srcIndex, int size); - -protected: - bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const; - bool lessThan(const QModelIndex & left, const QModelIndex & right) const; - // void reloadAllThumbnails(); - -private: - -private: - bool showHidden_; - bool folderFirst_; - bool showThumbnails_; - int thumbnailSize_; - QList filters_; -}; - -} - -#endif // FM_PROXYFOLDERMODEL_H diff --git a/libfm-qt/rename-dialog.ui b/libfm-qt/rename-dialog.ui deleted file mode 100644 index 2b0c123..0000000 --- a/libfm-qt/rename-dialog.ui +++ /dev/null @@ -1,204 +0,0 @@ - - - RenameDialog - - - - 0 - 0 - 398 - 220 - - - - Confirm to replace files - - - false - - - - 6 - - - 10 - - - - - - 0 - 0 - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - - - - - - - 12 - - - 6 - - - - - - 0 - 0 - - - - dest - - - - - - - with the following file? - - - - - - - - 0 - 0 - - - - src file info - - - - - - - - 0 - 0 - - - - dest file info - - - - - - - - 0 - 0 - - - - src - - - - - - - - - 12 - - - - - - 0 - 0 - - - - &File name: - - - fileName - - - - - - - - - - - - Apply this option to all existing files - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ignore|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - RenameDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - RenameDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/libfm-qt/renamedialog.cpp b/libfm-qt/renamedialog.cpp deleted file mode 100644 index 99fa43a..0000000 --- a/libfm-qt/renamedialog.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "renamedialog.h" -#include "ui_rename-dialog.h" -#include -#include -#include "icontheme.h" - -using namespace Fm; - -RenameDialog::RenameDialog(FmFileInfo* src, FmFileInfo* dest, QWidget* parent, Qt::WindowFlags f): - QDialog(parent, f), - action_(ActionIgnore), - applyToAll_(false) { - - ui = new Ui::RenameDialog(); - ui->setupUi(this); - - FmPath* path = fm_file_info_get_path(dest); - FmIcon* srcIcon = fm_file_info_get_icon(src); - FmIcon* destIcon = fm_file_info_get_icon(dest); - - // show info for the source file - QIcon icon = IconTheme::icon(srcIcon); - QSize iconSize(fm_config->big_icon_size, fm_config->big_icon_size); - QPixmap pixmap = icon.pixmap(iconSize); - ui->srcIcon->setPixmap(pixmap); - - QString infoStr; - const char* disp_size = fm_file_info_get_disp_size(src); - if(disp_size) { - infoStr = QString(tr("Type: %1\nSize: %2\nModified: %3")) - .arg(QString::fromUtf8(fm_file_info_get_desc(src))) - .arg(QString::fromUtf8(disp_size)) - .arg(QString::fromUtf8(fm_file_info_get_disp_mtime(src))); - } - else { - infoStr = QString(tr("Type: %1\nModified: %2")) - .arg(QString::fromUtf8(fm_file_info_get_desc(src))) - .arg(QString::fromUtf8(fm_file_info_get_disp_mtime(src))); - } - ui->srcInfo->setText(infoStr); - - // show info for the dest file - icon = IconTheme::icon(destIcon); - pixmap = icon.pixmap(iconSize); - ui->destIcon->setPixmap(pixmap); - - disp_size = fm_file_info_get_disp_size(dest); - if(disp_size) { - infoStr = QString(tr("Type: %1\nSize: %2\nModified: %3")) - .arg(QString::fromUtf8(fm_file_info_get_desc(dest))) - .arg(QString::fromUtf8(disp_size)) - .arg(QString::fromUtf8(fm_file_info_get_disp_mtime(dest))); - } - else { - infoStr = QString(tr("Type: %1\nModified: %3")) - .arg(QString::fromUtf8(fm_file_info_get_desc(src))) - .arg(QString::fromUtf8(fm_file_info_get_disp_mtime(src))); - } - ui->destInfo->setText(infoStr); - - char* basename = fm_path_display_basename(path); - ui->fileName->setText(QString::fromUtf8(basename)); - oldName_ = basename; - g_free(basename); - connect(ui->fileName, &QLineEdit::textChanged, this, &RenameDialog::onFileNameChanged); - - // add "Rename" button - QAbstractButton* button = ui->buttonBox->button(QDialogButtonBox::Ok); - button->setText(tr("&Overwrite")); - // FIXME: there seems to be no way to place the Rename button next to the overwrite one. - renameButton_ = ui->buttonBox->addButton(tr("&Rename"), QDialogButtonBox::ActionRole); - connect(renameButton_, &QPushButton::clicked, this, &RenameDialog::onRenameClicked); - renameButton_->setEnabled(false); // disabled by default - - button = ui->buttonBox->button(QDialogButtonBox::Ignore); - connect(button, &QPushButton::clicked, this, &RenameDialog::onIgnoreClicked); -} - -RenameDialog::~RenameDialog() { - delete ui; -} - -void RenameDialog::onRenameClicked() { - action_ = ActionRename; - QDialog::done(QDialog::Accepted); -} - -void RenameDialog::onIgnoreClicked() { - action_ = ActionIgnore; -} - -// the overwrite button -void RenameDialog::accept() { - action_ = ActionOverwrite; - applyToAll_ = ui->applyToAll->isChecked(); - QDialog::accept(); -} - -// cancel, or close the dialog -void RenameDialog::reject() { - action_ = ActionCancel; - QDialog::reject(); -} - -void RenameDialog::onFileNameChanged(QString newName) { - newName_ = newName; - // FIXME: check if the name already exists in the current dir - bool hasNewName = (newName_ != oldName_); - renameButton_->setEnabled(hasNewName); - renameButton_->setDefault(hasNewName); - - // change default button to rename rather than overwrire - // if the user typed a new filename - QPushButton* overwriteButton = static_cast(ui->buttonBox->button(QDialogButtonBox::Ok)); - overwriteButton->setEnabled(!hasNewName); - overwriteButton->setDefault(!hasNewName); -} diff --git a/libfm-qt/renamedialog.h b/libfm-qt/renamedialog.h deleted file mode 100644 index df5a278..0000000 --- a/libfm-qt/renamedialog.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_RENAMEDIALOG_H -#define FM_RENAMEDIALOG_H - -#include "libfmqtglobals.h" -#include -#include - -namespace Ui { - class RenameDialog; -}; - -class QPushButton; - -namespace Fm { - -class LIBFM_QT_API RenameDialog : public QDialog { -Q_OBJECT - -public: - enum Action { - ActionCancel, - ActionRename, - ActionOverwrite, - ActionIgnore - }; - -public: - explicit RenameDialog(FmFileInfo* src, FmFileInfo* dest, QWidget* parent = 0, Qt::WindowFlags f = 0); - virtual ~RenameDialog(); - - Action action() { - return action_; - } - - bool applyToAll() { - return applyToAll_; - } - - QString newName() { - return newName_; - } - -protected Q_SLOTS: - void onRenameClicked(); - void onIgnoreClicked(); - void onFileNameChanged(QString newName); - -protected: - void accept(); - void reject(); - -private: - Ui::RenameDialog* ui; - QPushButton* renameButton_; - Action action_; - bool applyToAll_; - QString oldName_; - QString newName_; -}; - -} - -#endif // FM_RENAMEDIALOG_H diff --git a/libfm-qt/sidepane.cpp b/libfm-qt/sidepane.cpp deleted file mode 100644 index 25ed0c4..0000000 --- a/libfm-qt/sidepane.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "sidepane.h" -#include -#include -#include -#include "placesview.h" -#include "dirtreeview.h" -#include "dirtreemodel.h" -#include "path.h" -#include "filemenu.h" - -namespace Fm { - -SidePane::SidePane(QWidget* parent): - QWidget(parent), - showHidden_(false), - mode_(ModeNone), - view_(NULL), - combo_(NULL), - currentPath_(NULL), - iconSize_(24, 24) { - - verticalLayout = new QVBoxLayout(this); - verticalLayout->setContentsMargins(0, 0, 0, 0); - - combo_ = new QComboBox(this); - combo_->setFrame(false); - combo_->addItem(tr("Places")); - combo_->addItem(tr("Directory Tree")); - connect(combo_, static_cast(&QComboBox::currentIndexChanged), this, &SidePane::onComboCurrentIndexChanged); - verticalLayout->addWidget(combo_); -} - -SidePane::~SidePane() { - if(currentPath_) - fm_path_unref(currentPath_); - // qDebug("delete SidePane"); -} - -void SidePane::onPlacesViewChdirRequested(int type, FmPath* path) { - Q_EMIT chdirRequested(type, path); -} - -void SidePane::onDirTreeViewChdirRequested(int type, FmPath* path) { - Q_EMIT chdirRequested(type, path); -} - -void SidePane::onComboCurrentIndexChanged(int current) { - if(current != mode_) { - setMode(Mode(current)); - } -} - -void SidePane::setIconSize(QSize size) { - iconSize_ = size; - switch(mode_) { - case ModePlaces: - static_cast(view_)->setIconSize(size); - case ModeDirTree: - static_cast(view_)->setIconSize(size); - break; - default:; - } -} - -void SidePane::setCurrentPath(FmPath* path) { - Q_ASSERT(path != NULL); - if(currentPath_) - fm_path_unref(currentPath_); - currentPath_ = fm_path_ref(path); - switch(mode_) { - case ModePlaces: - static_cast(view_)->setCurrentPath(path); - break; - case ModeDirTree: - static_cast(view_)->setCurrentPath(path); - break; - default:; - } -} - -SidePane::Mode SidePane::modeByName(const char* str) { - if(str == NULL) - return ModeNone; - if(strcmp(str, "places") == 0) - return ModePlaces; - if(strcmp(str, "dirtree") == 0) - return ModeDirTree; - return ModeNone; -} - -const char* SidePane::modeName(SidePane::Mode mode) { - switch(mode) { - case ModePlaces: - return "places"; - case ModeDirTree: - return "dirtree"; - default: - return NULL; - } -} - -#if 0 // FIXME: are these APIs from libfm-qt needed? - -QString SidePane::modeLabel(SidePane::Mode mode) { - switch(mode) { - case ModePlaces: - return tr("Places"); - case ModeDirTree: - return tr("Directory Tree"); - } - return QString(); -} - -QString SidePane::modeTooltip(SidePane::Mode mode) { - switch(mode) { - case ModePlaces: - return tr("Shows list of common places, devices, and bookmarks in sidebar"); - case ModeDirTree: - return tr("Shows tree of directories in sidebar"); - } - return QString(); -} -#endif - -bool SidePane::setHomeDir(const char* home_dir) { - if(view_ == NULL) - return false; - // TODO: SidePane::setHomeDir - - switch(mode_) { - case ModePlaces: - // static_cast(view_); - return true; - case ModeDirTree: - // static_cast(view_); - return true; - default:; - } - return true; -} - -void SidePane::initDirTree() { - // TODO - DirTreeModel* model = new DirTreeModel(view_); - FmFileInfoJob* job = fm_file_info_job_new(NULL, FM_FILE_INFO_JOB_NONE); - model->setShowHidden(showHidden_); - - GList* l; - /* query FmFileInfo for home dir and root dir, and then, - * add them to dir tree model */ - fm_file_info_job_add(job, fm_path_get_home()); - fm_file_info_job_add(job, fm_path_get_root()); - /* FIXME: maybe it's cleaner to use run_async here? */ - fm_job_run_sync_with_mainloop(FM_JOB(job)); - for(l = fm_file_info_list_peek_head_link(job->file_infos); l; l = l->next) { - FmFileInfo* fi = FM_FILE_INFO(l->data); - model->addRoot(fi); - } - g_object_unref(job); - - static_cast(view_)->setModel(model); -} - -void SidePane::setMode(Mode mode) { - if(mode == mode_) - return; - - if(view_) { - delete view_; - view_ = NULL; - //if(sp->update_popup) - // g_signal_handlers_disconnect_by_func(sp->view, on_item_popup, sp); - } - mode_ = mode; - - combo_->setCurrentIndex(mode); - switch(mode) { - case ModePlaces: { - PlacesView* placesView = new Fm::PlacesView(this); - view_ = placesView; - placesView->setIconSize(iconSize_); - placesView->setCurrentPath(currentPath_); - connect(placesView, &PlacesView::chdirRequested, this, &SidePane::onPlacesViewChdirRequested); - break; - } - case ModeDirTree: { - DirTreeView* dirTreeView = new Fm::DirTreeView(this); - view_ = dirTreeView; - initDirTree(); - dirTreeView->setIconSize(iconSize_); - dirTreeView->setCurrentPath(currentPath_); - connect(dirTreeView, &DirTreeView::chdirRequested, this, &SidePane::onDirTreeViewChdirRequested); - connect(dirTreeView, &DirTreeView::openFolderInNewWindowRequested, - this, &SidePane::openFolderInNewWindowRequested); - connect(dirTreeView, &DirTreeView::openFolderInNewTabRequested, - this, &SidePane::openFolderInNewTabRequested); - connect(dirTreeView, &DirTreeView::openFolderInTerminalRequested, - this, &SidePane::openFolderInTerminalRequested); - connect(dirTreeView, &DirTreeView::createNewFolderRequested, - this, &SidePane::createNewFolderRequested); - connect(dirTreeView, &DirTreeView::prepareFileMenu, - this, &SidePane::prepareFileMenu); - break; - } - default:; - } - if(view_) { - // if(sp->update_popup) - // g_signal_connect(sp->view, "item-popup", G_CALLBACK(on_item_popup), sp); - verticalLayout->addWidget(view_); - } - Q_EMIT modeChanged(mode); -} - -void SidePane::setShowHidden(bool show_hidden) { - if(view_ == NULL || show_hidden == showHidden_) - return; - showHidden_ = show_hidden; - if(mode_ == ModeDirTree) { - DirTreeView* dirTreeView = static_cast(view_); - DirTreeModel* model = static_cast( dirTreeView->model()); - if(model) - model->setShowHidden(showHidden_); - } -} - -} // namespace Fm diff --git a/libfm-qt/sidepane.h b/libfm-qt/sidepane.h deleted file mode 100644 index d5afca6..0000000 --- a/libfm-qt/sidepane.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_SIDEPANE_H -#define FM_SIDEPANE_H - -#include "libfmqtglobals.h" -#include -#include - -class QComboBox; -class QVBoxLayout; -class QWidget; - -namespace Fm { - -class FileMenu; - -class LIBFM_QT_API SidePane : public QWidget { - Q_OBJECT - -public: - enum Mode { - ModeNone = -1, - ModePlaces = 0, - ModeDirTree, - NumModes - }; - -public: - explicit SidePane(QWidget* parent = 0); - virtual ~SidePane(); - - QSize iconSize() { - return iconSize_; - } - - void setIconSize(QSize size); - - FmPath* currentPath() { - return currentPath_; - } - - void setCurrentPath(FmPath* path); - - void setMode(Mode mode); - - Mode mode() { - return mode_; - } - - QWidget* view() { - return view_; - } - - const char *modeName(Mode mode); - - Mode modeByName(const char *str); - -#if 0 // FIXME: are these APIs from libfm-qt needed? - int modeCount(void) { - return NumModes; - } - - QString modeLabel(Mode mode); - - QString modeTooltip(Mode mode); -#endif - - void setShowHidden(bool show_hidden); - - bool showHidden() { - return showHidden_; - } - - bool setHomeDir(const char *home_dir); - - // libfm-gtk compatible alias - FmPath* getCwd() { - return currentPath(); - } - - void chdir(FmPath* path) { - setCurrentPath(path); - } - -Q_SIGNALS: - void chdirRequested(int type, FmPath* path); - void openFolderInNewWindowRequested(FmPath* path); - void openFolderInNewTabRequested(FmPath* path); - void openFolderInTerminalRequested(FmPath* path); - void createNewFolderRequested(FmPath* path); - void modeChanged(Fm::SidePane::Mode mode); - - void prepareFileMenu(Fm::FileMenu* menu); // emit before showing a Fm::FileMenu - -protected Q_SLOTS: - void onPlacesViewChdirRequested(int type, FmPath* path); - void onDirTreeViewChdirRequested(int type, FmPath* path); - void onComboCurrentIndexChanged(int current); - -private: - void initDirTree(); - -private: - FmPath* currentPath_; - QWidget* view_; - QComboBox* combo_; - QVBoxLayout* verticalLayout; - QSize iconSize_; - Mode mode_; - bool showHidden_; -}; - -} - -#endif // FM_SIDEPANE_H diff --git a/libfm-qt/thumbnailloader.cpp b/libfm-qt/thumbnailloader.cpp deleted file mode 100644 index 7dee65e..0000000 --- a/libfm-qt/thumbnailloader.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* - - Copyright (C) 2013 PCMan - - 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. -*/ - - -#include "thumbnailloader.h" -#include -#include - -using namespace Fm; - -// FmQImageWrapper is a GObject used to wrap QImage objects and use in glib-based libfm -#define FM_TYPE_QIMAGE_WRAPPER (fm_qimage_wrapper_get_type()) -#define FM_QIMAGE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ -FM_TYPE_QIMAGE_WRAPPER, FmQImageWrapper)) -#define FM_QIMAGE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\ -FM_TYPE_QIMAGE_WRAPPER, FmQImageWrapperClass)) -#define FM_IS_QIMAGE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\ -FM_TYPE_QIMAGE_WRAPPER)) -#define FM_IS_QIMAGE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ -FM_TYPE_QIMAGE_WRAPPER)) -#define FM_QIMAGE_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\ -FM_TYPE_QIMAGE_WRAPPER, FmQImageWrapperClass)) - -typedef struct _FmQImageWrapper FmQImageWrapper; -typedef struct _FmQImageWrapperClass FmQImageWrapperClass; - -struct _FmQImageWrapper { - GObject parent; - QImage image; -}; - -struct _FmQImageWrapperClass { - GObjectClass parent_class; -}; - -GType fm_qimage_wrapper_get_type(void); -GObject* fm_qimage_wrapper_new(void); -static void fm_qimage_wrapper_finalize(GObject *self); - -G_DEFINE_TYPE(FmQImageWrapper, fm_qimage_wrapper, G_TYPE_OBJECT) - -static void fm_qimage_wrapper_class_init(FmQImageWrapperClass *klass) { - GObjectClass* object_class = G_OBJECT_CLASS(klass); - object_class->finalize = fm_qimage_wrapper_finalize; -} - -static void fm_qimage_wrapper_init(FmQImageWrapper *self) { - // placement new for QImage - new(&self->image) QImage(); -} - -static void fm_qimage_wrapper_finalize(GObject *self) { - FmQImageWrapper *wrapper = FM_QIMAGE_WRAPPER(self); - // placement delete - wrapper->image.~QImage(); -} - -GObject *fm_qimage_wrapper_new(QImage& image) { - FmQImageWrapper *wrapper = (FmQImageWrapper*)g_object_new(FM_TYPE_QIMAGE_WRAPPER, NULL); - wrapper->image = image; - return (GObject*)wrapper; -} - -ThumbnailLoader* ThumbnailLoader::theThumbnailLoader = NULL; -bool ThumbnailLoader::localFilesOnly_ = true; -int ThumbnailLoader::maxThumbnailFileSize_ = 0; - -ThumbnailLoader::ThumbnailLoader() { - // apply the settings to libfm - fm_config->thumbnail_local = localFilesOnly_; - fm_config->thumbnail_max = maxThumbnailFileSize_; - - FmThumbnailLoaderBackend qt_backend = { - readImageFromFile, - readImageFromStream, - writeImage, - scaleImage, - rotateImage, - getImageWidth, - getImageHeight, - getImageText, - setImageText - }; - gboolean success = fm_thumbnail_loader_set_backend(&qt_backend); -} - -ThumbnailLoader::~ThumbnailLoader() { - -} - -GObject* ThumbnailLoader::readImageFromFile(const char* filename) { - QImage image; - image.load(QString(filename)); - // qDebug("readImageFromFile: %s, %d", filename, image.isNull()); - return image.isNull() ? NULL : fm_qimage_wrapper_new(image); -} - -GObject* ThumbnailLoader::readImageFromStream(GInputStream* stream, guint64 len, GCancellable* cancellable) { - // qDebug("readImageFromStream: %p, %llu", stream, len); - // FIXME: should we set a limit here? Otherwise if len is too large, we can run out of memory. - unsigned char* buffer = new unsigned char[len]; // allocate enough buffer - unsigned char* pbuffer = buffer; - int totalReadSize = 0; - while(!g_cancellable_is_cancelled(cancellable) && totalReadSize < len) { - int bytesToRead = totalReadSize + 4096 > len ? len - totalReadSize : 4096; - gssize readSize = g_input_stream_read(stream, pbuffer, bytesToRead, cancellable, NULL); - if(readSize == 0) // end of file - break; - else if(readSize == -1) // error - return NULL; - totalReadSize += readSize; - pbuffer += readSize; - } - QImage image; - image.loadFromData(buffer, totalReadSize); - delete []buffer; - return image.isNull() ? NULL : fm_qimage_wrapper_new(image); -} - -gboolean ThumbnailLoader::writeImage(GObject* image, const char* filename) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(image); - if(wrapper == NULL || wrapper->image.isNull()) - return FALSE; - return (gboolean)wrapper->image.save(filename, "PNG"); -} - -GObject* ThumbnailLoader::scaleImage(GObject* ori_pix, int new_width, int new_height) { - // qDebug("scaleImage: %d, %d", new_width, new_height); - FmQImageWrapper* ori_wrapper = FM_QIMAGE_WRAPPER(ori_pix); - QImage scaled = ori_wrapper->image.scaled(new_width, new_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - return scaled.isNull() ? NULL : fm_qimage_wrapper_new(scaled); -} - -GObject* ThumbnailLoader::rotateImage(GObject* image, int degree) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(image); - // degree values are 0, 90, 180, and 270 counterclockwise. - // In Qt, QMatrix does rotation counterclockwise as well. - // However, because the y axis of widget coordinate system is downward, - // the real effect of the coordinate transformation becomes clockwise rotation. - // So we need to use (360 - degree) here. - // Quote from QMatrix API doc: - // Note that if you apply a QMatrix to a point defined in widget - // coordinates, the direction of the rotation will be clockwise because - // the y-axis points downwards. - QImage rotated = wrapper->image.transformed(QMatrix().rotate(360 - degree)); - return rotated.isNull() ? NULL : fm_qimage_wrapper_new(rotated); -} - -int ThumbnailLoader::getImageWidth(GObject* image) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(image); - return wrapper->image.width(); -} - -int ThumbnailLoader::getImageHeight(GObject* image) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(image); - return wrapper->image.height(); -} - -char* ThumbnailLoader::getImageText(GObject* image, const char* key) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(image); - QByteArray text = wrapper->image.text(key).toLatin1(); - return (char*)g_memdup(text.constData(), text.length()); -} - -gboolean ThumbnailLoader::setImageText(GObject* image, const char* key, const char* val) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(image); - // NOTE: we might receive image=NULL sometimes with older versions of libfm. - if(Q_LIKELY(wrapper != NULL)) { - wrapper->image.setText(key, val); - } - return TRUE; -} - -QImage ThumbnailLoader::image(FmThumbnailLoader* result) { - FmQImageWrapper* wrapper = FM_QIMAGE_WRAPPER(fm_thumbnail_loader_get_data(result)); - if(wrapper) { - return wrapper->image; - } - return QImage(); -} - diff --git a/libfm-qt/thumbnailloader.h b/libfm-qt/thumbnailloader.h deleted file mode 100644 index 00aeab9..0000000 --- a/libfm-qt/thumbnailloader.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - - Copyright (C) 2013 PCMan - - 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 FM_THUMBNAILLOADER_H -#define FM_THUMBNAILLOADER_H - -#include "libfmqtglobals.h" -#include -#include -#include - -namespace Fm { - -class LIBFM_QT_API ThumbnailLoader { - -public: - ThumbnailLoader(); - virtual ~ThumbnailLoader(); - - static ThumbnailLoader* instance() { - return theThumbnailLoader; - } - - static FmThumbnailLoader* load(FmFileInfo* fileInfo, int size, FmThumbnailLoaderCallback callback, gpointer user_data) { - // qDebug("load thumbnail: %s", fm_file_info_get_disp_name(fileInfo)); - return fm_thumbnail_loader_load(fileInfo, size, callback, user_data); - } - - static FmFileInfo* fileInfo(FmThumbnailLoader* result) { - return fm_thumbnail_loader_get_file_info(result); - } - - static void cancel(FmThumbnailLoader* result) { - fm_thumbnail_loader_cancel(result); - } - - static QImage image(FmThumbnailLoader* result); - - static int size(FmThumbnailLoader* result) { - return fm_thumbnail_loader_get_size(result); - } - - static void setLocalFilesOnly(bool value) { - localFilesOnly_ = value; - if(fm_config) - fm_config->thumbnail_local = localFilesOnly_; - } - - static bool localFilesOnly() { - return localFilesOnly_; - } - - static int maxThumbnailFileSize() { - return maxThumbnailFileSize_; - } - - static void setMaxThumbnailFileSize(int size) { - maxThumbnailFileSize_ = size; - if(fm_config) - fm_config->thumbnail_max = maxThumbnailFileSize_; - } - -private: - static GObject* readImageFromFile(const char* filename); - static GObject* readImageFromStream(GInputStream* stream, guint64 len, GCancellable* cancellable); - static gboolean writeImage(GObject* image, const char* filename); - static GObject* scaleImage(GObject* ori_pix, int new_width, int new_height); - static int getImageWidth(GObject* image); - static int getImageHeight(GObject* image); - static char* getImageText(GObject* image, const char* key); - static gboolean setImageText(GObject* image, const char* key, const char* val); - static GObject* rotateImage(GObject* image, int degree); - -private: - static ThumbnailLoader* theThumbnailLoader; - static bool localFilesOnly_; - static int maxThumbnailFileSize_; -}; - -} - -#endif // FM_THUMBNAILLOADER_H diff --git a/libfm-qt/translations/libfm-qt.ts b/libfm-qt/translations/libfm-qt.ts deleted file mode 100644 index d04b96e..0000000 --- a/libfm-qt/translations/libfm-qt.ts +++ /dev/null @@ -1,1265 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - - - - - Installed Applications - - - - - Custom Command - - - - - Command line to execute: - - - - - Application name: - - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - - - - - Keep terminal window open after command execution - - - - - Execute in terminal emulator - - - - - Set selected application as default action of this file type - - - - - EditBookmarksDialog - - - Edit Bookmarks - - - - - Name - - - - - Location - - - - - &Add Item - - - - - &Remove Item - - - - - Use drag and drop to reorder the items - - - - - ExecFileDialog - - - Execute file - - - - - &Open - - - - - E&xecute - - - - - Execute in &Terminal - - - - - Cancel - - - - - FileOperationDialog - - - Destination: - - - - - Processing: - - - - - Preparing... - - - - - Progress - - - - - Time remaining: - - - - - FilePropsDialog - - - File Properties - - - - - General - - - - - Location: - - - - - File type: - - - - - Mime type: - - - - - File size: - - - - - On-disk size: - - - - - Last modified: - - - - - Link target: - - - - - Open With: - - - - - Last accessed: - - - - - Permissions - - - - - Ownership - - - - - - - Group: - - - - - - - Owner: - - - - - Access Control - - - - - - Other: - - - - - Make the file executable - - - - - - - Read - - - - - - - Write - - - - - - - Execute - - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - - - - - Fm::AppChooserComboBox - - - Customize - - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - - - - - Fm::CreateNewMenu - - - Folder - - - - - Blank File - - - - - Fm::DirTreeModel - - - Loading... - - - - - <No sub folders> - - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - - - - - Move here - - - - - Create symlink here - - - - - Cancel - - - - - Fm::EditBookmarksDialog - - - New bookmark - - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - - - - - This file '%1' is executable. Do you want to execute it? - - - - - Fm::FileMenu - - - Open - - - - - Open With... - - - - - Other Applications - - - - - Create &New - - - - - &Restore - - - - - Cut - - - - - Copy - - - - - Paste - - - - - - &Move to Trash - - - - - Rename - - - - - Extract to... - - - - - Extract Here - - - - - Compress - - - - - Properties - - - - - Output - - - - - &Delete - - - - - Fm::FileOperation - - - Error - - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - - - - - - Confirm - - - - - Do you want to delete the selected files? - - - - - Do you want to move the selected files to trash can? - - - - - Fm::FileOperationDialog - - - Move files - - - - - Moving the following files to destination folder: - - - - - Copy Files - - - - - Copying the following files to destination folder: - - - - - Trash Files - - - - - Moving the following files to trash can: - - - - - Delete Files - - - - - Deleting the following files - - - - - Create Symlinks - - - - - Creating symlinks for the following files: - - - - - Change Attributes - - - - - Changing attributes of the following files: - - - - - Restore Trashed Files - - - - - Restoring the following files from trash can: - - - - - Error - - - - - Fm::FilePropsDialog - - - View folder content - - - - - View and modify folder content - - - - - Read - - - - - Read and write - - - - - Forbidden - - - - - Files of different types - - - - - Multiple Files - - - - - Apply changes - - - - - Do you want to recursively apply these changes to all files and sub-folders? - - - - - Fm::FileSearchDialog - - - Error - - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - - - - - &Paste - - - - - Select &All - - - - - Invert Selection - - - - - Sorting - - - - - Show Hidden - - - - - Folder Pr&operties - - - - - By File Name - - - - - By Modification Time - - - - - By File Size - - - - - By File Type - - - - - By File Owner - - - - - Ascending - - - - - Descending - - - - - Folder First - - - - - Case Sensitive - - - - - Fm::FolderModel - - - Name - - - - - Type - - - - - Size - - - - - Modified - - - - - Owner - - - - - Fm::FontButton - - - Bold - - - - - Italic - - - - - Fm::MountOperationPasswordDialog - - - &Connect - - - - - Fm::PlacesModel - - - Places - - - - - Desktop - - - - - Computer - - - - - Applications - - - - - Network - - - - - Devices - - - - - Bookmarks - - - - - Trash - - - - - Fm::PlacesView - - - Open in New Tab - - - - - Open in New Window - - - - - Empty Trash - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - - - - - Mount - - - - - Eject - - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - - - - - Type: %1 -Modified: %2 - - - - - Type: %1 -Modified: %3 - - - - - &Overwrite - - - - - &Rename - - - - - Fm::SidePane - - - - Places - - - - - - Directory Tree - - - - - Shows list of common places, devices, and bookmarks in sidebar - - - - - Shows tree of directories in sidebar - - - - - MountOperationPasswordDialog - - - Mount - - - - - Connect &anonymously - - - - - Connect as u&ser: - - - - - &Username: - - - - - &Password: - - - - - &Domain: - - - - - Forget password &immediately - - - - - Remember password until you &logout - - - - - Remember &forever - - - - - QObject - - - Rename File - - - - - Please enter a new name: - - - - - - - - Error - - - - - Create Folder - - - - - Create File - - - - - Please enter a new file name: - - - - - New text file - - - - - Please enter a new folder name: - - - - - New folder - - - - - Enter a name for the new %1: - - - - - RenameDialog - - - Confirm to replace files - - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - - - - - dest - - - - - with the following file? - - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - - - - - Apply this option to all existing files - - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_ar.ts b/libfm-qt/translations/libfm-qt_ar.ts deleted file mode 100644 index 81c124b..0000000 --- a/libfm-qt/translations/libfm-qt_ar.ts +++ /dev/null @@ -1,1265 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - - - - - Installed Applications - - - - - Custom Command - - - - - Command line to execute: - - - - - Application name: - - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - - - - - Keep terminal window open after command execution - - - - - Execute in terminal emulator - - - - - Set selected application as default action of this file type - - - - - EditBookmarksDialog - - - Edit Bookmarks - - - - - Name - - - - - Location - - - - - &Add Item - - - - - &Remove Item - - - - - Use drag and drop to reorder the items - - - - - ExecFileDialog - - - Execute file - - - - - &Open - - - - - E&xecute - - - - - Execute in &Terminal - - - - - Cancel - - - - - FileOperationDialog - - - Destination: - - - - - Processing: - - - - - Preparing... - - - - - Progress - - - - - Time remaining: - - - - - FilePropsDialog - - - File Properties - - - - - General - - - - - Location: - - - - - File type: - - - - - Mime type: - - - - - File size: - - - - - On-disk size: - - - - - Last modified: - - - - - Link target: - - - - - Open With: - - - - - Last accessed: - - - - - Permissions - - - - - Ownership - - - - - - - Group: - - - - - - - Owner: - - - - - Access Control - - - - - - Other: - - - - - Make the file executable - - - - - - - Read - - - - - - - Write - - - - - - - Execute - - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - - - - - Fm::AppChooserComboBox - - - Customize - - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - - - - - Fm::CreateNewMenu - - - Folder - - - - - Blank File - - - - - Fm::DirTreeModel - - - Loading... - - - - - <No sub folders> - - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - - - - - Move here - - - - - Create symlink here - - - - - Cancel - - - - - Fm::EditBookmarksDialog - - - New bookmark - - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - - - - - This file '%1' is executable. Do you want to execute it? - - - - - Fm::FileMenu - - - Open - - - - - Cut - - - - - Copy - - - - - Paste - - - - - - &Move to Trash - - - - - Output - - - - - &Delete - - - - - Rename - - - - - Open With... - - - - - Other Applications - - - - - Create &New - - - - - &Restore - - - - - Extract to... - - - - - Extract Here - - - - - Compress - - - - - Properties - - - - - Fm::FileOperation - - - Error - - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - - - - - - Confirm - - - - - Do you want to delete the selected files? - - - - - Do you want to move the selected files to trash can? - - - - - Fm::FileOperationDialog - - - Move files - - - - - Moving the following files to destination folder: - - - - - Copy Files - - - - - Copying the following files to destination folder: - - - - - Trash Files - - - - - Moving the following files to trash can: - - - - - Delete Files - - - - - Deleting the following files - - - - - Create Symlinks - - - - - Creating symlinks for the following files: - - - - - Change Attributes - - - - - Changing attributes of the following files: - - - - - Restore Trashed Files - - - - - Restoring the following files from trash can: - - - - - Error - - - - - Fm::FilePropsDialog - - - View folder content - - - - - View and modify folder content - - - - - Read - - - - - Read and write - - - - - Forbidden - - - - - Files of different types - - - - - Multiple Files - - - - - Apply changes - - - - - Do you want to recursively apply these changes to all files and sub-folders? - - - - - Fm::FileSearchDialog - - - Error - - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - - - - - &Paste - - - - - Select &All - - - - - Invert Selection - - - - - Sorting - - - - - Show Hidden - - - - - Folder Pr&operties - - - - - By File Name - - - - - By Modification Time - - - - - By File Size - - - - - By File Type - - - - - By File Owner - - - - - Ascending - - - - - Descending - - - - - Folder First - - - - - Case Sensitive - - - - - Fm::FolderModel - - - Name - - - - - Type - - - - - Size - - - - - Modified - - - - - Owner - - - - - Fm::FontButton - - - Bold - - - - - Italic - - - - - Fm::MountOperationPasswordDialog - - - &Connect - - - - - Fm::PlacesModel - - - Places - - - - - Desktop - - - - - Trash - - - - - Computer - - - - - Applications - - - - - Network - - - - - Devices - - - - - Bookmarks - - - - - Fm::PlacesView - - - Empty Trash - - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - - - - - Mount - - - - - Eject - - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - - - - - Type: %1 -Modified: %2 - - - - - Type: %1 -Modified: %3 - - - - - &Overwrite - - - - - &Rename - - - - - Fm::SidePane - - - - Places - - - - - - Directory Tree - - - - - Shows list of common places, devices, and bookmarks in sidebar - - - - - Shows tree of directories in sidebar - - - - - MountOperationPasswordDialog - - - Mount - - - - - Connect &anonymously - - - - - Connect as u&ser: - - - - - &Username: - - - - - &Password: - - - - - &Domain: - - - - - Forget password &immediately - - - - - Remember password until you &logout - - - - - Remember &forever - - - - - QObject - - - - - - Error - - - - - Rename File - - - - - Please enter a new name: - - - - - Create Folder - - - - - Please enter a new file name: - - - - - New text file - - - - - Please enter a new folder name: - - - - - New folder - - - - - Enter a name for the new %1: - - - - - Create File - - - - - RenameDialog - - - Confirm to replace files - - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - - - - - dest - - - - - with the following file? - - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - - - - - Apply this option to all existing files - - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_cs_CZ.ts b/libfm-qt/translations/libfm-qt_cs_CZ.ts deleted file mode 100644 index 582602d..0000000 --- a/libfm-qt/translations/libfm-qt_cs_CZ.ts +++ /dev/null @@ -1,1288 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Výběr aplikace - - - - Installed Applications - Nainstalované aplikace - - - - Custom Command - Vlastní příkaz - - - - Command line to execute: - Příkaz k vykonání: - - - - Application name: - Jméno aplikace: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Tyto zástupné symboly mohou být použity v příkazovém řádku:</b> -<ul> -<li><b>%f</b>: Reprezentuje jméno jednoho souboru</li> -<li><b>%F</b>: Reprezentuje jména více souborů</li> -<li><b>%u</b>: Reprezentuje URI jednoho souboru</li> -<li><b>%U</b>: Reprezentuje URI více souborů</li> -</ul> - - - - Keep terminal window open after command execution - Nechat okno terminálu otevřené - - - - Execute in terminal emulator - Spustit v emulátoru terminálu - - - - Set selected application as default action of this file type - Použít aplikaci jako výchozí pro tento typ souboru - - - - EditBookmarksDialog - - - Edit Bookmarks - Upravit záložky - - - - Name - Jméno - - - - Location - Umístění - - - - &Add Item - &Přidat položku - - - - &Remove Item - &Odebrat položku - - - - Use drag and drop to reorder the items - Přetažením uprav pořadí - - - - ExecFileDialog - - - Execute file - Spustit soubor - - - - &Open - &Otevřít - - - - E&xecute - &Spustit - - - - Execute in &Terminal - Spustit v &Terminálu - - - - Cancel - Zrušit - - - - FileOperationDialog - - - Destination: - Umístění: - - - - Processing: - Zpracování: - - - - Preparing... - Příprava... - - - - Progress - Průběh - - - - Time remaining: - Zbývající čas: - - - - FilePropsDialog - - - File Properties - Vlastnosti souboru - - - - General - Obecné - - - - Location: - Umístění: - - - - File type: - Typ souboru: - - - - Mime type: - Mime typ: - - - - File size: - Velikost souboru: - - - - On-disk size: - Zabrané místo: - - - - Last modified: - Upraveno: - - - - Link target: - Cíl odkazu: - - - - Open With: - Otevřít pomocí: - - - - Last accessed: - Poslední přístup: - - - - Permissions - Práva - - - - Ownership - Vlastnictví - - - - - - Group: - Skupina: - - - - - - Owner: - Vlastník: - - - - Access Control - Zpřístupnění - - - - - Other: - Ostatní: - - - - Make the file executable - Označit soubor jako spustitelný - - - - - - Read - Čtení - - - - - - Write - Čtení a zápis - - - - - - Execute - Spuštění - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - Pokročilý režim - - - - Fm::AppChooserComboBox - - - Customize - - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - - - - - Fm::CreateNewMenu - - - Folder - Adresář - - - - Blank File - Prázdný soubor - - - - Fm::DirTreeModel - - - Loading... - - - - - <No sub folders> - - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Kopírovat sem - - - - Move here - Přesunout sem - - - - Create symlink here - Vytvořit zde odkaz - - - - Cancel - Zrušit - - - - Fm::EditBookmarksDialog - - - New bookmark - Nová záložka - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - - - - - This file '%1' is executable. Do you want to execute it? - - - - - Fm::FileMenu - - - Open - Otevřít - - - - Create &New - Vytvořit &nový - - - - &Restore - O&bnovit - - - - Cut - Vyjmout - - - - Copy - Kopírovat - - - - Paste - Vložit - - - - - &Move to Trash - Přesunout do &koše - - - - Output - Výstup - - - - &Delete - &Smazat - - - - Rename - Přejmenovat - - - - Open With... - Otevřít v ... - - - - Other Applications - Ostatní programy - - - - Extract to... - Rozbalit do ... - - - - Extract Here - Rozbalit sem - - - - Compress - Komprimovat - - - - Properties - Vlastnosti - - - - Fm::FileOperation - - - Error - Chyba - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Některé soubory nemohou být přesunuty do koše, protože příslušné souborové systémy nepodporují tuto operaci. -Chceš je odstranit trvale? - - - - - Confirm - Potvrdit - - - - Do you want to delete the selected files? - Chceš smazat vybrané soubory? - - - - Do you want to move the selected files to trash can? - Chceš přesunout vybrané soubory do koše? - - - - Fm::FileOperationDialog - - - Move files - - - - - Moving the following files to destination folder: - - - - - Copy Files - - - - - Copying the following files to destination folder: - - - - - Trash Files - - - - - Moving the following files to trash can: - - - - - Delete Files - - - - - Deleting the following files - - - - - Create Symlinks - - - - - Creating symlinks for the following files: - - - - - Change Attributes - - - - - Changing attributes of the following files: - - - - - Restore Trashed Files - - - - - Restoring the following files from trash can: - - - - - Error - Chyba - - - - Fm::FilePropsDialog - - - View folder content - - - - - View and modify folder content - - - - - Read - Čtení - - - - Read and write - - - - - Forbidden - - - - - Files of different types - - - - - Multiple Files - - - - - Apply changes - - - - - Do you want to recursively apply these changes to all files and sub-folders? - - - - - Fm::FileSearchDialog - - - Error - Chyba - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Vytvořit &nový - - - - &Paste - &Vložit - - - - Select &All - Vybr&at všechno - - - - Invert Selection - Invertovat výběr - - - - Sorting - Řadit - - - - Show Hidden - Zobrazit skryté - - - - Folder Pr&operties - Vlastnosti sl&ožky - - - Folder - Adresář - - - Blank File - Prázdný soubor - - - - By File Name - Podle jména - - - - By Modification Time - Podle času - - - - By File Size - Podle velikosti - - - - By File Type - Podle typu - - - - By File Owner - Podle vlastníka - - - - Ascending - Vzestupně - - - - Descending - sestupně - - - - Folder First - Adresáře jako první - - - - Case Sensitive - Zohlednit velikost písmen - - - - Fm::FolderModel - - - Name - Jméno - - - - Type - Typ - - - - Size - Velikost - - - - Modified - Změněno - - - - Owner - Vlastník - - - - Fm::FontButton - - - Bold - Tučné - - - - Italic - Kurzíva - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Připojit - - - - Fm::PlacesModel - - - Places - Místa - - - - Desktop - Plocha - - - - Trash - Koš - - - - Computer - Počítač - - - - Applications - Aplikace - - - - Network - Síť - - - - Devices - Zařízení - - - - Bookmarks - Záložky - - - - Fm::PlacesView - - - Empty Trash - Vysypat koš - - - Rename - Přejmenovat - - - Delete - Smazat - - - - Open in New Tab - Otevřít v novém panelu - - - - Open in New Window - Otevřít v novém okně - - - - Move Bookmark Up - Přesunout záložku nahoru - - - - Move Bookmark Down - Přesunout záložku dolů - - - - Rename Bookmark - Přejmenovat záložku - - - - Remove Bookmark - Odstranit záložku - - - - - Unmount - Odpojit - - - - Mount - Připojit - - - - Eject - Vysunout - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - - - - - Type: %1 -Modified: %2 - - - - - Type: %1 -Modified: %3 - - - - - &Overwrite - &Přepsat - - - - &Rename - Pře&jmenovat - - - - Fm::SidePane - - - - Places - Místa - - - - - Directory Tree - Strom adresářů - - - - Shows list of common places, devices, and bookmarks in sidebar - Zobrazit seznam obvyklých míst, zařízení a záložek v postranní liště - - - - Shows tree of directories in sidebar - Zobrazit strom adresářů v postranní liště - - - - MountOperationPasswordDialog - - - Mount - Připojit - - - - Connect &anonymously - Připojit &anonymně - - - - Connect as u&ser: - Připojit jako &uživatel: - - - - &Username: - Uživatelské &jméno: - - - - &Password: - &Heslo: - - - - &Domain: - &Doména: - - - - Forget password &immediately - &Zapomenout heslo - - - - Remember password until you &logout - Pamatovat si heslo do &odhlášení - - - - Remember &forever - Pamatovat si heslo &trvale - - - - QObject - - - - - - Error - Chyba - - - - Rename File - Přejmenovat soubor - - - - Please enter a new name: - Prosím zadej nové jméno: - - - - Create Folder - Vytvořit adresář - - - - Please enter a new file name: - Prosím zadej nové jméno souboru: - - - - New text file - Nový textový soubor - - - - Please enter a new folder name: - Prosím zadej nové jméno adresáře: - - - - New folder - Nový adresář - - - - Enter a name for the new %1: - Zadej jméno pro nový %1: - - - - Create File - Vytvořit soubor - - - - RenameDialog - - - Confirm to replace files - Potvrdit náhradu souborů - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Na tomto místě už je soubor se stejným jménem.</span></p><p>Chceš nahradit existující soubor</p></body></html> - - - - dest - - - - - with the following file? - následujícím souborem? - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - &Jméno souboru: - - - - Apply this option to all existing files - Použij tuto volbu pro všechny soubory - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Vlastnosti - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_de.ts b/libfm-qt/translations/libfm-qt_de.ts deleted file mode 100644 index 6c337fe..0000000 --- a/libfm-qt/translations/libfm-qt_de.ts +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Wählen Sie eine Anwendung - - - - Installed Applications - Installierte Anwendungen - - - - Custom Command - Benutzerdefinierter Befehl - - - - Command line to execute: - Auszuführender Befehl: - - - - Application name: - Anwendungsname: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Diese speziellen Kürzel können im Befehl verwendet werden</b> -<ul> -<li><b>%f</b>: Repräsentiert eine einzelne Datei</li> -<li><b>%F</b>: Repräsentiert mehrere Dateien</li> -<li><b>%u</b>: Repräsentiert eine einzelne URI einer Datei</li> -<li><b>%U</b>: Repräsentiert mehrere URIs</li> -</ul> - - - - Keep terminal window open after command execution - Terminalfenster nach der Ausführung des Befehls offen lassen - - - - Execute in terminal emulator - In einem Terminalemulator ausführen - - - - Set selected application as default action of this file type - Ausgewählte Anwendung als Standardaktion für diesen Dateityp festlegen - - - - EditBookmarksDialog - - - Edit Bookmarks - Lesezeichen bearbeiten - - - - Name - Name - - - - Location - Ort - - - - &Add Item - Element &hinzufügen - - - - &Remove Item - Element &entfernen - - - - Use drag and drop to reorder the items - Klicken und ziehen Sie, um Elemente zu sortieren - - - - ExecFileDialog - - - Execute file - Datei ausführen - - - - &Open - Ö&ffnen - - - - E&xecute - &Ausführen - - - - Execute in &Terminal - In einem &Terminal ausführen - - - - Cancel - Abbrechen - - - - FileOperationDialog - - - Destination: - Ziel: - - - - Processing: - Verarbeitet: - - - - Preparing... - Vorbereiten... - - - - Progress - Fortschritt - - - - Time remaining: - Verbleibende Zeit: - - - - FilePropsDialog - - - File Properties - Dateieigenschaften - - - - General - Allgemeines - - - - Location: - Ort: - - - - File type: - Dateityp: - - - - Mime type: - MIME-Typ: - - - - File size: - Dateigröße: - - - - On-disk size: - Größe auf dem Datenträger: - - - - Last modified: - Letztes Änderungsdatum: - - - - Link target: - Verknüpfungsziel: - - - - Open With: - Öffnen mit: - - - - Last accessed: - Letzter Zugriff: - - - - Permissions - Berechtigungen - - - - Ownership - Besitz - - - - - - Group: - Gruppe: - - - - - - Owner: - Besitzer: - - - - Access Control - Zugriffskontrolle - - - - - Other: - Andere: - - - - Make the file executable - Datei ausführbar machen - - - - - - Read - Lesen - - - - - - Write - Schreiben - - - - - - Execute - Ausführen - - - - Sticky - "Sticky bit" - - - - SetUID - SetUID - - - - SetGID - SetGID - - - - Advanced Mode - Erweiterte Einstellungen - - - - Fm::AppChooserComboBox - - - Customize - Anpassen - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Wählen Sie eine Anwendung für Dateien vom Typ "%1" - - - - Fm::CreateNewMenu - - - Folder - Ordner - - - - Blank File - Leere Datei - - - - Fm::DirTreeModel - - - Loading... - Lädt... - - - - <No sub folders> - <Keine Unterverzeichnisse> - - - - Fm::DirTreeView - - - Open in New T&ab - Öffnen in neuem T&ab - - - - Open in New Win&dow - Öffnen in neuem &Fenster - - - - Open in Termina&l - Öffnen in Termina&l - - - - Fm::DndActionMenu - - - Copy here - Hierhin kopieren - - - - Move here - Hierhin verschieben - - - - Create symlink here - Hier eine symbolische Verknüpfung erstellen - - - - Cancel - Abbrechen - - - - Fm::EditBookmarksDialog - - - New bookmark - Neues Lesezeichen - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Die Textdatei '%1' scheint ein ausführbares Skript zu sein. -Was möchten Sie damit tun? - - - - This file '%1' is executable. Do you want to execute it? - Die Datei '%1' ist ausführbar. Möchten Sie sie ausführen? - - - - Fm::FileMenu - - - Open - Öffnen - - - - Create &New - &Neu erstellen - - - - &Restore - Wiede&rherstellen - - - - Cut - Ausschneiden - - - - Copy - Kopieren - - - - Paste - Einfügen - - - - - &Move to Trash - In den &Papierkorb verschieben - - - - Output - Ausgabe - - - - &Delete - &Löschen - - - - Rename - Umbenennen - - - - Open With... - Öffnen mit... - - - - Other Applications - Andere Anwendungen - - - - Extract to... - Entpacken nach... - - - - Extract Here - Hier entpacken - - - - Compress - Komprimieren - - - - Properties - Eigenschaften - - - - Fm::FileOperation - - - Error - Fehler - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Einige Dateien können nicht in den Papierkorb verschoben werden, da die zugrundeliegenden Dateisysteme den Vorgang nicht unterstützen. -Sollen die Dateien stattdessen gelöscht werden? - - - - - Confirm - Bestätigung - - - - Do you want to delete the selected files? - Möchten Sie die ausgewählten Dateien löschen? - - - - Do you want to move the selected files to trash can? - Möchten Sie die ausgewählten Dateien in den Papierkorb verschieben? - - - - Fm::FileOperationDialog - - - Move files - Dateien verschieben - - - - Moving the following files to destination folder: - Verschiebe die folgenden Dateien in den Zielordner: - - - - Copy Files - Dateien kopieren - - - - Copying the following files to destination folder: - Kopiere die folgenden Dateien in den Zielordner: - - - - Trash Files - Dateien für den Papierkorb - - - - Moving the following files to trash can: - Verschiebe die folgenden Dateien in den Papierkorb: - - - - Delete Files - Dateien löschen - - - - Deleting the following files - Lösche die folgenden Dateien - - - - Create Symlinks - Symbolische Verknüpfung erstellen - - - - Creating symlinks for the following files: - Symbolische Verknüpfungen für die folgenden Dateien erstellen: - - - - Change Attributes - Eigenschaften ändern - - - - Changing attributes of the following files: - Eigenschaften der folgenden Dateien ändern: - - - - Restore Trashed Files - Dateien aus dem Papierkorb wiederherstellen - - - - Restoring the following files from trash can: - Folgende Dateien aus dem Papierkorb wiederherstellen: - - - - Error - Fehler - - - - Fm::FilePropsDialog - - - View folder content - Ordnerinhalt ansehen - - - - View and modify folder content - Ordnerinhalt ansehen und modifizieren - - - - Read - Lesen - - - - Read and write - Lesen und schreiben - - - - Forbidden - Unzulässig - - - - Files of different types - Dateien unterschiedlicher Typen - - - - Multiple Files - Mehrere Dateien - - - - Apply changes - Änderungen anwenden - - - - Do you want to recursively apply these changes to all files and sub-folders? - Möchten Sie die Änderungen auf alle Dateien und Unterverzeichnisse anwenden? - - - - Fm::FileSearchDialog - - - Error - Fehler - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - &Neu erstellen - - - - &Paste - &Einfügen - - - - Select &All - &Alle auswählen - - - - Invert Selection - Auswahl umkehren - - - - Sorting - Sortierung - - - - Show Hidden - Versteckte anzeigen - - - - Folder Pr&operties - Ordner&eigenschaften - - - Folder - Ordner - - - Blank File - Leere Datei - - - - By File Name - Nach Dateiname - - - - By Modification Time - Nach Änderungsdatum - - - - By File Size - Nach Dateigröße - - - - By File Type - Nach Typ - - - - By File Owner - Nach Besitzer - - - - Ascending - Aufsteigend - - - - Descending - Absteigend - - - - Folder First - Ordner zuerst - - - - Case Sensitive - Groß-/ Kleinschreibung beachten - - - - Fm::FolderModel - - - Name - Name - - - - Type - Typ - - - - Size - Größe - - - - Modified - Geändert - - - - Owner - Besitzer - - - - Fm::FontButton - - - Bold - Fett - - - - Italic - Kursiv - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Verbinden - - - - Fm::PlacesModel - - - Places - Orte - - - - Desktop - Schreibtisch - - - - Trash - Papierkorb - - - - Computer - Rechner - - - - Applications - Anwendungen - - - - Network - Netzwerk - - - - Devices - Geräte - - - - Bookmarks - Lesezeichen - - - - Fm::PlacesView - - - Empty Trash - Papierkorb leeren - - - Rename - Umbenennen - - - Delete - Löschen - - - - Open in New Tab - Öffnen in neuem Tab - - - - Open in New Window - Öffnen in neuem Fenster - - - - Move Bookmark Up - Nach oben verschieben - - - - Move Bookmark Down - Nach unten verschieben - - - - Rename Bookmark - Lesezeichen umbenennen - - - - Remove Bookmark - Lesezeichen entfernen - - - - - Unmount - Aushängen - - - - Mount - Einhängen - - - - Eject - Auswerfen - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Typ: %1 -Größe: %2 -Geändert: %3 - - - - Type: %1 -Modified: %2 - Typ: %1 -Geändert: %2 - - - - Type: %1 -Modified: %3 - Typ: %1 -Geändert: %3 - - - - &Overwrite - Über&schreiben - - - - &Rename - &Umbenennen - - - - Fm::SidePane - - - - Places - Orte - - - - - Directory Tree - Verzeichnisbaum - - - - Shows list of common places, devices, and bookmarks in sidebar - Zeigt eine Liste diverser Orte, Geräte und Lesezeichen in der Seitenleiste - - - - Shows tree of directories in sidebar - Zeigt einen Verzeichnisbaum in der Seitenleiste - - - - MountOperationPasswordDialog - - - Mount - Einhängen - - - - Connect &anonymously - &Anonym verbinden - - - - Connect as u&ser: - Verbinden als &Benutzer: - - - - &Username: - Benutzer&name: - - - - &Password: - &Passwort: - - - - &Domain: - &Domäne: - - - - Forget password &immediately - Passwort &sofort vergessen - - - - Remember password until you &logout - Passwort &erst beim Abmelden vergessen - - - - Remember &forever - Passwort &für immer merken - - - - QObject - - - - - - Error - Fehler - - - - Rename File - Datei umbenennen - - - - Please enter a new name: - Bitte geben Sie einen neuen Namen ein: - - - - Create Folder - Ordner erstellen - - - - Please enter a new file name: - Bitte geben Sie einen neuen Dateinamen ein: - - - - New text file - Neue Textdatei - - - - Please enter a new folder name: - Bitte geben Sie einen neuen Ordnernamen ein: - - - - New folder - Neuer Ordner - - - - Enter a name for the new %1: - Geben Sie einen Namen für %1 ein: - - - - Create File - Datei erstellen - - - - RenameDialog - - - Confirm to replace files - Überschreiben von Dateien bestätigen - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Es gibt bereits eine gleichnamige Datei an diesem Ort.</span></p><p>Möchten Sie die Datei ersetzen?</p></body></html> - - - - dest - Ziel - - - - with the following file? - Mit der folgenden Datei? - - - - src file info - Info über die Quelldatei - - - - dest file info - Info über die Zieldatei - - - - src - Quelle - - - - &File name: - &Dateiname: - - - - Apply this option to all existing files - Diese Aktion auf alle existierenden Dateien anwenden - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Eigenschaften - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_el.ts b/libfm-qt/translations/libfm-qt_el.ts deleted file mode 100644 index 4b2d511..0000000 --- a/libfm-qt/translations/libfm-qt_el.ts +++ /dev/null @@ -1,1285 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Επιλέξτε μια εφαρμογή - - - - Installed Applications - Εγκατεστημένες εφαρμογές - - - - Custom Command - Προσαρμοσμένη εντολή - - - - Command line to execute: - Γραμμή εντολών προς εκτέλεση: - - - - Application name: - Όνομα της εφαρμογής: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Αυτοί οι ειδικοί κωδικοί μπορούν να χρησιμοποιηθούν στη γραμμή εντολών:</b> -<ul> -<li><b>%f</b>: Αναπαριστά ένα όνομα αρχείου</li> -<li><b>%F</b>: Αναπαριστά πολλαπλά ονόματα αρχείων</li> -<li><b>%u</b>: Αναπαριστά ένα URI του αρχείου</li> -<li><b>%U</b>: Αναπαριστά πολλαπλά URI</li> -</ul> - - - - Keep terminal window open after command execution - Διατήρηση του παραθύρου του τερματικού ανοιχτό μετά την εκτέλεση της εντολής - - - - Execute in terminal emulator - Εκτέλεση στον προσομοιωτή τερματικού - - - - Set selected application as default action of this file type - Ορίστε την επιλεγμένη εφαρμογή ως την εξ ορισμού ενέργεια για αυτού του τύπου αρχεία - - - - EditBookmarksDialog - - - Edit Bookmarks - Επεξεργασία σελιδοδεικτών - - - - Name - Όνομα - - - - Location - Τοποθεσία - - - - &Add Item - &Προσθήκη αντικειμένου - - - - &Remove Item - &Αφαίρεση αντικειμένου - - - - Use drag and drop to reorder the items - Χρησιμοποιήστε τη μεταφορά και απόθεση για αναδιάταξη των αντικειμένων - - - - ExecFileDialog - - - Execute file - Εκτέλεση του αρχείου - - - - &Open - Ά&νοιγμα - - - - E&xecute - &Εκτέλεση - - - - Execute in &Terminal - Εκτέλεση στο &τερματικό - - - - Cancel - Ακύρωση - - - - FileOperationDialog - - - Destination: - Προορισμός: - - - - Processing: - Επεξεργασία: - - - - Preparing... - Προετοιμασία... - - - - Progress - Πρόοδος - - - - Time remaining: - Υπολειπόμενος χρόνος: - - - - FilePropsDialog - - - File Properties - Ιδιότητες του αρχείου - - - - General - Γενικά - - - - Location: - Τοποθεσία: - - - - File type: - Τύπος αρχείου: - - - - Mime type: - Τύπος Mime: - - - - File size: - Μέγεθος αρχείου: - - - - On-disk size: - Μέγεθος στον δίσκο: - - - - Last modified: - Τελευταία τροποποίηση: - - - - Link target: - Προορισμός συνδέσμου: - - - - Open With: - Άνοιγμα με: - - - - Last accessed: - Τελευταία προσπέλαση: - - - - Permissions - Άδειες - - - - Ownership - Ιδιοκτησία - - - - - - Group: - Ομάδα: - - - - - - Owner: - Ιδιοκτήτης: - - - - Access Control - Έλεγχος πρόσβασης - - - - - Other: - Άλλο: - - - - Make the file executable - Ορισμός ως εκτελέσιμο - - - - - - Read - Ανάγνωση - - - - - - Write - Εγγραφή - - - - - - Execute - Εκτέλεση - - - - Sticky - Κολλημένο - - - - SetUID - SetUID - - - - SetGID - SetGID - - - - Advanced Mode - Προηγμένη λειτουργία - - - - Fm::AppChooserComboBox - - - Customize - Προσαρμοσμένο - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Επιλέξτε μια εφαρμογή για το άνοιγμα των αρχείων «%1» - - - - Fm::CreateNewMenu - - - Folder - Φάκελος - - - - Blank File - Κενό αρχείο - - - - Fm::DirTreeModel - - - Loading... - Φόρτωση... - - - - <No sub folders> - <No sub folders> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Αντιγραφή εδώ - - - - Move here - Μετακίνηση εδώ - - - - Create symlink here - Δημιουργία συμβολικού δεσμού εδώ - - - - Cancel - Ακύρωση - - - - Fm::EditBookmarksDialog - - - New bookmark - Νέος σελιδοδείκτης - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Το αρχείο κειμένου «%1» φαίνεται ότι είναι ένα εκτελέσιμο σενάριο. -Τι θέλετε να κάνετε με αυτό; - - - - This file '%1' is executable. Do you want to execute it? - Αυτό το αρχείο «%1» είναι εκτελέσιμο. Θέλετε να το εκτελέσετε; - - - - Fm::FileMenu - - - Open - Άνοιγμα - - - - Open With... - Άνοιγμα με... - - - - Other Applications - Άλλες εφαρμογές - - - - Create &New - Δημιουργία &νέου - - - - &Restore - &Επαναφορά - - - - Cut - Αποκοπή - - - - Copy - Αντιγραφή - - - - Paste - Επικόλληση - - - - - &Move to Trash - &Μετακίνηση στα απορρίμματα - - - - Rename - Μετονομασία - - - - Extract to... - Εξαγωγή σε... - - - - Extract Here - Εξαγωγή εδώ - - - - Compress - Συμπίεση - - - - Properties - Ιδιότητες - - - - Output - Έξοδος - - - - &Delete - &Διαγραφή - - - - Fm::FileOperation - - - Error - Σφάλμα - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Μερικά αρχεία δεν μπορούν να μετακινηθούν στον κάδο απορριμμάτων διότι το υποκείμενο αρχείο συστήματος δεν υποστηρίζει αυτήν την ενέργεια. -Θέλετε αντί αυτού να το διαγράψετε; - - - - - Confirm - Επιβεβαίωση - - - - Do you want to delete the selected files? - Επιθυμείτε την διαγραφή των επιλεγμένων αρχείων; - - - - Do you want to move the selected files to trash can? - Επιθυμείτε την μετακίνηση των επιλεγμένων αρχείων στον κάδο απορριμμάτων; - - - - Fm::FileOperationDialog - - - Move files - Μετακίνηση των αρχείων - - - - Moving the following files to destination folder: - Μετακίνηση των ακολούθων αρχείων στον φάκελο προορισμού: - - - - Copy Files - Αντιγραφή των αρχείων - - - - Copying the following files to destination folder: - Αντιγραφή των ακολούθων αρχείων στον φάκελο προορισμού: - - - - Trash Files - Ρίψη των αρχείων στα απορρίμματα - - - - Moving the following files to trash can: - Μετακίνηση των ακολούθων αρχείων στον κάδο απορριμμάτων: - - - - Delete Files - Διαγραφή των αρχείων - - - - Deleting the following files - Διαγραφή των ακολούθων αρχείων - - - - Create Symlinks - Δημιουργία συμβολικών δεσμών - - - - Creating symlinks for the following files: - Δημιουργία συμβολικών δεσμών για τα ακόλουθα αρχεία: - - - - Change Attributes - Αλλαγή ιδιοχαρακτηριστικών - - - - Changing attributes of the following files: - Αλλαγή των ιδιοχαρακτηριστικών των ακολούθων αρχείων: - - - - Restore Trashed Files - Επαναφορά των αρχείων από τον κάδο απορριμμάτων - - - - Restoring the following files from trash can: - Επαναφέρονται τα παρακάτω αρχεία από τον κάδο απορριμμάτων: - - - - Error - Σφάλμα - - - - Fm::FilePropsDialog - - - View folder content - Προβολή των περιεχομένων του φακέλου - - - - View and modify folder content - Προβολή και τροποποίηση των περιεχομένων του φακέλου - - - - Read - Ανάγνωση - - - - Read and write - Ανάγνωση και εγγραφή - - - - Forbidden - Απαγορευμένο - - - - Files of different types - Αρχεία διαφορετικού τύπου - - - - Multiple Files - Πολλαπλά αρχεία - - - - Apply changes - Εφαρμογή των αλλαγών - - - - Do you want to recursively apply these changes to all files and sub-folders? - Θέλετε να εφαρμόσετε αναδρομικά αυτές τις αλλαγές σε όλα τα αρχεία και υποφακέλους; - - - - Fm::FileSearchDialog - - - Error - Σφάλμα - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Δημιουργία &νέου - - - - &Paste - Επι&κόλληση - - - - Select &All - Επιλογή ό&λων - - - - Invert Selection - Αντιστροφή επιλογής - - - - Sorting - Ταξινόμηση - - - - Show Hidden - Εμφάνιση των κρυφών - - - - Folder Pr&operties - Ι&διότητες του φακέλου - - - Folder - Φάκελος - - - Blank File - Κενό αρχείο - - - - By File Name - Ανά όνομα αρχείου - - - - By Modification Time - Ανά χρόνο τροποποίησης - - - - By File Size - Ανά μέγεθος αρχείου - - - - By File Type - Ανά τύπο αρχείου - - - - By File Owner - Ανά ιδιοκτήτη αρχείου - - - - Ascending - Αύξουσα - - - - Descending - Φθίνουσα - - - - Folder First - Οι φάκελοι πρώτα - - - - Case Sensitive - Διάκριση πεζών/κεφαλαίων - - - - Fm::FolderModel - - - Name - Όνομα - - - - Type - Τύπος - - - - Size - Μέγεθος - - - - Modified - Τροποποιήθηκε - - - - Owner - Ιδιοκτήτης - - - - Fm::FontButton - - - Bold - Έντονα - - - - Italic - Πλάγια - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Σύνδεση - - - - Fm::PlacesModel - - - Places - Τοποθεσίες - - - - Desktop - Επιφάνεια εργασίας - - - - Computer - Υπολογιστής - - - - Applications - Εφαρμογές - - - - Network - Δίκτυο - - - - Devices - Συσκευές - - - - Bookmarks - Σελιδοδείκτες - - - - Trash - Απορρίμματα - - - - Fm::PlacesView - - - Open in New Tab - Άνοιγμα σε νέα καρτέλα - - - - Open in New Window - Άνοιγμα σε νέο παράθυρο - - - - Empty Trash - Άδειασμα των απορριμμάτων - - - - Move Bookmark Up - Μετακίνηση του σελιδοδείκτη προς τα πάνω - - - - Move Bookmark Down - Μετακίνηση του σελιδοδείκτη προς τα κάτω - - - - Rename Bookmark - Μετονομασία σελιδοδείκτη - - - - Remove Bookmark - Αφαίρεση σελιδοδείκτη - - - - - Unmount - Αποπροσάρτηση - - - - Mount - Προσάρτηση - - - - Eject - Εξαγωγή - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Τύπος: %1 -Μέγεθος: %2 -Τροποποιήθηκε: %3 - - - - Type: %1 -Modified: %2 - Τύπος: %1 -Τροποποιήθηκε: %2 - - - - Type: %1 -Modified: %3 - Τύπος: %1 -Τροποποιήθηκε: %3 - - - - &Overwrite - &Αντικατάσταση - - - - &Rename - &Μετονομασία - - - - Fm::SidePane - - - - Places - Τοποθεσίες - - - - - Directory Tree - Δέντρο καταλόγων - - - - Shows list of common places, devices, and bookmarks in sidebar - Εμφανίζει τη λίστα με τις κοινές τοποθεσίες, συσκευές, και σελιδοδείκτες στην πλευρική στήλη - - - - Shows tree of directories in sidebar - Εμφανίζει ένα δέντρο των καταλόγων στην πλευρική στήλη - - - - MountOperationPasswordDialog - - - Mount - Προσάρτηση - - - - Connect &anonymously - &Ανώνυμη σύνδεση - - - - Connect as u&ser: - Σύνδεση ως &χρήστης: - - - - &Username: - Όνομα χ&ρήστη: - - - - &Password: - &Κωδικός πρόσβασης: - - - - &Domain: - &Τομέας: - - - - Forget password &immediately - &Λήθη του κωδικού πρόσβασης άμεσα - - - - Remember password until you &logout - Απομνημόνευση του κωδικού πρόσβασης &μέχρι να αποσυνδεθείτε - - - - Remember &forever - Απομνημόνευση ε&σαεί - - - - QObject - - - Rename File - Μετονομασία αρχείου - - - - Please enter a new name: - Παρακαλώ εισαγάγετε ένα νέο όνομα: - - - - - - - Error - Σφάλμα - - - - Create Folder - Δημιουργία φακέλου - - - - Create File - Δημιουργία αρχείου - - - - Please enter a new file name: - Παρακαλώ εισαγάγετε ένα νέο όνομα αρχείου: - - - - New text file - Νέο αρχείο κειμένου - - - - Please enter a new folder name: - Παρακαλώ εισαγάγετε ένα νέο όνομα φακέλου: - - - - New folder - Νέος φάκελος - - - - Enter a name for the new %1: - Εισαγάγετε ένα όνομα για το νέο %1: - - - - RenameDialog - - - Confirm to replace files - Επιβεβαίωση αντικατάστασης των αρχείων - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Υπάρχει ήδη ένα αρχείο με το ίδιο όνομα στην συγκεκριμένη τοποθεσία.</span></p><p>Θέλετε να αντικαταστήσετε το υπάρχον αρχείο;</p></body></html> - - - - dest - προορισμός - - - - with the following file? - με το παρακάτω αρχείο; - - - - src file info - πληροφορίες αρχείου πηγής - - - - dest file info - πληροφορίες αρχείου προορισμού - - - - src - πηγή - - - - &File name: - &Όνομα αρχείου: - - - - Apply this option to all existing files - Εφαρμογή της επιλογής σε όλα τα υπάρχοντα αρχεία - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Ιδιότητες - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_es.ts b/libfm-qt/translations/libfm-qt_es.ts deleted file mode 100644 index 090f33c..0000000 --- a/libfm-qt/translations/libfm-qt_es.ts +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Seleccione una Aplicación - - - - Installed Applications - Aplicaciones Instaladas - - - - Custom Command - Comando Personalizado - - - - Command line to execute: - Línea de comandos a ejecutar: - - - - Application name: - Nombre de la aplicación: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Estos códigos pueden ser usados en la línea de comando:</b> -<ul> -<li><b>%f</b>: Representa un nombre de archivo</li> -<li><b>%F</b>: Representa múltiples nombres de archivos</li> -<li><b>%u</b>: Representa una URI para el archivo</li> -<li><b>%U</b>: Representa múltiples URIs</li> -</ul> - - - - Keep terminal window open after command execution - Mantener la terminal abierta luego de la ejecución del comando - - - - Execute in terminal emulator - Ejecutar en un emulador de terminal - - - - Set selected application as default action of this file type - Configurar la aplicación seleccionada como por defecto para este tipo de archivo - - - - EditBookmarksDialog - - - Edit Bookmarks - Editar marcadores - - - - Name - Nombre - - - - Location - Localización - - - - &Add Item - &Agregar elemento - - - - &Remove Item - &Eliminar elemento - - - - Use drag and drop to reorder the items - Arrastre y suelte para reordenar los elementos - - - - ExecFileDialog - - - Execute file - Ejecutar archivo - - - - &Open - &Abrir - - - - E&xecute - &Ejecutar - - - - Execute in &Terminal - Ejecutar en &Terminal - - - - Cancel - Cancelar - - - - FileOperationDialog - - - Destination: - Destino: - - - - Processing: - Procesando: - - - - Preparing... - Preparando... - - - - Progress - Progreso - - - - Time remaining: - Tiempo restante: - - - - FilePropsDialog - - - File Properties - Propiedades de Archivo - - - - General - General - - - - Location: - Localización: - - - - File type: - Tipo de archivo: - - - - Mime type: - Tipo Mime: - - - - File size: - Tamaño del archivo: - - - - On-disk size: - Tamaño en disco: - - - - Last modified: - Última modificación: - - - - Link target: - Destino del enlace: - - - - Open With: - Abrir con: - - - - Last accessed: - Último acceso: - - - - Permissions - Permisos - - - - Ownership - Propiedad - - - - - - Group: - Grupo: - - - - - - Owner: - Dueño: - - - - Access Control - Control de acceso - - - - - Other: - Otro: - - - - Make the file executable - Marcar como ejecutable - - - - - - Read - Lectura - - - - - - Write - Escritura - - - - - - Execute - Ejecución - - - - Sticky - Sticky - - - - SetUID - SetUID - - - - SetGID - SetGID - - - - Advanced Mode - Modo avanzado - - - - Fm::AppChooserComboBox - - - Customize - Personalizar - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Seleccione una aplicación para abrir archivos "%1" - - - - Fm::CreateNewMenu - - - Folder - Directorio - - - - Blank File - Archivo Vacío - - - - Fm::DirTreeModel - - - Loading... - Cargando... - - - - <No sub folders> - <No hay subdirectorios> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Copiar aquí - - - - Move here - Mover aquí - - - - Create symlink here - Crear enlace simbólico aquí - - - - Cancel - Cancelar - - - - Fm::EditBookmarksDialog - - - New bookmark - Nuevo marcador - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - El archivo de texto '%1' parece ser un script ejecutable. -¿Qué desea hacer con él? - - - - This file '%1' is executable. Do you want to execute it? - El archivo '%1' es ejecutable. ¿Quiere ejecutarlo? - - - - Fm::FileMenu - - - Open - Abrir - - - - Open With... - Abrir con... - - - - Other Applications - Otras Aplicaciones - - - - Create &New - Crear &Nuevo - - - - &Restore - &Restaurar - - - - Cut - Cortar - - - - Copy - Copiar - - - - Paste - Pegar - - - - - &Move to Trash - &Mover a la Papelera - - - - Rename - Renombrar - - - - Extract to... - Extraer en... - - - - Extract Here - Extraer aquí - - - - Compress - Comprimir - - - - Properties - Propiedades - - - - Output - Salida - - - - &Delete - &Borrar - - - - Fm::FileOperation - - - Error - Error - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Algunos archivos no pueden moverse a la papelera porque el subsistema de archivos no permite esta operación. -¿Quiere eliminarlos en su lugar? - - - - - Confirm - Confirmación - - - - Do you want to delete the selected files? - ¿Quiere borrar los archivos seleccionados? - - - - Do you want to move the selected files to trash can? - ¿Quiere mover los archivos seleccionados a la papelera? - - - - Fm::FileOperationDialog - - - Move files - Mover archivos - - - - Moving the following files to destination folder: - Moviendo los siguientes archivos al directorio destino: - - - - Copy Files - Copiar archivos - - - - Copying the following files to destination folder: - Copiando los siguientes archivos al directorio destino: - - - - Trash Files - Enviar archivos a la papelera - - - - Moving the following files to trash can: - Moviendo los siguientes archivos a la papelera: - - - - Delete Files - Borrar archivos - - - - Deleting the following files - Borrando los siguientes archivos - - - - Create Symlinks - Crear enlaces simbólicos - - - - Creating symlinks for the following files: - Creando enlaces simbólicos para los siguientes archivos: - - - - Change Attributes - Cambiar atributos - - - - Changing attributes of the following files: - Cambiando atributos para los siguientes archivos: - - - - Restore Trashed Files - Restaurar archivos borrados - - - - Restoring the following files from trash can: - Restaurando los siguientes archivos desde la papelera: - - - - Error - Error - - - - Fm::FilePropsDialog - - - View folder content - Ver contenido del directorio - - - - View and modify folder content - Ver y modificar el contenido del directorio - - - - Read - Lectura - - - - Read and write - Lectura y escritura - - - - Forbidden - Prohibido - - - - Files of different types - Archivos de diferentes tipos - - - - Multiple Files - Múltiples archivos - - - - Apply changes - Aplicar cambios - - - - Do you want to recursively apply these changes to all files and sub-folders? - ¿Quiere aplicar los cambios a todos los archivos y subdirectorios? - - - - Fm::FileSearchDialog - - - Error - Error - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Crear &Nuevo - - - - &Paste - &Pegar - - - - Select &All - Seleccion&ar todo - - - - Invert Selection - Invertir Selección - - - - Sorting - Ordenar - - - - Show Hidden - Mostrar Ocultos - - - - Folder Pr&operties - Pr&opiedades del directorio - - - Folder - Directorio - - - Blank File - Archivo Vacío - - - - By File Name - Por nombre de archivo - - - - By Modification Time - Por fecha de modificación - - - - By File Size - Por tamaño de archivo - - - - By File Type - Por tipo de archivo - - - - By File Owner - Por dueño del archivo - - - - Ascending - Ascendente - - - - Descending - Descendente - - - - Folder First - Primero Directorios - - - - Case Sensitive - Coincidir mayúsculas - - - - Fm::FolderModel - - - Name - Nombre - - - - Type - Tipo - - - - Size - Tamaño - - - - Modified - Modificado - - - - Owner - Dueño - - - - Fm::FontButton - - - Bold - Negrita - - - - Italic - Itálica - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Conectar - - - - Fm::PlacesModel - - - Places - Lugares - - - - Desktop - Escritorio - - - - Computer - Sistema - - - - Applications - Aplicaciones - - - - Network - Red - - - - Devices - Dispositivos - - - - Bookmarks - Marcadores - - - - Trash - Papelera - - - - Fm::PlacesView - - - Empty Trash - Vaciar Papelera - - - Rename - Renombrar - - - Delete - Borrar - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Desmontar - - - - Mount - Montar - - - - Eject - Expulsar - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Tipo: %1 -Tamaño: %2 -Modificado: %3 - - - - Type: %1 -Modified: %2 - Tipo: %1 -Modificado: %2 - - - - Type: %1 -Modified: %3 - Tipo: %1 -Modificado: %3 - - - - &Overwrite - &Sobreescribir - - - - &Rename - &Renombrar - - - - Fm::SidePane - - - - Places - Lugares - - - - - Directory Tree - Árbol de Directorios - - - - Shows list of common places, devices, and bookmarks in sidebar - Muestra lista de lugares comunes, dispositivos y marcadores en la barra lateral - - - - Shows tree of directories in sidebar - Muestra árbol de directorios en barra lateral - - - - MountOperationPasswordDialog - - - Mount - Montar - - - - Connect &anonymously - Conectar &anonimamente - - - - Connect as u&ser: - Conectar como u&suario: - - - - &Username: - &Usuario: - - - - &Password: - &Contraseña: - - - - &Domain: - &Dominio: - - - - Forget password &immediately - Descartar contraseña &inmediatamente - - - - Remember password until you &logout - &Recordar contraseña hasta cerrar sesión - - - - Remember &forever - Recordar &para siempre - - - - QObject - - - - - - Error - Error - - - - Rename File - Renombrar Archivo - - - - Please enter a new name: - Introduzca un nuevo nombre: - - - - Create Folder - - - - - Please enter a new file name: - Introduzca un nuevo nombre de archivo: - - - - New text file - Nuevo archivo de texto - - - - Please enter a new folder name: - Ingrese un nuevo nombre de directorio: - - - - New folder - Nuevo directorio - - - - Enter a name for the new %1: - Ingresar un nombre para el nuevo %1: - - - - Create File - Crear Archivo - - - - RenameDialog - - - Confirm to replace files - Confirmación de sustitución - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Ya existe un archivo con el mismo nombre en este lugar.</span></p><p>¿Quiere reemplazar el archivo existente?</p></body></html> - - - - dest - destino - - - - with the following file? - con el siguiente archivo? - - - - src file info - información del archivo de origen - - - - dest file info - información del archivo de destino - - - - src - origen - - - - &File name: - Nombre de &archivo: - - - - Apply this option to all existing files - Aplicar esta opción a todos los archivos - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Propiedades - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_fr.ts b/libfm-qt/translations/libfm-qt_fr.ts deleted file mode 100644 index 597c673..0000000 --- a/libfm-qt/translations/libfm-qt_fr.ts +++ /dev/null @@ -1,1290 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - - - - - Installed Applications - - - - - Custom Command - - - - - Command line to execute: - - - - - Application name: - - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - - - - - Keep terminal window open after command execution - - - - - Execute in terminal emulator - - - - - Set selected application as default action of this file type - - - - - EditBookmarksDialog - - - Edit Bookmarks - Modifier les signets - - - - Name - Nom - - - - Location - Emplacement - - - - &Add Item - &Ajouter un élément - - - - &Remove Item - &Supprimer un élément - - - - Use drag and drop to reorder the items - Utiliser le glisser-déposer pour trier à nouveau les éléments - - - - ExecFileDialog - - - Execute file - - - - - &Open - - - - - E&xecute - - - - - Execute in &Terminal - - - - - Cancel - Annuler - - - - FileOperationDialog - - - Destination: - Destination : - - - - Processing: - Traitement : - - - - Preparing... - Préparation... - - - - Progress - Progression - - - - Time remaining: - Temps restant : - - - - FilePropsDialog - - - File Properties - Propriétés du fichier - - - - General - Général - - - - Location: - Emplacement : - - - - File type: - Type de fichier : - - - - Mime type: - Type Mime : - - - - File size: - Taille du fichier : - - - - On-disk size: - Taille sur le disque : - - - - Last modified: - Date de dernière modification : - - - - Link target: - Cible du lien : - - - - Open With: - Ouvrir avec : - - - - Last accessed: - Date de dernier accès : - - - - Permissions - Droits d'accès - - - - Ownership - Propriété - - - - - - Group: - Groupe : - - - - - - Owner: - Propriétaire : - - - - Access Control - Contrôle d'accès - - - - - Other: - Autre : - - - - Make the file executable - Rendre le fichier exécutable - - - - - - Read - Lecture - - - - - - Write - Écriture - - - - - - Execute - Exécution - - - - Sticky - Permanent - - - - SetUID - SetUID - - - - SetGID - SetGID - - - - Advanced Mode - Mode avancé - - - - Fm::AppChooserComboBox - - - Customize - - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - - - - - Fm::CreateNewMenu - - - Folder - Dossier - - - - Blank File - - - - - Fm::DirTreeModel - - - Loading... - - - - - <No sub folders> - - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Copier ici - - - - Move here - Déplacer ici - - - - Create symlink here - Créer un lien symbolique ici - - - - Cancel - Annuler - - - - Fm::EditBookmarksDialog - - - New bookmark - Nouveau signet - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - - - - - This file '%1' is executable. Do you want to execute it? - - - - - Fm::FileMenu - - - Open - Ouvrir - - - OpenWith - OpenWith - - - - Cut - Couper - - - - Copy - Copier - - - - Paste - Coller - - - - - &Move to Trash - &Mettre à la corbeille - - - - Output - - - - - &Delete - &Supprimer - - - - Rename - Renommer - - - - Open With... - - - - - Other Applications - - - - - Create &New - Créer un &nouveau - - - - &Restore - - - - - Extract to... - Extraire vers... - - - - Extract Here - Extraire ici - - - - Compress - Compresser - - - - Properties - Propriétés - - - - Fm::FileOperation - - - Error - Erreur - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Certains fichiers ne peuvent pas être mis à la corbeille car les systèmes de fichiers sous-jacents ne prennent pas en charge cette opération. -Voulez-vous plutôt les supprimer ? - - - - - Confirm - Confirmer - - - - Do you want to delete the selected files? - Voulez-vous supprimer les fichiers sélectionnés ? - - - - Do you want to move the selected files to trash can? - Voulez-vous mettre les fichiers sélectionnés à la corbeille ? - - - - Fm::FileOperationDialog - - - Move files - Déplacer les fichiers - - - - Moving the following files to destination folder: - Déplacement des fichiers suivants vers le dossier de destination en cours : - - - - Copy Files - Copier les fichiers - - - - Copying the following files to destination folder: - Copie des fichiers suivants vers le dossier de destination en cours : - - - - Trash Files - Mettre les fichiers de la corbeille - - - - Moving the following files to trash can: - Déplacement des fichiers suivants vers la corbeille en cours : - - - - Delete Files - Supprimer les fichiers - - - - Deleting the following files - Suppression des fichiers suivants - - - - Create Symlinks - Créer des liens symboliques - - - - Creating symlinks for the following files: - Création de liens symboliques avec les fichiers suivants en cours : - - - - Change Attributes - Modifier les attributs - - - - Changing attributes of the following files: - Modification des attributs des fichiers suivants en cours : - - - - Restore Trashed Files - Restaurer les fichiers de la corbeille - - - - Restoring the following files from trash can: - Restauration des fichiers suivants depuis la corbeille en cours : - - - - Error - Erreur - - - - Fm::FilePropsDialog - - - View folder content - Voir le contenu du dossier - - - - View and modify folder content - Voir et modifier le contenu du dossier - - - - Read - Lecture - - - - Read and write - Lecture et écriture - - - - Forbidden - Interdit - - - - Files of different types - Fichiers de différents types - - - - Multiple Files - Fichiers multiples - - - - Apply changes - Appliquer les modifications - - - - Do you want to recursively apply these changes to all files and sub-folders? - Voulez-vous appliquer ces changements récursivement à tous les fichiers et sous-dossiers ? - - - - Fm::FileSearchDialog - - - Error - Erreur - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Créer un &nouveau - - - - &Paste - &Coller - - - - Select &All - Sélectionner &tous - - - - Invert Selection - Inverser la sélection - - - - Sorting - Tri en cours - - - - Show Hidden - Afficher les éléments cachés - - - - Folder Pr&operties - Pr&opriétés du dossier - - - Folder - Dossier - - - File - Fichier - - - - By File Name - Par nom de fichier - - - - By Modification Time - Par date de modification - - - - By File Size - Par taille de fichier - - - - By File Type - Par type de fichier - - - - By File Owner - Par propriétaire de fichier - - - - Ascending - Ascendant - - - - Descending - Descendant - - - - Folder First - Dossier en premier - - - - Case Sensitive - Sensible à la casse - - - - Fm::FolderModel - - - Name - Nom - - - - Type - Type - - - - Size - Taille - - - - Modified - Modifié - - - - Owner - Propriétaire - - - - Fm::FontButton - - - Bold - Gras - - - - Italic - Italique - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Connecter - - - - Fm::PlacesModel - - - Places - Emplacements - - - - Desktop - Bureau - - - - Trash - Corbeille - - - - Computer - Ordinateur - - - - Applications - Applications - - - - Network - Réseau - - - - Devices - Appareils - - - - Bookmarks - Signets - - - - Fm::PlacesView - - - Empty Trash - - - - Rename - Renommer - - - Delete - Supprimer - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Démonter - - - - Mount - Monter - - - - Eject - Éjecter - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Type : %1 -Taille : %2 -Modification : %3 - - - - Type: %1 -Modified: %2 - Type : %1 -Modification : %2 - - - - Type: %1 -Modified: %3 - Type : %1 -Modification : %3 - - - - &Overwrite - &Remplacer - - - - &Rename - &Renommer - - - - Fm::SidePane - - - - Places - Emplacements - - - - - Directory Tree - - - - - Shows list of common places, devices, and bookmarks in sidebar - - - - - Shows tree of directories in sidebar - - - - - MountOperationPasswordDialog - - - Mount - Monter - - - - Connect &anonymously - Connecter &anonymement - - - - Connect as u&ser: - Connecter comme utilis&sateur : - - - - &Username: - Nom d'&utilisateur : - - - - &Password: - Mot de &passe : - - - - &Domain: - &Domaine : - - - - Forget password &immediately - Oublier le mot de passe &immédiatement - - - - Remember password until you &logout - Se souvenir du mot de passe jusqu'à &la déconnexion - - - - Remember &forever - &Toujours s'en souvenir - - - - QObject - - - - - - Error - Erreur - - - - Rename File - Renommer le fichier - - - - Please enter a new name: - Veuillez entrer un nouveau nom : - - - - Create Folder - - - - - Please enter a new file name: - Veuillez entrer un nouveau nom de fichier : - - - - New text file - Nouveau fichier texte - - - - Please enter a new folder name: - Veuillez entrer un nouveau nom de répertoire : - - - - New folder - Nouveau répertoire - - - - Enter a name for the new %1: - - - - - Create File - Créer un fichier - - - - RenameDialog - - - Confirm to replace files - Confirmer le remplacement des fichiers - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Il existe déjà un fichier avec le même nom à cet emplacement.</span></p><p>Voulez-vous replacer le fichier existant ?</p></body></html> - - - - dest - dest. - - - - with the following file? - avec le fichier suivant ? - - - - src file info - infos fichier src - - - - dest file info - infos fichier dest. - - - - src - src - - - - &File name: - Nom de &fichier : - - - - Apply this option to all existing files - Appliquer cette option à tous les fichiers existants - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Propriétés - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_gl.ts b/libfm-qt/translations/libfm-qt_gl.ts deleted file mode 100644 index 43e5874..0000000 --- a/libfm-qt/translations/libfm-qt_gl.ts +++ /dev/null @@ -1,1290 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - - - - - Installed Applications - - - - - Custom Command - - - - - Command line to execute: - - - - - Application name: - - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - - - - - Keep terminal window open after command execution - - - - - Execute in terminal emulator - - - - - Set selected application as default action of this file type - - - - - EditBookmarksDialog - - - Edit Bookmarks - Editar marcadores - - - - Name - Nome - - - - Location - Localización - - - - &Add Item - &Engadir un elemento - - - - &Remove Item - &Retirar o elemento - - - - Use drag and drop to reorder the items - Usar arrastrar e soltar para ordenar elementos - - - - ExecFileDialog - - - Execute file - - - - - &Open - - - - - E&xecute - - - - - Execute in &Terminal - - - - - Cancel - Cancelar - - - - FileOperationDialog - - - Destination: - Destino: - - - - Processing: - Procesando: - - - - Preparing... - Preparando... - - - - Progress - Progreso - - - - Time remaining: - Tempo restante: - - - - FilePropsDialog - - - File Properties - Propiedades do ficheiro - - - - General - Xeral - - - - Location: - Localización - - - - File type: - Tipo de ficheiro: - - - - Mime type: - Tipo MIME: - - - - File size: - Tamaño do ficheiro: - - - - On-disk size: - Tamaño no disco: - - - - Last modified: - Última modificación: - - - - Link target: - Destino da ligazón: - - - - Open With: - Abrir con: - - - - Last accessed: - Último acceso: - - - - Permissions - Permisos - - - - Ownership - Dono - - - - - - Group: - Grupo: - - - - - - Owner: - Propietario: - - - - Access Control - Control de acceso - - - - - Other: - Outros: - - - - Make the file executable - Facer que o ficheiro sexa executábel - - - - - - Read - Lectura - - - - - - Write - Escritura - - - - - - Execute - Execución - - - - Sticky - Persistente - - - - SetUID - Estabelecer o UID - - - - SetGID - Estabelecer o GID - - - - Advanced Mode - Modo avanzado - - - - Fm::AppChooserComboBox - - - Customize - - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - - - - - Fm::CreateNewMenu - - - Folder - Cartafol - - - - Blank File - - - - - Fm::DirTreeModel - - - Loading... - - - - - <No sub folders> - - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Copiar para aquí - - - - Move here - Mover para aquí - - - - Create symlink here - Crear aquí unha ligazón simbólica - - - - Cancel - Cancelar - - - - Fm::EditBookmarksDialog - - - New bookmark - Novo marcador - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - - - - - This file '%1' is executable. Do you want to execute it? - - - - - Fm::FileMenu - - - Open - Abrir - - - OpenWith - Abrir con - - - - Cut - Cortar - - - - Copy - Copiar - - - - Paste - Pegar - - - - - &Move to Trash - Deitar no lixo - - - - Output - - - - - &Delete - &Eliminar - - - - Rename - Renomear - - - - Open With... - - - - - Other Applications - - - - - Create &New - Crear &novo - - - - &Restore - - - - - Extract to... - Extraer en… - - - - Extract Here - Extraer aquí - - - - Compress - Comprimir - - - - Properties - Propiedades - - - - Fm::FileOperation - - - Error - Erro - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Algúns ficheiros non poden enviarse ao cesto do lixo porque o subsistema de ficheiros non permite esta operación. -Desexa eliminalos no seu canto? - - - - - Confirm - Confirmar - - - - Do you want to delete the selected files? - Quere eliminar os ficheiros seleccionados? - - - - Do you want to move the selected files to trash can? - Quere mover os ficheiros seleccionados ao cesto do lixo? - - - - Fm::FileOperationDialog - - - Move files - Mover os ficheiros - - - - Moving the following files to destination folder: - Movendo os seguintes ficheiros ao cartafol de destino: - - - - Copy Files - Copiar os ficheiros - - - - Copying the following files to destination folder: - Copiando os seguintes ficheiros ao cartafol de destino: - - - - Trash Files - Deitar no lixo os ficheiros - - - - Moving the following files to trash can: - Movendo os seguintes ficheiros ao lixo: - - - - Delete Files - Eliminar os ficheiros - - - - Deleting the following files - Eliminando os seguintes ficheiros - - - - Create Symlinks - Crear ligazóns simbólicas - - - - Creating symlinks for the following files: - Creando ligazóns simbólicas para os seguintes ficheiros: - - - - Change Attributes - Cambiar os atributos - - - - Changing attributes of the following files: - Cambiando os atributos dos seguintes ficheiros: - - - - Restore Trashed Files - Restaurar os ficheiro do lixo - - - - Restoring the following files from trash can: - Restaurando os seguintes ficheiros do lixo: - - - - Error - Erro - - - - Fm::FilePropsDialog - - - View folder content - Ver o contido do cartafol - - - - View and modify folder content - Ver e modificar o contido do cartafol - - - - Read - Lectura - - - - Read and write - Lectura e escritura - - - - Forbidden - Prohibido - - - - Files of different types - Ficheiros de tipos diferentes - - - - Multiple Files - Múltiplos ficheiros - - - - Apply changes - Aplicar os cambios - - - - Do you want to recursively apply these changes to all files and sub-folders? - Quere aplicar recursivamente estes cambios a todos os ficheiros e subcartafoles? - - - - Fm::FileSearchDialog - - - Error - Erro - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Crear &novo - - - - &Paste - &Pegar - - - - Select &All - Seleccionar &todo - - - - Invert Selection - Inverter a selección - - - - Sorting - Ordenación - - - - Show Hidden - Amosar agochados - - - - Folder Pr&operties - Pr&opiedades do cartafol - - - Folder - Cartafol - - - File - Ficheiro - - - - By File Name - Polo nome do ficheiro - - - - By Modification Time - Pola data de modificación - - - - By File Size - Polo tamaño do ficheiro - - - - By File Type - Polo tipo do ficheiro - - - - By File Owner - Polo propietario do ficheiro - - - - Ascending - Ascendente - - - - Descending - Descendente - - - - Folder First - Primeiro os cartafoles - - - - Case Sensitive - Distinguindo maiúsculas de minúsculas - - - - Fm::FolderModel - - - Name - Nome - - - - Type - Tipo - - - - Size - Tamaño - - - - Modified - Modificado - - - - Owner - Propietario - - - - Fm::FontButton - - - Bold - Negra - - - - Italic - Itálica - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Conectar - - - - Fm::PlacesModel - - - Places - Lugares - - - - Desktop - Escritorio - - - - Trash - Lixo - - - - Computer - Computador - - - - Applications - Aplicacións - - - - Network - Rede - - - - Devices - Dispositivos - - - - Bookmarks - Marcadores - - - - Fm::PlacesView - - - Empty Trash - - - - Rename - Renomear - - - Delete - Eliminar - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Desmontar - - - - Mount - Montar - - - - Eject - Expulsar - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Tipo: %1 -Tamaño: %2 -Modificado: %3 - - - - Type: %1 -Modified: %2 - Tipo: %1 -Modificado: %2 - - - - Type: %1 -Modified: %3 - Tipo: %1 -Modificado: %3 - - - - &Overwrite - &Sobrescribir - - - - &Rename - &Renomear - - - - Fm::SidePane - - - - Places - Lugares - - - - - Directory Tree - - - - - Shows list of common places, devices, and bookmarks in sidebar - - - - - Shows tree of directories in sidebar - - - - - MountOperationPasswordDialog - - - Mount - Montar - - - - Connect &anonymously - Conectar &anonimamente - - - - Connect as u&ser: - Conectar como u&suario - - - - &Username: - Nome de &usuario: - - - - &Password: - &Contrasinal: - - - - &Domain: - &Dominio: - - - - Forget password &immediately - Esquecer o contrasinal &inmediatamente - - - - Remember password until you &logout - Lembrar o contrasinal ata &saír da sesión - - - - Remember &forever - &Lemprar para sempre - - - - QObject - - - - - - Error - Erro - - - - Rename File - Renomear o ficheiro - - - - Please enter a new name: - Introduza un nome novo: - - - - Create Folder - - - - - Please enter a new file name: - Introduza un novo nome de ficheiro: - - - - New text file - Novo ficheiro de texto - - - - Please enter a new folder name: - Introduza un nome novo para o cartafol: - - - - New folder - Novo cartafol - - - - Enter a name for the new %1: - - - - - Create File - Crear un ficheiro - - - - RenameDialog - - - Confirm to replace files - Confirmar a substitución de ficheiros - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Xa existe un ficheiro con este mesmo nome neste lugar.</span></p><p>Quere substituír o ficheiro existente?</p></body></html> - - - - dest - dest - - - - with the following file? - co seguinte ficheiro? - - - - src file info - Ficheiro de información «src» - - - - dest file info - Ficheiro de información «dest» - - - - src - src - - - - &File name: - Nome do &ficheiro: - - - - Apply this option to all existing files - Aplicar esta opción a todos os ficheiros existentes - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Propiedades - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_hu.ts b/libfm-qt/translations/libfm-qt_hu.ts deleted file mode 100644 index 5703e88..0000000 --- a/libfm-qt/translations/libfm-qt_hu.ts +++ /dev/null @@ -1,1294 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Alkalmazás választás - - - - Installed Applications - Telepített alkalmazások - - - - Custom Command - Egyéb parancs - - - - Command line to execute: - Végrehajtandó parancs: - - - - Application name: - Alkalmazás neve: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>A parancssorban használható speciális karakterek:</b> -<ul> -<li><b>%f</b>: Egy fájnév</li> -<li><b>%F</b>: Több fájlnév</li> -<li><b>%u</b>: Egy URI</li> -<li><b>%U</b>: Több URI</li> -</ul> - - - - Keep terminal window open after command execution - Végrehajtás után a terminál nyitva marad - - - - Execute in terminal emulator - Végrehajtás külső terminálban - - - - Set selected application as default action of this file type - A választott alkalmazás rendelődjék a fáljtípushoz - - - - EditBookmarksDialog - - - Edit Bookmarks - Könyvjelzők szerkesztése - - - - Name - Név - - - - Location - Hely - - - - &Add Item - Ho&zzáadás - - - - &Remove Item - Tö&rlés - - - - Use drag and drop to reorder the items - Húzással rendezhető minden elem - - - - ExecFileDialog - - - Execute file - Fájl futtatás - - - - &Open - &Nyitás - - - - E&xecute - &Végrehajtás - - - - Execute in &Terminal - &Terminálban futtatás - - - - Cancel - Mégse - - - - FileOperationDialog - - - Destination: - Cél: - - - - Processing: - Feldolgozva: - - - - Preparing... - Előkészület... - - - - Progress - Folyamat - - - - Time remaining: - Hátralévő idő: - - - - FilePropsDialog - - - File Properties - Fájljellemzők - - - - General - Általános - - - - Location: - Hely: - - - - File type: - Fájltípus: - - - - Mime type: - Mime típus: - - - - File size: - Fájlméret: - - - - On-disk size: - Mérete a lemezen: - - - - Last modified: - Módosítási idő: - - - - Link target: - Link cél: - - - - Open With: - Megnyitás: - - - - Last accessed: - Utolsó hozzáférés: - - - - Permissions - Jogosultságok - - - - Ownership - Tulajdonos - - - - - - Group: - Csoport: - - - - - - Owner: - Tulajdonos: - - - - Access Control - Hozzáférések - - - - - Other: - Mások: - - - - Make the file executable - Futtatható - - - - - - Read - Olvas - - - - - - Write - Ír - - - - - - Execute - Végrehajt - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - Haladó - - - - Fm::AppChooserComboBox - - - Customize - Saját beállítás - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Alkalmazás választás a "%1" fájl megnyitásához - - - - Fm::CreateNewMenu - - - Folder - Mappa - - - - Blank File - Üres fájl - - - - Fm::DirTreeModel - - - Loading... - Olvasás... - - - - <No sub folders> - <Nincs almappa> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Másolás ide - - - - Move here - Mozgatás ide - - - - Create symlink here - Szimlink ide - - - - Cancel - Mégse - - - - Fm::EditBookmarksDialog - - - New bookmark - Új könyvjelző - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Ez a '%1' fájl futtatható szkriptnek tűnik. -Mi legyen vele? - - - - This file '%1' is executable. Do you want to execute it? - Ez a '%1' fájl futtatható. Végrehajtsuk? - - - - Fm::FileMenu - - - Open - Nyit - - - - Create &New - &Új létrehozása - - - - &Restore - &Visszavon - - - - Cut - Kivág - - - - Copy - Másol - - - - Paste - Beilleszt - - - - - &Move to Trash - Kukába &mozgat - - - - Output - Kimenet - - - - &Delete - &Töröl - - - - Rename - Átnevez - - - - Open With... - Megnyitás ezzel... - - - - Other Applications - Más alkalmazások - - - - Extract to... - Kibontás... - - - - Extract Here - Kibontás ide - - - - Compress - Csomagolás - - - - Properties - Tulajdonságok - - - - Fm::FileOperation - - - Error - Hiba - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Egyes fájlok nem mozgatók a kukába, mert a rendszer ezt nem engedélyezi. -Töröljük őket véglegesen? - - - - - Confirm - Jóváhagyás - - - - Do you want to delete the selected files? - Töröljök a választott fájlokat? - - - - Do you want to move the selected files to trash can? - Helyezzük a kukába a választott fájlokat? - - - - Fm::FileOperationDialog - - - Move files - Fájlmozgatás - - - - Moving the following files to destination folder: - A következő fájlok mozgatása ide: - - - - Copy Files - Fájlmásolás - - - - Copying the following files to destination folder: - A következő fájlok másolása ide: - - - - Trash Files - Fájlok a kukába - - - - Moving the following files to trash can: - A következő fájlok kukába mozgatása: - - - - Delete Files - Fájltörlés - - - - Deleting the following files - A következő fájlok törlése - - - - Create Symlinks - Szimlink létrehozás - - - - Creating symlinks for the following files: - Szimlink készítés a következő fájlokra: - - - - Change Attributes - Attribútum változtatás - - - - Changing attributes of the following files: - A következő fájlok attribútum változtatása: - - - - Restore Trashed Files - Kukázott fájlok visszaállítása - - - - Restoring the following files from trash can: - A következő fájlok visszaállítása a kukából: - - - - Error - Hiba - - - - Fm::FilePropsDialog - - - View folder content - Mappatartalom - - - - View and modify folder content - Mappa tartalma és változtatása - - - - Read - Olvasás - - - - Read and write - Olvasás és írás - - - - Forbidden - Tiltott - - - - Files of different types - Különféle fájltípusok - - - - Multiple Files - Többszörös fájlok - - - - Apply changes - Változtatások alkalmazása - - - - Do you want to recursively apply these changes to all files and sub-folders? - Minden mappára és fájlra alkalmazzuk a változtatásokat? - - - - Fm::FileSearchDialog - - - Error - Hiba - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - &Új létrehozása - - - - &Paste - &Beilleszt - - - - Select &All - Összes kivál&asztása - - - - - Invert Selection - Kiválasztás fordítása - - - - Sorting - Rendezés - - - - Show Hidden - Rejtettek is - - - - Folder Pr&operties - Mappatulajd&onságok - - - Folder - Mappa - - - Blank File - Üres fájl - - - - By File Name - Név - - - - By Modification Time - Módosítási idő - - - - By File Size - Méret - - - - By File Type - Típus - - - - By File Owner - Tulajdonos - - - - Ascending - Emelkedő - - - - Descending - Csökkenő - - - - Folder First - Mappák elől - - - - Case Sensitive - Nagybetűérzékeny - - - - Fm::FolderModel - - - Name - Név - - - - Type - típus - - - - Size - Méret - - - - Modified - Módosítva - - - - Owner - Tulaj - - - - Fm::FontButton - - - Bold - Kövér - - - - Italic - Dőlt - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Kapcsolódás - - - - Fm::PlacesModel - - - Places - Helyek - - - - Desktop - Asztal - - - - Trash - Kuka - - - - Computer - Számítógép - - - - Applications - Alkalmazások - - - - Network - Hálózat - - - - Devices - Eszközök - - - - Bookmarks - Könyvjelzők - - - - Fm::PlacesView - - - Empty Trash - Kukaürítés - - - Rename - Átnevez - - - Delete - Töröl - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Lecsatol - - - - Mount - Csatol - - - - Eject - Kidobat - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Típus: %1 -Méret: %2 -Módosítva: %3 - - - - Type: %1 -Modified: %2 - Típus: %1 -Módosítva: %2 - - - - Type: %1 -Modified: %3 - Típus: %1 -Módosítva: %3 - - - - &Overwrite - &Felülír - - - - &Rename - &Átnevez - - - - Fm::SidePane - - - - Places - Helyek - - - - - Directory Tree - Könyvtárfa - - - - Shows list of common places, devices, and bookmarks in sidebar - Általános helyek, eszközök és könyvjelzők listája az oldalsávban - - - - Shows tree of directories in sidebar - Könyvtárfa az oldalsávban - - - - MountOperationPasswordDialog - - - Mount - Csatlakozás - - - - Connect &anonymously - Névtelen cs&atlakozás - - - - Connect as u&ser: - Felha&sználóként: - - - - &Username: - &Név: - - - - &Password: - &Jelszó: - - - - &Domain: - &Hálózati cím: - - - - Forget password &immediately - Jelszófelejtés &iziben - - - - Remember password until you &logout - Je&lszófelejtés kilépéskor - - - - Remember &forever - Jelszóme&gjegyzés örökre - - - - QObject - - - - - - Error - Hiba - - - - Rename File - Fájlátnevezés - - - - Please enter a new name: - Új név: - - - - Create Folder - - - - - Please enter a new file name: - Új fájlnév: - - - - New text file - Új szövegfájl - - - - Please enter a new folder name: - Űj mappanév: - - - - New folder - Új mappa - - - - Enter a name for the new %1: - Az új %1 neve: - - - - Create File - Fájlkészítés - - - - RenameDialog - - - Confirm to replace files - Fájlfelülírás megerősítése - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Itt már van ilyen nevű fájl.</span></p><p>Felülírjuk a meglévőt?</p></body></html> - - - - dest - cél - - - - with the following file? - Ezzel a fájllal? - - - - src file info - forrásfájl infó - - - - dest file info - célfájl infó - - - - src - forrás - - - - &File name: - &Fájlnév: - - - - Apply this option to all existing files - Az összes fájlra vonatkozzon mindez - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Tulajdonságok - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_it.ts b/libfm-qt/translations/libfm-qt_it.ts deleted file mode 100644 index 9b5eeaf..0000000 --- a/libfm-qt/translations/libfm-qt_it.ts +++ /dev/null @@ -1,1297 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Seleziona un applicazione - - - - Installed Applications - Applicazioni installate - - - - Custom Command - Comando personalizzato - - - - Command line to execute: - Riga di comando da eseguire: - - - - Application name: - Nome dell'applicazione: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Questi caratteri speciali possono essere usati nella riga di comando:</b> -<ul> -<li><b>%f</b>: sta per un nome file singolo</li> -<li><b>%F</b>: sta per nomi file multipli</li> -<li><b>%u</b>: sta per un URI singolo del file</li> -<li><b>%U</b>: sta per URI multipli dei file</li> -</ul> - - - - Keep terminal window open after command execution - Non chiudere il terminale dopo l'esecuzione - - - - Execute in terminal emulator - Esegui in un emulatore di terminale - - - - Set selected application as default action of this file type - Ricorda come associazione predefinita per questo tipo di file - - - - EditBookmarksDialog - - - Edit Bookmarks - Modifica segnalibri - - - - Name - Nome - - - - Location - Posizione - - - - &Add Item - &Aggiungi elemento - - - - &Remove Item - &Rimuovi elemento - - - - Use drag and drop to reorder the items - Trascina per riordinare gli elementi - - - - ExecFileDialog - - - Execute file - Esegui file - - - - &Open - &Apri - - - - E&xecute - E&segui - - - - Execute in &Terminal - Esegui in un &terminale - - - - Cancel - Annulla - - - - FileOperationDialog - - - Destination: - Destinazione: - - - - Processing: - Elaborazione: - - - - Preparing... - Preparazione... - - - - Progress - Avanzamento - - - - Time remaining: - Tempo rimanente: - - - - FilePropsDialog - - - File Properties - Proprietà file - - - - General - Generali - - - - Location: - Posizione: - - - - File type: - Tipo file: - - - - Mime type: - Tipo MIME: - - - - File size: - Dimensione file: - - - - On-disk size: - Dimensione sul disco: - - - - Last modified: - Ultima modifica: - - - - Link target: - Collegamento a: - - - - Open With: - Apri con: - - - - Last accessed: - Ultimo accesso: - - - - Permissions - Permessi - - - - Ownership - Proprietario - - - - - - Group: - Gruppo: - - - - - - Owner: - Proprietario: - - - - Access Control - Controllo accessi - - - - - Other: - Altri: - - - - Make the file executable - Rendi il file eseguibile - - - - - - Read - Lettura - - - - - - Write - Scrittura - - - - - - Execute - Esecuzione - - - - Sticky - Sticky - - - - SetUID - SetUID - - - - SetGID - SetGID - - - - Advanced Mode - Modalità avanzata - - - - Fm::AppChooserComboBox - - - Customize - Personalizza - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Seleziona un applicazione per aprire "%1" file - - - - Fm::CreateNewMenu - - - Folder - Cartella - - - - Blank File - File vuoto - - - - Fm::DirTreeModel - - - Loading... - Caricando... - - - - <No sub folders> - <nessuna sottocartella> - - - - Fm::DirTreeView - - - Open in New T&ab - Apri in una nuova &scheda - - - - Open in New Win&dow - Apri in una nuova &finestra - - - - Open in Termina&l - Apri in un &terminale - - - - Fm::DndActionMenu - - - Copy here - Copia qui - - - - Move here - Sposta qui - - - - Create symlink here - Crea collegamento qui - - - - Cancel - Annulla - - - - Fm::EditBookmarksDialog - - - New bookmark - Nuovo segnalibro - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Questo file di testo "%1" sembra essere uno script eseguibile. -Cosa vuoi fare? - - - - This file '%1' is executable. Do you want to execute it? - Questo file "%1" è eseguibile. Eseguirlo? - - - - Fm::FileMenu - - - Open - Apri - - - OpenWith - ApriCon - - - - Cut - Taglia - - - - Copy - Copia - - - - Paste - Incolla - - - - - &Move to Trash - Cestin&a - - - - Output - Risultato - - - - &Delete - &Rimuovi - - - - Rename - Rinomina - - - - Open With... - Apri con... - - - - Other Applications - Altre applicazioni - - - - Create &New - Crea &nuovo - - - - &Restore - &Ripristina - - - - Extract to... - Estrai in... - - - - Extract Here - Estrai qui - - - - Compress - Comprimi - - - - Properties - Proprietà - - - - Fm::FileOperation - - - Error - Errore - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Alcuni file non possono essere spostati nel cestino perché il file system su cui si trovano non supporta questa operazione. -Vuoi invece eliminarli? - - - - - Confirm - Conferma - - - - Do you want to delete the selected files? - Rimuovere i file selezionati? - - - - Do you want to move the selected files to trash can? - Spostare nel cestino i file selezionati? - - - - Fm::FileOperationDialog - - - Move files - Sposta file - - - - Moving the following files to destination folder: - Spostamento dei file seguenti nella cartella di destinazione: - - - - Copy Files - Copia file - - - - Copying the following files to destination folder: - Copia dei file seguenti nella cartella di destinazione: - - - - Trash Files - Cestina file - - - - Moving the following files to trash can: - Spostamento dei file seguenti nel cestino: - - - - Delete Files - Rimuovi file - - - - Deleting the following files - Rimozione dei file seguenti - - - - Create Symlinks - Crea collegamenti simbolici - - - - Creating symlinks for the following files: - Creazione collegamenti simbolici per i seguenti file: - - - - Change Attributes - Cambia attributi - - - - Changing attributes of the following files: - Cambiamento attributi per i seguenti file: - - - - Restore Trashed Files - Ripristina file cestinati - - - - Restoring the following files from trash can: - Ripristino dei file seguenti dal cestino: - - - - Error - Errore - - - - Fm::FilePropsDialog - - - View folder content - Visualizza contenuti cartella - - - - View and modify folder content - Visualizza e modifica contenuti cartella - - - - Read - Lettura - - - - Read and write - Lettura e scrittura - - - - Forbidden - Vietato - - - - Files of different types - File di tipi diversi - - - - Multiple Files - File multipli - - - - Apply changes - Applica modifiche - - - - Do you want to recursively apply these changes to all files and sub-folders? - Applicare ricorsivamente queste modifiche a tutti i file e a tutte le sotto-cartelle? - - - - Fm::FileSearchDialog - - - Error - Errore - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Crea &nuovo - - - - &Paste - &Incolla - - - - Select &All - Seleziona t&utto - - - - Invert Selection - Inverti selezione - - - - Sorting - Ordinamento - - - - Show Hidden - Mostra nascosti - - - - Folder Pr&operties - Pr&oprietà cartella - - - Folder - Cartella - - - File - File - - - - By File Name - Per nome file - - - - By Modification Time - Per data modifica - - - - By File Size - Per dimensione file - - - - By File Type - Per tipo file - - - - By File Owner - Per proprietario file - - - - Ascending - Crescente - - - - Descending - Decrescente - - - - Folder First - Prima le cartelle - - - - Case Sensitive - Distingui MAIUSCOLE/minuscole - - - - Fm::FolderModel - - - Name - Nome - - - - Type - Tipo - - - - Size - Dimensione - - - - Modified - Modificato - - - - Owner - Proprietario - - - - Fm::FontButton - - - Bold - Grassetto - - - - Italic - Corsivo - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Connetti - - - - Fm::PlacesModel - - - Places - Luoghi - - - - Desktop - Scrivania - - - - Trash - Cestino - - - - Computer - Computer - - - - Applications - Applicazioni - - - - Network - Rete - - - - Devices - Periferiche - - - - Bookmarks - Segnalibri - - - - Fm::PlacesView - - - Empty Trash - Svuota cestino - - - Rename - Rinomina - - - Delete - Rimuovi - - - - Open in New Tab - Apri in una nuova scheda - - - - Open in New Window - Apri in una nuova finestra - - - - Move Bookmark Up - Sposta segnalibro insù - - - - Move Bookmark Down - Sposta segnalibro giù - - - - Rename Bookmark - Rinomina segnalibro - - - - Remove Bookmark - Rimuovi segnalibro - - - - - Unmount - Smonta - - - - Mount - Monta - - - - Eject - Espelli - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Tipo: %1 -Dimensione: %2 -Ultima modifica: %3 - - - - Type: %1 -Modified: %2 - Tipo: %1 -Ultima modifica: %2 - - - - Type: %1 -Modified: %3 - Tipo: %1 -Ultima modifica: %3 - - - - &Overwrite - S&ovrascrivi - - - - &Rename - &Rinomina - - - - Fm::SidePane - - - - Places - Luoghi - - - - - Directory Tree - Albero cartelle - - - - Shows list of common places, devices, and bookmarks in sidebar - Mostra lista di luoghi, dispositivi e segnalibri nel panello laterale - - - - Shows tree of directories in sidebar - Mostra albero delle cartelle nel panello laterale - - - - MountOperationPasswordDialog - - - Mount - Monta - - - - Connect &anonymously - Connetti &anonimamente - - - - Connect as u&ser: - Connetti come &utente: - - - - &Username: - &Nome utente: - - - - &Password: - &Password: - - - - &Domain: - &Dominio: - - - - Forget password &immediately - Dimentica la password &immediatamente - - - - Remember password until you &logout - Ricorda &la password fino al termine sessione - - - - Remember &forever - Ricorda per &sempre - - - - QObject - - - - - - Error - Errore - - - - Rename File - Rinomina file - - - - Please enter a new name: - Inserire il nuovo nome: - - - - Create Folder - Crea cartella - - - - Please enter a new file name: - Inserire il nuovo nome del file: - - - - New text file - Nuovo file di testo - - - - Please enter a new folder name: - Inserire il nuovo nome della cartella: - - - - New folder - Nuova cartella - - - - Enter a name for the new %1: - Inserisci un nome per %1: - - - - Create File - Crea file - - - - RenameDialog - - - Confirm to replace files - Conferma sostituzione dei file - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">C'è già un file con lo stesso nome in questa posizione.</span></p><p>Sostituire il file esistente?</p></body></html> - - - - dest - dest - - - - with the following file? - con il file seguente? - - - - src file info - info file sorg - - - - dest file info - info file dest - - - - src - sorg - - - - &File name: - Nome &file: - - - - Apply this option to all existing files - Applica questa opzione a tutti i file esistenti - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Proprietà - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_ja.ts b/libfm-qt/translations/libfm-qt_ja.ts deleted file mode 100644 index 672030a..0000000 --- a/libfm-qt/translations/libfm-qt_ja.ts +++ /dev/null @@ -1,1302 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - アプリケーションを選ぶ - - - - Installed Applications - インストール済アプリケーション - - - - Custom Command - カスタムコマンド - - - - Command line to execute: - 実行するコマンドライン: - - - - Application name: - アプリケーション名 - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>コマンドラインには、次の特別なコードを使用することができます:</b> -<ul> -<li><b>%f</b>: 単一のファイル名を表す</li> -<li><b>%F</b>: 複数のファイル名を表す</li> -<li><b>%u</b>: 単一のファイルのURIを表す</li> -<li><b>%U</b>: 複数のURIを表す</li> -</ul> - - - - Keep terminal window open after command execution - コマンド実行後も端末のウィンドウを閉じない - - - - Execute in terminal emulator - 端末エミュレーター内で実行 - - - - Set selected application as default action of this file type - 選択したアプリケーションをこのファイルの種類に関連付ける - - - - EditBookmarksDialog - - - Edit Bookmarks - ブックマークを編集 - - - - Name - 名前 - - - - Location - 場所 - - - - &Add Item - アイテムを追加(&A) - - - - &Remove Item - アイテムを削除(&R) - - - - Use drag and drop to reorder the items - アイテムを並べ替えるにはドラッグアンドドロップ - - - - ExecFileDialog - - - Execute file - ファイルを実行 - - - - &Open - 開く(&O) - - - - E&xecute - 実行(&E) - - - - Execute in &Terminal - 端末内で実行(&T) - - - - Cancel - キャンセル - - - - FileOperationDialog - - - Destination: - 送り先: - - - - Processing: - 処理中: - - - - Preparing... - 準備中... - - - - Progress - 進行状況 - - - - Time remaining: - 残り時間: - - - - FilePropsDialog - - - File Properties - ファイルのプロパティー - - - - General - 一般 - - - - Location: - 場所: - - - - File type: - 種類: - - - - Mime type: - MIMEタイプ: - - - - File size: - サイズ: - - - - On-disk size: - ディスク上のサイズ: - - - - Last modified: - 最終更新日時: - - - - Link target: - リンク先: - - - - Open With: - 関連付け: - - - - Last accessed: - 最終アクセス日時: - - - - Permissions - パーミッション - - - - Ownership - 所有権 - - - - - - Group: - グループ: - - - - - - Owner: - 所有者: - - - - Access Control - アクセス制限 - - - - - Other: - その他: - - - - Make the file executable - ファイルを実行可能にする - - - - - - Read - 読取り - - - - - - Write - 書込み - - - - - - Execute - 実行 - - - - Sticky - スティッキー - - - - SetUID - UIDを設定 - - - - SetGID - GIDを設定 - - - - Advanced Mode - 高度なモード - - - - Fm::AppChooserComboBox - - - Customize - カスタマイズ - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - ファイルを開くアプリケーションを選択 - - - - Fm::CreateNewMenu - - - Folder - フォルダー - - - - Blank File - 空のファイル - - - - Fm::DirTreeModel - - - Loading... - ロード中... - - - - <No sub folders> - <サブフォルダーなし> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - ここへコピー - - - - Move here - ここへ移動 - - - - Create symlink here - シンボリックリンクを作成 - - - - Cancel - キャンセル - - - - Fm::EditBookmarksDialog - - - New bookmark - 新規ブックマーク - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - このテキストファイル '%1' は実行可能スクリプトです。 -どうしますか? - - - - This file '%1' is executable. Do you want to execute it? - このファイル '%1' は実行可能です。 -実行しますか? - - - - Fm::FileMenu - - - Open - 開く - - - OpenWith - アプリケーションで開く - - - - Cut - 切り取り - - - - Copy - コピー - - - - Paste - 貼り付け - - - - - &Move to Trash - ゴミ箱へ移動(&M) - - - - Output - 出力 - - - - &Delete - 削除(&D) - - - - Rename - 名前を変更する - - - - Open With... - アプリケーションで開く - - - - Other Applications - その他のアプリケーション - - - - Create &New - 新規作成 (&N) - - - - &Restore - - - - - Extract to... - 展開する - - - - Extract Here - ここへ展開する - - - - Compress - 圧縮する - - - - Properties - プロパティー - - - - Fm::FileOperation - - - Error - エラー - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - ファイルシステムのサポートがないため、ゴミ箱へ移動できないファイルがあります。 -かわりにこれらを削除しますか? - - - - - Confirm - 確認 - - - - Do you want to delete the selected files? - 選択したファイルを削除しますか? - - - - Do you want to move the selected files to trash can? - 選択したファイルをゴミ箱に移しますか? - - - - Fm::FileOperationDialog - - - Move files - ファイルを移動 - - - - Moving the following files to destination folder: - 次のファイルを対象のフォルダーへ移動: - - - - Copy Files - ファイルをコピー - - - - Copying the following files to destination folder: - 次のファイルを対象のフォルダーへコピー: - - - - Trash Files - ファイルをゴミ箱へ入れる - - - - Moving the following files to trash can: - 次のファイルをゴミ箱へ入れる: - - - - Delete Files - ファイルを削除 - - - - Deleting the following files - 以下のファイルを削除 - - - - Create Symlinks - シンボリックリンク作成 - - - - Creating symlinks for the following files: - 以下のファイルのシンボリックリンクを作成: - - - - Change Attributes - 属性を変更 - - - - Changing attributes of the following files: - 以下のファイルの属性を変更: - - - - Restore Trashed Files - ゴミ箱から戻す - - - - Restoring the following files from trash can: - 以下のファイルをゴミ箱から戻す: - - - - Error - エラー - - - - Fm::FilePropsDialog - - - View folder content - フォルダーの内容を表示 - - - - View and modify folder content - フォルダーの内容を表示・変更 - - - - Read - 読取り - - - - Read and write - 読取りおよび書込み - - - - Forbidden - 禁止 - - - - Files of different types - 異なる種類のファイル - - - - Multiple Files - 複数のファイル - - - - Apply changes - 変更を適用 - - - - Do you want to recursively apply these changes to all files and sub-folders? - 変更をすべてのファイルとサブフォルダーにも再帰的に適用しますか? - - - - Fm::FileSearchDialog - - - Error - エラー - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - 新規作成 (&N) - - - - &Paste - ペースト(&P) - - - - Select &All - すべてを選択(&A) - - - - Invert Selection - 選択を反転 - - - - Sorting - ソート - - - - Show Hidden - 隠しファイルの表示 - - - - Folder Pr&operties - フォルダのプロパティー(&O) - - - Folder - フォルダー - - - File - ファイル - - - Blank File - 空のファイル - - - - By File Name - 名前 - - - - By Modification Time - 更新時刻 - - - - By File Size - サイズ - - - - By File Type - 種類 - - - - By File Owner - 所有者 - - - - Ascending - 昇順 - - - - Descending - 降順 - - - - Folder First - フォルダーを先に - - - - Case Sensitive - 大文字小文字を区別 - - - - Fm::FolderModel - - - Name - 名前 - - - - Type - 種類 - - - - Size - サイズ - - - - Modified - 更新日時 - - - - Owner - 所有者 - - - - Fm::FontButton - - - Bold - 太字 - - - - Italic - 斜体 - - - - Fm::MountOperationPasswordDialog - - - &Connect - 接続&(C) - - - - Fm::PlacesModel - - - Places - 場所 - - - - Desktop - デスクトップ - - - - Trash - ゴミ箱 - - - - Computer - コンピューター - - - - Applications - アプリケーション - - - - Network - ネットワーク - - - - Devices - デバイス - - - - Bookmarks - ブックマーク - - - - Fm::PlacesView - - - Empty Trash - ゴミ箱を空にする - - - Rename - 名前を変更 - - - Delete - 削除 - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - アンマウント - - - - Mount - マウント - - - - Eject - 取出し - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - 種類: %1 -サイズ: %2 -更新日時: %3 - - - - Type: %1 -Modified: %2 - 種類: %1 -更新日時: %2 - - - - Type: %1 -Modified: %3 - 種類: %1 -更新日時: %3 - - - - &Overwrite - 上書き(&O) - - - - &Rename - 名前を変更(&R) - - - - Fm::SidePane - - - - Places - 場所 - - - - - Directory Tree - ディレクトリーツリー - - - - Shows list of common places, devices, and bookmarks in sidebar - サイドバーに、一般的な場所およびデバイス、ブックマークのリストを表示 - - - - Shows tree of directories in sidebar - サイドバーにディレクトリーツリーを表示 - - - - MountOperationPasswordDialog - - - Mount - マウント - - - - Connect &anonymously - 匿名で接続(&A) - - - - Connect as u&ser: - ユーザーとして接続(&U) - - - - &Username: - ユーザー名(&U): - - - - &Password: - &パスワード(&P): - - - - &Domain: - &ドメイン(&D): - - - - Forget password &immediately - パスワードを記憶させない - - - - Remember password until you &logout - パスワードをログアウトするまで記憶させる - - - - Remember &forever - パスワードを恒久的に記憶させる - - - - QObject - - - - - - Error - エラー - - - - Rename File - ファイル名を変更 - - - - Please enter a new name: - 新しい名前を入力してください: - - - - Create Folder - - - - - Please enter a new file name: - 新規ファイルの名前を入力してください: - - - - New text file - 新規テキストファイル - - - - Please enter a new folder name: - 新規フォルダの名前を入力してください: - - - - New folder - 新規フォルダー - - - - Enter a name for the new %1: - 新しい %1 の名前を入力してください: - - - - Create File - ファイル作成 - - - - RenameDialog - - - Confirm to replace files - ファイルの置換えを確認 - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">この場所にはすでに、同じ名前のファイルがあります。</span></p><p>既存のファイルを置き換えますか?</p></body></html> - - - - dest - 送り先 - - - - with the following file? - 以下のファイルと置き換えますか? - - - - src file info - - - - - dest file info - 送り先のファイルの情報 - - - - src - 送り元のファイルの情報 - - - - &File name: - ファイル名(&F): - - - - Apply this option to all existing files - 既存のすべてのファイルにも適用する - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - プロパティー - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_lt_LT.ts b/libfm-qt/translations/libfm-qt_lt_LT.ts deleted file mode 100644 index 871fa6e..0000000 --- a/libfm-qt/translations/libfm-qt_lt_LT.ts +++ /dev/null @@ -1,1301 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - - - - - Installed Applications - - - - - Custom Command - - - - - Command line to execute: - - - - - Application name: - - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - - - - - Keep terminal window open after command execution - - - - - Execute in terminal emulator - - - - - Set selected application as default action of this file type - - - - - EditBookmarksDialog - - - Edit Bookmarks - Redaguoti žymeles - - - - Name - Pavadinimas - - - - Location - Vieta - - - - &Add Item - &Pridėti elementą - - - - &Remove Item - &Pašalinti elementą - - - - Use drag and drop to reorder the items - Failų tvarkai pakeisti naudokite vilkimą - - - - ExecFileDialog - - - Execute file - - - - - &Open - - - - - E&xecute - - - - - Execute in &Terminal - - - - - Cancel - Atšaukti - - - - FileOperationDialog - - - Destination: - Paskirties vieta: - - - - Processing: - Apdorojama: - - - - Preparing... - Ruošiamasi... - - - - Progress - Eiga - - - - Time remaining: - Liko laiko: - - - - FilePropsDialog - - - File Properties - Failo savybės - - - - General - Bendra - - - - Location: - Vieta: - - - - File type: - Failo tipas: - - - - Mime type: - Mime tipas: - - - - File size: - Failo dydis: - - - - On-disk size: - Dydis diske: - - - - Last modified: - Paskutinis pakeitimas: - - - - Link target: - Nuorodos tikslas: - - - - Open With: - Atverti su: - - - - Last accessed: - Paskutinį kartą naudota: - - - - Permissions - Leidimai - - - - Ownership - Nuosavybė - - - - - - Group: - Grupė: - - - - - - Owner: - Savininkas: - - - - Access Control - Prieigos kontrolė - - - - - Other: - Kita: - - - - Make the file executable - Padaryti failą vykdomu - - - - - - Read - Skaityti - - - - - - Write - Rašyti - - - - - - Execute - Vykdyti - - - - Sticky - Lipnus - - - - SetUID - Nustatyti UID - - - - SetGID - Nustatyti GID - - - - Advanced Mode - Išsamus režimas - - - - Fm::AppChooserComboBox - - - Customize - - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - - - - - Fm::CreateNewMenu - - - Folder - Aplankas - - - - Blank File - - - - - Fm::DirTreeModel - - - Loading... - - - - - <No sub folders> - - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Kopijuoti čia - - - - Move here - Perkelti čia - - - Create symlink here - symlink=symbolic link - Sukurti simbolinę nuorodą - - - - Cancel - Atšaukti - - - - Create symlink here - Sukurti simbolinę nuorodą - - - - Fm::EditBookmarksDialog - - - New bookmark - Nauja žymelė - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - - - - - This file '%1' is executable. Do you want to execute it? - - - - - Fm::FileMenu - - - Open - Atverti - - - OpenWith - Atverti su - - - - Cut - Iškirpti - - - - Copy - Kopijuoti - - - - Paste - Įklijuoti - - - - - &Move to Trash - &Perkelti į šiukšlinę - - - - &Delete - &Pašalinti - - - - Rename - Pervadinti - - - - Create &New - &Kurti naują - - - - Extract to... - Išskleisti į... - - - - Extract Here - Išskleisti čia - - - - Compress - Archyvuoti - - - - Properties - Savybės - - - - Open With... - - - - - Other Applications - - - - - Output - - - - - &Restore - - - - - Fm::FileOperation - - - - Confirm - Patvirtinti - - - - Do you want to delete the selected files? - Ar norite ištrinti pasirinktus failus? - - - - Do you want to move the selected files to trash can? - Ar norite perkelti pasirinktus failus į šiukšlinę? - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Kai kurie failai negali būti išmesti į šiukšlinę, nes failų sistema to nepalaiko. -Ar norite vietoje to juos pašalinti visam laikui? - - - - Error - Klaida - - - - Fm::FileOperationDialog - - - Move files - Perkelti failus - - - - Moving the following files to destination folder: - Šie failai perkeliami į paskirties aplanką: - - - - Copy Files - Kopijuoti failus - - - - Copying the following files to destination folder: - Šie failai kopijuojami į paskirties aplanką: - - - - Trash Files - Išmesti failus į šiukšliadėžę - - - - Moving the following files to trash can: - Failai perkeliami į šiukšliadėžę: - - - - Delete Files - Pašalinti failus - - - - Deleting the following files - Šalinami šie failai - - - Create Symlinks - symlink=symbolic link - Sukurti simbolinę nuorodą - - - - Creating symlinks for the following files: - Šiems failams kuriamos simbolinės nuorodos: - - - - Change Attributes - Keisti atributus - - - - Changing attributes of the following files: - Keičiami šių failų atributai: - - - - Restore Trashed Files - Atstatyti ištrintus failus - - - - Restoring the following files from trash can: - Šie failai atstatomi iš šiukšliadėžės: - - - - Error - Klaida - - - - Create Symlinks - Sukurti simbolinę nuorodą - - - - Fm::FilePropsDialog - - - View folder content - Žiūrėti aplanko turinį - - - - View and modify folder content - Žiūrėti ir keisti aplanko turinį - - - - Read - Skaityti - - - - Read and write - Skaityti ir rašyti - - - - Forbidden - Uždrausta - - - - Files of different types - Skirtingų tipų failai - - - - Multiple Files - Keli failai - - - - Apply changes - Pritaikyti pakeitimus - - - - Do you want to recursively apply these changes to all files and sub-folders? - Ar norite rekursyviai pritaikyti šiuos pakeitimus visiems failams ir poaplankiams? - - - - Fm::FileSearchDialog - - - Error - Klaida - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - &Kurti naują - - - - &Paste - Į&klijuoti - - - - Select &All - Pasirinkti &viską - - - - Invert Selection - Invertuoti pasirinkimą - - - - Sorting - Rikiavimas - - - - Show Hidden - Rodyti paslėptus - - - - Folder Pr&operties - Failo &savybės - - - Folder - Aplankas - - - File - Failas - - - - By File Name - Pagal failo vardą - - - - By Modification Time - Pagal keitimo datą - - - - By File Size - Pagal failo dydį - - - - By File Type - Pagal failo tipą - - - - By File Owner - Pagal failo savininką - - - - Ascending - Didėjančiai - - - - Descending - Mažėjančiai - - - - Folder First - Pirmiausia aplankai - - - - Case Sensitive - Skirti raidžių dydį - - - - Fm::FolderModel - - - Name - Pavadinimas - - - - Type - Tipas - - - - Size - Dydis - - - - Modified - Pakeista - - - - Owner - Savininkas - - - - Fm::FontButton - - - Bold - Paryškintas - - - - Italic - Kursyvinis - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Prisijungti - - - - Fm::PlacesModel - - - Desktop - Darbastalis - - - - Trash - Šiukšlinė - - - - Computer - Kompiuteris - - - - Applications - Programos - - - - Network - Tinklas - - - - Places - - - - - Devices - - - - - Bookmarks - - - - - Fm::PlacesView - - Rename - Pervadinti - - - Delete - Šalinami failai - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Atjungti - - - - Mount - Prijungti - - - - Eject - Išstumti - - - - Empty Trash - - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Tipas: %1 -Dydis: %2 -Keista: %3 - - - - Type: %1 -Modified: %3 - Tipas: %1 -Keista: %3 - - - - &Overwrite - &Perrašyti - - - - &Rename - Pe&rvadinti - - - - Type: %1 -Modified: %2 - Tipas: %1 -Keista: %2 {1 -?} - - - - Fm::SidePane - - - - Places - - - - - - Directory Tree - - - - - Shows list of common places, devices, and bookmarks in sidebar - - - - - Shows tree of directories in sidebar - - - - - MountOperationPasswordDialog - - - Mount - Prijungti - - - - Connect &anonymously - Prisijungti &anonimiškai - - - - Connect as u&ser: - Prisijungti kaip nau&dotojui: - - - - &Username: - &Naudotojo vardas: - - - - &Password: - &Slaptažodis: - - - - &Domain: - &Domenas: - - - - Forget password &immediately - &Neįsiminti slaptažodžio - - - - Remember password until you &logout - &Atsiminti slaptažodį iki atsijungsite - - - - Remember &forever - Prisiminti &visam laikui - - - - QObject - - - - - - Error - Klaida - - - - Rename File - Pervadinti failą - - - - Please enter a new name: - Įveskite naują pavadinimą: - - - - Create Folder - - - - - Please enter a new file name: - Įveskite naują failo pavadinimą: - - - - New text file - Naujas tekstinis failas - - - - Please enter a new folder name: - Įveskite naują failo pavadinimą: - - - - New folder - Naujas aplankas - - - - Create File - Sukurti failą - - - - Enter a name for the new %1: - - - - - RenameDialog - - - Confirm to replace files - Patvirtinti failų pakeitimą - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Šiame aplanke jau yra failas tokiu pačiu pavadinimu.</span></p><p>Ar norite pakeisti esamą failą?</p></body></html> - - - - dest - paskirtis - - - - with the following file? - šiuo failu? - - - - src file info - šaltinio failo informacija - - - - dest file info - paskirties failo informacija - - - - src - šaltinis - - - - &File name: - &Failo pavadinimas: - - - - Apply this option to all existing files - Pritaikyti šią nuostatą visiems failams - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Savybės - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_pl.ts b/libfm-qt/translations/libfm-qt_pl.ts deleted file mode 100644 index 770d870..0000000 --- a/libfm-qt/translations/libfm-qt_pl.ts +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Wybór programu - - - - Installed Applications - Zainstalowane programy - - - - Custom Command - Własny wiersz poleceń - - - - Command line to execute: - Wiersz poleceń do wykonania: - - - - Application name: - Nazwa programu: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>W wierszu poleceń można użyć następujących oznaczeń:</b> -<ul> -<li><b>%f</b>: nazwa pierwszego z zaznaczonych plików</li> -<li><b>%F</b>: nazwy wszystkich zaznaczonych plików</li> -<li><b>%u</b>: ścieżka pierwszego z zaznaczonych plików</li> -<li><b>%U</b>: ścieżki wszystkich zaznaczonych plików</li> -</ul> - - - - Keep terminal window open after command execution - Zachowanie otwartego terminala po wykonaniu polecenia - - - - Execute in terminal emulator - Uruchomienie w emulatorze terminala - - - - Set selected application as default action of this file type - Ustaw wybrany program jako domyślną akcję dla tego typu plików - - - - EditBookmarksDialog - - - Edit Bookmarks - Edycja zakładek - - - - Name - Nazwa - - - - Location - Położenie - - - - &Add Item - &Dodaj - - - - &Remove Item - &Usuń - - - - Use drag and drop to reorder the items - Przeciągnij i upuść aby zmienić kolejność - - - - ExecFileDialog - - - Execute file - Uruchom - - - - &Open - &Otwórz - - - - E&xecute - &Uruchom - - - - Execute in &Terminal - Uruchom w &terminalu - - - - Cancel - Anuluj - - - - FileOperationDialog - - - Destination: - Cel: - - - - Processing: - Przetwarzanie: - - - - Preparing... - Przygotowanie... - - - - Progress - Postęp - - - - Time remaining: - Pozostały czas: - - - - FilePropsDialog - - - File Properties - Właściwości pliku - - - - General - Ogólne - - - - Location: - Położenie: - - - - File type: - Typ pliku: - - - - Mime type: - Typ mime: - - - - File size: - Rozmiar pliku: - - - - On-disk size: - Rozmiar na dysku: - - - - Last modified: - Ostatnia modyfikacja: - - - - Link target: - Położenie docelowe: - - - - Open With: - Otwieranie za pomocą: - - - - Last accessed: - Ostatni dostęp: - - - - Permissions - Uprawnienia - - - - Ownership - Właściciel - - - - - - Group: - Grupa: - - - - - - Owner: - Właściciel: - - - - Access Control - Prawa dostępu - - - - - Other: - Inni: - - - - Make the file executable - Ustaw prawo wykonywalności - - - - - - Read - Odczyt - - - - - - Write - Zapis - - - - - - Execute - Wykonanie - - - - Sticky - Sticky - - - - SetUID - SetUID - - - - SetGID - SetGID - - - - Advanced Mode - Zaawansowane - - - - Fm::AppChooserComboBox - - - Customize - Dostosuj - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - WYbierz program do otwarcia "%1" plików - - - - Fm::CreateNewMenu - - - Folder - Katalog - - - - Blank File - Pusty plik - - - - Fm::DirTreeModel - - - Loading... - Wczytywanie... - - - - <No sub folders> - <Brak katalogów> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Kopiuj tutaj - - - - Move here - Przenieś tutaj - - - - Create symlink here - Utwórz dowiązanie symboliczne - - - - Cancel - Anuluj - - - - Fm::EditBookmarksDialog - - - New bookmark - Nowa zakładka - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Plik tekstowy '%1' wygląda na wykonywalny skrypt. -Co chcesz zrobić z tym plikiem? - - - - This file '%1' is executable. Do you want to execute it? - Plik '%1' jest wykonywalny. Czy chcesz go uruchomić? - - - - Fm::FileMenu - - - Open - Otwórz - - - - Create &New - Utwórz &nowy - - - - &Restore - &Przywróć - - - - Cut - Wytnij - - - - Copy - Kopiuj - - - - Paste - Wklej - - - - - &Move to Trash - Przenieś do &kosza - - - - Output - Wyjście - - - - &Delete - &Usuń - - - - Rename - Zmień nazwę - - - - Open With... - Otwórz za pomocą... - - - - Other Applications - Inny program - - - - Extract to... - Rozpakuj do... - - - - Extract Here - Rozpakuj tutaj - - - - Compress - Skompresuj - - - - Properties - Właściwości - - - - Fm::FileOperation - - - Error - Błąd - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Niektóre pliki nie mogą zostać przeniesione do kosza ponieważ system plików nie obsługuje takiej operacji. -Czy zamiast tego usunąć te pliki? - - - - - Confirm - Potwierdź - - - - Do you want to delete the selected files? - Czy chcesz usunąć wybrane pliki? - - - - Do you want to move the selected files to trash can? - Czy chcesz przenieść wybrane pliki do kosza? - - - - Fm::FileOperationDialog - - - Move files - Przenoszenie plików - - - - Moving the following files to destination folder: - Przenoszenie następujących plików do katalogu docelowego: - - - - Copy Files - Kopiowanie plików - - - - Copying the following files to destination folder: - Kopiowanie następujących plików do katalogu docelowego: - - - - Trash Files - Przenoszenie plików do kosza - - - - Moving the following files to trash can: - Przenoszenie następujących plików do kosza: - - - - Delete Files - Usuwanie plików - - - - Deleting the following files - Usuwanie następujących plików - - - - Create Symlinks - Tworzenie dowiązań symbolicznych - - - - Creating symlinks for the following files: - Tworzenie dowiązań dla następujących plików: - - - - Change Attributes - Zmiana uprawnień - - - - Changing attributes of the following files: - Zmiana uprawnień dla następujących plików: - - - - Restore Trashed Files - Przywracanie plików z kosza - - - - Restoring the following files from trash can: - Przywracanie następujących plików z kosza: - - - - Error - Błąd - - - - Fm::FilePropsDialog - - - View folder content - Wyświetlanie zawartości - - - - View and modify folder content - Wyświetlanie i modyfikowanie zawartości - - - - Read - Odczyt - - - - Read and write - Odczyt i zapis - - - - Forbidden - Zabronione - - - - Files of different types - Pliki różnego typu - - - - Multiple Files - Wiele plików - - - - Apply changes - Zastosuj zmiany - - - - Do you want to recursively apply these changes to all files and sub-folders? - Czy chcesz rekursywnie zastosować zmiany do wszystkich plików i podkatalogów? - - - - Fm::FileSearchDialog - - - Error - Błąd - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Utwórz &nowy - - - - &Paste - &Wklej - - - - Select &All - Z&aznacz wszystko - - - - Invert Selection - Odwróć zaznaczenie - - - - Sorting - Sortowanie - - - - Show Hidden - Wyświetlanie ukrytych plików - - - - Folder Pr&operties - Właściwości &katalogu - - - Folder - Katalog - - - Blank File - Pusty plik - - - - By File Name - Według nazwy - - - - By Modification Time - Według czasu modyfikacji - - - - By File Size - Według rozmiaru - - - - By File Type - Według typu - - - - By File Owner - Wedłuh właściciela pliku - - - - Ascending - Rosnąco - - - - Descending - Malejąco - - - - Folder First - Najpierw katalogi - - - - Case Sensitive - Uwzględnij wielkość liter - - - - Fm::FolderModel - - - Name - Nazwa - - - - Type - Typ - - - - Size - Rozmiar - - - - Modified - Zmodyfikowany - - - - Owner - Właściciel - - - - Fm::FontButton - - - Bold - Pogrubienie - - - - Italic - Kursywa - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Podłącz - - - - Fm::PlacesModel - - - Places - Położenia - - - - Desktop - Pulpit - - - - Trash - Kosz - - - - Computer - Komputer - - - - Applications - Programy - - - - Network - Sieć - - - - Devices - Urządzenia - - - - Bookmarks - Zakładki - - - - Fm::PlacesView - - - Empty Trash - Opróżnij kosz - - - Rename - Zmień nazwę - - - Delete - Usuń - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Odmontuj - - - - Mount - Montuj - - - - Eject - Wysuń - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Typ: %1 -Rozmiar: %2 -Zmodyfikowany: %3 - - - - Type: %1 -Modified: %2 - Typ: %1 -Zmodyfikowany: %2 - - - - Type: %1 -Modified: %3 - Typ: %1 -Zmodyfikowany: %3 - - - - &Overwrite - &Nadpisz - - - - &Rename - &Zmień nazwę - - - - Fm::SidePane - - - - Places - Położenia - - - - - Directory Tree - Drzewo katalogów - - - - Shows list of common places, devices, and bookmarks in sidebar - Pokazuje listę miejsc, urządzeń oraz zakładek w panelu bocznym - - - - Shows tree of directories in sidebar - Pokazuje drzewo katalogów w panelu bocznym - - - - MountOperationPasswordDialog - - - Mount - Montowanie - - - - Connect &anonymously - Połącz &anonimowo - - - - Connect as u&ser: - Połącz jako &użytkownik: - - - - &Username: - &Użytkownik: - - - - &Password: - &Hasło: - - - - &Domain: - &Domena: - - - - Forget password &immediately - Zapomnij hasło &od razu - - - - Remember password until you &logout - &Pamiętaj hasło do wylogowania - - - - Remember &forever - Pamiętaj na &zawsze - - - - QObject - - - - - - Error - Błąd - - - - Rename File - Zmiana nazwy - - - - Please enter a new name: - Podaj nową nazwę: - - - - Create Folder - - - - - Please enter a new file name: - Podaj nazwę pliku: - - - - New text file - Nowy plik tekstowy - - - - Please enter a new folder name: - POdaj nazwę nowego katalogu: - - - - New folder - Nowy katalog - - - - Enter a name for the new %1: - Podaj nazwę dla pliku %1: - - - - Create File - Utwórz plik - - - - RenameDialog - - - Confirm to replace files - Potwierdź aby nadpisać pliki - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Plik o podanej nazwie już istnieje w katalogu docelowym.</span></p><p>Czy chcesz nadpisać istniejący plik?</p></body></html> - - - - dest - - - - - with the following file? - następującym plikiem? - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - &Nazwa pliku: - - - - Apply this option to all existing files - Zastosuj do wszystkich plików - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Właściwości - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_pt.ts b/libfm-qt/translations/libfm-qt_pt.ts deleted file mode 100644 index f76a202..0000000 --- a/libfm-qt/translations/libfm-qt_pt.ts +++ /dev/null @@ -1,1301 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Escolha uma aplicação - - - - Installed Applications - Aplicações instaladas - - - - Custom Command - Comando personalizado - - - - Command line to execute: - Linha de comandos a executar: - - - - Application name: - Nome da aplicação: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Pode utilizar os seguintes códigos na linha de comandos:</b> -<ul> -<li><b>%f</b>: é o nome de um ficheiro</li> -<li><b>%F</b>: é o nome de vários ficheiros</li> -<li><b>%u</b>: é o URI do ficheiro</li> -<li><b>%U</b>: é o URI de vários ficheiros</li> -</ul> - - - - Keep terminal window open after command execution - Manter janela de terminal aberta depois de executar o comando - - - - Execute in terminal emulator - Executar no emulador de terminal - - - - Set selected application as default action of this file type - Utilizar a aplicação selecionada como pré-definida para este tipo de ficheiro - - - - EditBookmarksDialog - - - Edit Bookmarks - Editar marcadores - - - - Name - Nome - - - - Location - Localização - - - - &Add Item - &Adicionar item - - - - &Remove Item - &Remover item - - - - Use drag and drop to reorder the items - Arraste e largue para organizar itens - - - - ExecFileDialog - - - Execute file - Executar ficheiro - - - - &Open - &Abrir - - - - E&xecute - E&xecutar - - - - Execute in &Terminal - Executar no &terminal - - - - Cancel - Cancelar - - - - FileOperationDialog - - - Destination: - Destino: - - - - Processing: - Processamento: - - - - Preparing... - Preparação... - - - - Progress - Evolução - - - - Time remaining: - Tempo restante: - - - - FilePropsDialog - - - File Properties - Propriedades do ficheiro - - - - General - Geral - - - - Location: - Localização: - - - - File type: - Tipo de ficheiro: - - - - Mime type: - Tipo MIME: - - - - File size: - Tamanho do ficheiro: - - - - On-disk size: - Tamanho no disco: - - - - Last modified: - Última modificação: - - - - Link target: - Destino da ligação: - - - - Open With: - Abrir com: - - - - Last accessed: - Último acesso: - - - - Permissions - Pemissões - - - - Ownership - Propriedade - - - - - - Group: - Grupo: - - - - - - Owner: - Dono: - - - - Access Control - Controlo de acesso - - - - - Other: - Outro: - - - - Make the file executable - Marcar como executável - - - - - - Read - Leitura - - - - - - Write - Escrita - - - - - - Execute - Execução - - - - Sticky - Fixo - - - - SetUID - Definir UID - - - - SetGID - Definir GID - - - - Advanced Mode - Modo avançado - - - - Fm::AppChooserComboBox - - - Customize - Personalizar - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Selecione uma aplicação para abrir os ficheiros %1 - - - - Fm::CreateNewMenu - - - Folder - Pasta - - - - Blank File - Ficheiro vazio - - - - Fm::DirTreeModel - - - Loading... - A carregar... - - - - <No sub folders> - <Não existem subpastas> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - Copiar para aqui - - - - Move here - Mover para aqui - - - - Create symlink here - Criar ligação simbólica aqui - - - - Cancel - Cancelar - - - - Fm::EditBookmarksDialog - - - New bookmark - Novo marcador - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Parece que o ficheiro de texto %1 é um script executável. -O que pretende fazer com o ficheiro? - - - - This file '%1' is executable. Do you want to execute it? - O ficheiro %1 é um executável. Pretende executar o ficheiro? - - - - Fm::FileMenu - - - Open - Abrir - - - OpenWith - Abrir com - - - - Cut - Cortar - - - - Copy - Copiar - - - - Paste - Colar - - - - - &Move to Trash - &Mover para o lixo - - - - Output - Destino - - - - &Delete - &Eliminar - - - - Rename - Mudar nome - - - - Open With... - Abrir com... - - - - Other Applications - Outras aplicações - - - - Create &New - Criar &novo(a) - - - - &Restore - &Restaurar - - - - Extract to... - Extrair para... - - - - Extract Here - Extrair aqui - - - - Compress - Comprimir - - - - Properties - Propriedades - - - - Fm::FileOperation - - - Error - Erro - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Alguns ficheiros não podem ser movidos para o lixo porque o sistema de ficheiros não suporta esta operação. -Eliminar permanentemente? - - - - - Confirm - Confirmação - - - - Do you want to delete the selected files? - Quer mesmo eliminar o(s) ficheiro(s) selecionado(s)? - - - - Do you want to move the selected files to trash can? - Quer mesmo mover o(s) ficheiro(s) selecionado(s) para o lixo? - - - - Fm::FileOperationDialog - - - Move files - Mover ficheiros - - - - Moving the following files to destination folder: - A mover os ficheiros para a pasta de destino: - - - - Copy Files - Copiar ficheiros - - - - Copying the following files to destination folder: - A copiar os ficheiros para a pasta de destino: - - - - Trash Files - Destruir ficheiros - - - - Moving the following files to trash can: - A mover os ficheiros para o lixo: - - - - Delete Files - Eliminar ficheiros - - - - Deleting the following files - A eliminar estes ficheiros - - - - Create Symlinks - Criar ligações simbólicas - - - - Creating symlinks for the following files: - A criar ligações simbólicas a estes ficheiros: - - - - Change Attributes - Alterar atributos - - - - Changing attributes of the following files: - A alterar os atributos destes ficheiros: - - - - Restore Trashed Files - Restaurar ficheiros eliminados - - - - Restoring the following files from trash can: - Restaurar estes ficheiros do lixo: - - - - Error - Erro - - - - Fm::FilePropsDialog - - - View folder content - Ver conteúdo da pasta - - - - View and modify folder content - Ver e modificar conteúdo da pasta - - - - Read - Leitura - - - - Read and write - Leitura e escrita - - - - Forbidden - Proibido - - - - Files of different types - Ficheiros de outro tipo - - - - Multiple Files - Vários ficheiros - - - - Apply changes - Aplicar alterações - - - - Do you want to recursively apply these changes to all files and sub-folders? - Pretende aplicar as alterações a todos os ficheiros e subpastas? - - - - Fm::FileSearchDialog - - - Error - Erro - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - Criar &novo(a) - - - - &Paste - Co&lar - - - - Select &All - Selecion&ar tudo - - - - Invert Selection - Inverter seleção - - - - Sorting - Ordenação - - - - Show Hidden - Mostrar ocultos - - - - Folder Pr&operties - Pr&opriedades da pasta - - - Folder - Pasta - - - File - Ficheiro - - - Blank File - Ficheiro vazio - - - - By File Name - Por nome de ficheiro - - - - By Modification Time - Por data de modificação - - - - By File Size - Por tamanho de ficheiro - - - - By File Type - Por tipo de ficheiro - - - - By File Owner - Por dono de ficheiro - - - - Ascending - Ascendente - - - - Descending - Descendente - - - - Folder First - Pastas no início - - - - Case Sensitive - Diferenciar capitalização - - - - Fm::FolderModel - - - Name - Nome - - - - Type - Tipo - - - - Size - Tamanho - - - - Modified - Modificado - - - - Owner - Dono - - - - Fm::FontButton - - - Bold - Negrito - - - - Italic - Itálico - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Ligar - - - - Fm::PlacesModel - - - Places - Locais - - - - Desktop - Área de trabalho - - - - Trash - Lixo - - - - Computer - Computador - - - - Applications - Aplicações - - - - Network - Rede - - - - Devices - Dispositivos - - - - Bookmarks - Marcadores - - - - Fm::PlacesView - - - Empty Trash - Esvaziar lixo - - - Rename - Mudar nome - - - Delete - Eliminar - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - Desmontar - - - - Mount - Montar - - - - Eject - Ejetar - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Tipo: %1 -Tamanho: %2 -Modificado: %3 - - - - Type: %1 -Modified: %2 - Tipo: %1 -Modificado: %2 - - - - Type: %1 -Modified: %3 - Tipo: %1 -Modificado: %3 - - - - &Overwrite - &Substituir - - - - &Rename - &Mudar nome - - - - Fm::SidePane - - - - Places - Locais - - - - - Directory Tree - Árvore de diretórios - - - - Shows list of common places, devices, and bookmarks in sidebar - Mostra a lista de locais, dispositivos e marcadores na barra lateral - - - - Shows tree of directories in sidebar - Mostra a árvore de diretórios na barra lateral - - - - MountOperationPasswordDialog - - - Mount - Montar - - - - Connect &anonymously - Ligar &anonimamente - - - - Connect as u&ser: - Ligar com utili&zador: - - - - &Username: - Nome de &utilizador: - - - - &Password: - &Senha: - - - - &Domain: - &Domínio: - - - - Forget password &immediately - Esquecer senha &imediatamente - - - - Remember password until you &logout - Memorizar sen&ha até fechar a sessão - - - - Remember &forever - Memorizar &eternamente - - - - QObject - - - - - - Error - Erro - - - - Rename File - Mudar nome do ficheiro - - - - Please enter a new name: - Introduza o novo nome: - - - - Create Folder - - - - - Please enter a new file name: - Introduza o nome do ficheiro: - - - - New text file - Novo ficheiro de texto - - - - Please enter a new folder name: - Introduza o nome da pasta: - - - - New folder - Nova pasta - - - - Enter a name for the new %1: - Introduza o nome para %1: - - - - Create File - Criar ficheiro - - - - RenameDialog - - - Confirm to replace files - Confirmação de substituição - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">Já existe um ficheiro com o mesmo nome nesta localização.</span></p><p>Pretende substituir o ficheiro existente</p></body></html> - - - - dest - destino - - - - with the following file? - por este? - - - - src file info - informações do ficheiro de origem - - - - dest file info - informações do ficheiro de destino - - - - src - origem - - - - &File name: - Nome do &ficheiro: - - - - Apply this option to all existing files - Aplicar opção a todos os ficheiros existentes - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - Propriedades - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/translations/libfm-qt_ru.ts b/libfm-qt/translations/libfm-qt_ru.ts deleted file mode 100644 index d46fa4e..0000000 --- a/libfm-qt/translations/libfm-qt_ru.ts +++ /dev/null @@ -1,1277 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Выбрать приложение - - - - Installed Applications - Установленные приложения - - - - Custom Command - Своя команда - - - - Command line to execute: - Выполняемая командная строка: - - - - Application name: - Имя приложения: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Эти спец. коды могут быть использованы в командной строке:</b> -<ul> -<li><b>%f</b>: Означает имя одного файла</li> -<li><b>%F</b>: Означает имена нескольких файлов</li> -<li><b>%u</b>: Означает один URI файла</li> -<li><b>%U</b>: Означает несколько URI файлов</li> -</ul> - - - - Keep terminal window open after command execution - Держать окно терминала открытым после выполнения команды - - - - Execute in terminal emulator - Запустить в эмуляторе терминала - - - - Set selected application as default action of this file type - Использовать выбранное приложение как действие по умолчанию для файлов этого типа - - - - EditBookmarksDialog - - - Edit Bookmarks - Изменить закладки - - - - Name - Имя - - - - Location - Расположение - - - - &Add Item - &Добавить пункт - - - - &Remove Item - &Удалить пункт - - - - Use drag and drop to reorder the items - Используйте перетаскивание и отпускание для переупорядочивания пунктов - - - - ExecFileDialog - - - Execute file - Выполнить файл - - - - &Open - &Открыть - - - - E&xecute - В&ыполнить - - - - Execute in &Terminal - Выполнить в &терминале - - - - Cancel - Отмена - - - - FileOperationDialog - - - Destination: - Назначение: - - - - Processing: - Обработка: - - - - Preparing... - Подготовка... - - - - Progress - Прогресс - - - - Time remaining: - Времени осталось: - - - - FilePropsDialog - - - File Properties - Свойства файла - - - - General - Общие - - - - Location: - Расположение: - - - - File type: - Тип файла: - - - - Mime type: - Тип Mime: - - - - File size: - Размер файла: - - - - On-disk size: - Размер на диске: - - - - Last modified: - Последнее изменение: - - - - Link target: - Цель ссылки: - - - - Open With: - Открыть с помощью: - - - - Last accessed: - Последний доступ: - - - - Permissions - Разрешения - - - - Ownership - Владение - - - - - - Group: - Группа: - - - - - - Owner: - Владелец: - - - - Access Control - Контроль доступа - - - - - Other: - Остальные: - - - - Make the file executable - Сделать файл исполняемым - - - - - - Read - Чтение - - - - - - Write - Запись - - - - - - Execute - Выполнение - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - Расширенный режим - - - - Fm::AppChooserComboBox - - - Customize - Настроить - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Выберите приложение, чтобы открыть "%1" файлов - - - - Fm::CreateNewMenu - - - Folder - Папку - - - - Blank File - Пустой файл - - - - Fm::DirTreeModel - - - Loading... - Загрузка... - - - - <No sub folders> - <Нет подпапок> - - - - Fm::DirTreeView - - - Open in New T&ab - Открыть в новой вкл&адке - - - - Open in New Win&dow - Открыть в новом о&кне - - - - Open in Termina&l - Открыть в термина&ле - - - - Fm::DndActionMenu - - - Copy here - Копировать сюда - - - - Move here - Переместить сюда - - - - Create symlink here - Создать здесь ссылку - - - - Cancel - Отмена - - - - Fm::EditBookmarksDialog - - - New bookmark - Новая закладка - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Этот текстовый файл '%1' похож на исполняемый скрипт. -Что вы хотите с ним сделать? - - - - This file '%1' is executable. Do you want to execute it? - Это исполняемый файл '%1' . Вы хотите выполнить его? - - - - Fm::FileMenu - - - Open - Открыть - - - - Open With... - Открыть с помощью... - - - - Other Applications - Другие приложения - - - - Create &New - &Создать - - - - &Restore - &Восстановить - - - - Cut - Вырезать - - - - Copy - Копировать - - - - Paste - Вставить - - - - - &Move to Trash - &Переместить в корзину - - - - Rename - Переименовать - - - - Extract to... - Распаковать в ... - - - - Extract Here - Распаковать здесь - - - - Compress - Сжать - - - - Properties - Свойства - - - - Output - Вывод - - - - &Delete - &Удалить - - - - Fm::FileOperation - - - Error - Ошибка - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Некоторые файлы не могут быть помещены в корзину, поскольку файловая система не поддерживает эту операцию. -Вы всё равно хотите их удалить? - - - - - Confirm - Подтвердить - - - - Do you want to delete the selected files? - Вы действительно хотите удалить выбранные файлы? - - - - Do you want to move the selected files to trash can? - Переместить выбранные файлы в корзину? - - - - Fm::FileOperationDialog - - - Move files - Перемещение файлов - - - - Moving the following files to destination folder: - Перемещение следующих файлов в папку назначения: - - - - Copy Files - Копирование файлов - - - - Copying the following files to destination folder: - Копирование следующих файлов в папку назначения: - - - - Trash Files - Перемещение в корзину файлов - - - - Moving the following files to trash can: - Перемещение следующих файлов в корзину: - - - - Delete Files - Удалить файлы - - - - Deleting the following files - Удаление следующих файлов - - - - Create Symlinks - Создание ссылок - - - - Creating symlinks for the following files: - Создание ссылок на следующие файлы: - - - - Change Attributes - Изменение атрибутов - - - - Changing attributes of the following files: - Изменение атрибутов следующих файлов: - - - - Restore Trashed Files - Восстановить файлы из корзины - - - - Restoring the following files from trash can: - Восстановление следующих файлов из корзины: - - - - Error - Ошибка - - - - Fm::FilePropsDialog - - - View folder content - Просмотр содержимого папки - - - - View and modify folder content - Просмотр и изменение содержимого папки - - - - Read - Чтение - - - - Read and write - Чтение и запись - - - - Forbidden - Запрет - - - - Files of different types - Файлы разного типа - - - - Multiple Files - Несколько файлов - - - - Apply changes - Применить изменения - - - - Do you want to recursively apply these changes to all files and sub-folders? - Применить изменения рекурсивно ко всем файлам и подпапкам? - - - - Fm::FileSearchDialog - - - Error - Ошибка - - - - You should add at least add one directory to search. - Вы должны добавить не менее одного места для поиска. - - - - Select a folder - Выберите папку - - - - Fm::FolderMenu - - - Create &New - &Создать - - - - &Paste - &Вставить - - - - Select &All - Выбрать &всё - - - - Invert Selection - Инвертировать выделение - - - - Sorting - Сортировка - - - - Show Hidden - Показать скрытые - - - - Folder Pr&operties - &Свойства папки - - - - By File Name - По имени - - - - By Modification Time - По времени изменения - - - - By File Size - По размеру - - - - By File Type - По типу - - - - By File Owner - По владельцу - - - - Ascending - Возрастающая - - - - Descending - Убывающая - - - - Folder First - Сначала папки - - - - Case Sensitive - Регистрочувствительность - - - - Fm::FolderModel - - - Name - Имя - - - - Type - Тип - - - - Size - Размер - - - - Modified - Изменён - - - - Owner - Владелец - - - - Fm::FontButton - - - Bold - Жирный - - - - Italic - Курсив - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Соединить - - - - Fm::PlacesModel - - - Places - Места - - - - Desktop - Рабочий стол - - - - Computer - Компьютер - - - - Applications - Программы - - - - Network - Сеть - - - - Devices - Устройства - - - - Bookmarks - Закладки - - - - Trash - Корзина - - - - Fm::PlacesView - - - Empty Trash - Очистить корзину - - - - Open in New Tab - Открыть в новой вкладке - - - - Open in New Window - Открыть в новом окне - - - - Move Bookmark Up - Сдвинуть закладку вверх - - - - Move Bookmark Down - Сдвинуть закладку вниз - - - - Rename Bookmark - Переименовать закладку - - - - Remove Bookmark - Удалить закладку - - - - - Unmount - Отключить - - - - Mount - Подключить - - - - Eject - Извлечь - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Тип: %1 -Размер: %2 -Изменён: %3 - - - - Type: %1 -Modified: %2 - Тип: %1 -Изменён: %2 - - - - Type: %1 -Modified: %3 - Тип: %1 -Изменён: %3 - - - - &Overwrite - &Перезаписать - - - - &Rename - &Переименовать - - - - Fm::SidePane - - - - Places - Места - - - - - Directory Tree - Дерево папок - - - - Shows list of common places, devices, and bookmarks in sidebar - Показывает список обычных мест, устройств и закладок в боковой панели - - - - Shows tree of directories in sidebar - Показывает дерево папок в боковой панели - - - - MountOperationPasswordDialog - - - Mount - Подключить - - - - Connect &anonymously - Подсоединить &анонимно - - - - Connect as u&ser: - Подсоединить как &пользователь: - - - - &Username: - &Имя пользователя: - - - - &Password: - &Пароль: - - - - &Domain: - &Домен: - - - - Forget password &immediately - Забыть пароль &сразу - - - - Remember password until you &logout - Запомнить пароль пока вы не &вышли - - - - Remember &forever - Запомнить &навсегда - - - - QObject - - - - - - Error - Ошибка - - - - Rename File - Переименовать файл - - - - Please enter a new name: - Введите новое имя: - - - - Create Folder - Создать папку - - - - Please enter a new file name: - Введите имя нового файла: - - - - New text file - Новый текстовый файл - - - - Please enter a new folder name: - Введите имя новой папки: - - - - New folder - Новая папка - - - - Enter a name for the new %1: - Введите имя для нового %1: - - - - Create File - Создать файл - - - - RenameDialog - - - Confirm to replace files - Подтвердить замену файлов - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">В этом месте назначения уже есть файл с таким именем.</span></p><p>Вы хотите заменить существующий файл?</p></body></html> - - - - dest - - - - - with the following file? - следующим файлом? - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - &Имя файла: - - - - Apply this option to all existing files - Запомнить выбор для всех уже существующих файлов - - - - SearchDialog - - - Search Files - Искать файлы - - - - Name/Location - Имя/Расположение - - - - File Name Patterns: - Шаблоны имени файла: - - - - * - - - - - Case insensitive - Нечувствительный к регистру поиск - - - - Use regular expression - Использовать регулярные выражения - - - - Places to Search: - Места для поиска: - - - - &Add - &Добавить - - - - &Remove - &Удалить - - - - Search in sub directories - Искать в подпапках - - - - Search for hidden files - Искать скрытые файлы - - - - File Type - Тип файла - - - - Only search for files of following types: - Искать файлы только следующих типов: - - - - Text files - Текстовые файлы - - - - Image files - Изображения - - - - Audio files - Аудиофайлы - - - - Video files - Видеофайлы - - - - Documents - Документы - - - - Folders - Папки - - - - Content - Содержание - - - - File contains: - Файл содержит: - - - - Case insensiti&ve - Нечувствительн&ый к регистру поиск - - - - &Use regular expression - &Использовать регулярные выражения - - - - Properties - Свойства - - - - File Size: - Размер файла: - - - - Larger than: - Больше, чем: - - - - - Bytes - Байт - - - - - KiB - КиБ - - - - - MiB - МиБ - - - - - GiB - ГиБ - - - - Smaller than: - Меньше, чем: - - - - Last Modified Time: - Время последнего изменения: - - - - Earlier than: - Раньше, чем: - - - - Later than: - Позже, чем: - - - diff --git a/libfm-qt/translations/libfm-qt_ru_RU.ts b/libfm-qt/translations/libfm-qt_ru_RU.ts deleted file mode 100644 index 1d1d6fc..0000000 --- a/libfm-qt/translations/libfm-qt_ru_RU.ts +++ /dev/null @@ -1,1277 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - Выбрать приложение - - - - Installed Applications - Установленные приложения - - - - Custom Command - Своя команда - - - - Command line to execute: - Выполняемая командная строка: - - - - Application name: - Имя приложения: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>Эти спец. коды могут быть использованы в командной строке:</b> -<ul> -<li><b>%f</b>: Означает имя одного файла</li> -<li><b>%F</b>: Означает имена нескольких файлов</li> -<li><b>%u</b>: Означает один URI файла</li> -<li><b>%U</b>: Означает несколько URI файлов</li> -</ul> - - - - Keep terminal window open after command execution - Держать окно терминала открытым после выполнения команды - - - - Execute in terminal emulator - Запустить в эмуляторе терминала - - - - Set selected application as default action of this file type - Использовать выбранное приложение как действие по умолчанию для файлов этого типа - - - - EditBookmarksDialog - - - Edit Bookmarks - Изменить закладки - - - - Name - Имя - - - - Location - Расположение - - - - &Add Item - &Добавить пункт - - - - &Remove Item - &Удалить пункт - - - - Use drag and drop to reorder the items - Используйте перетаскивание и отпускание для переупорядочивания пунктов - - - - ExecFileDialog - - - Execute file - Выполнить файл - - - - &Open - &Открыть - - - - E&xecute - В&ыполнить - - - - Execute in &Terminal - Выполнить в &терминале - - - - Cancel - Отмена - - - - FileOperationDialog - - - Destination: - Назначение: - - - - Processing: - Обработка: - - - - Preparing... - Подготовка... - - - - Progress - Прогресс - - - - Time remaining: - Времени осталось: - - - - FilePropsDialog - - - File Properties - Свойства файла - - - - General - Общие - - - - Location: - Расположение: - - - - File type: - Тип файла: - - - - Mime type: - Тип Mime: - - - - File size: - Размер файла: - - - - On-disk size: - Размер на диске: - - - - Last modified: - Последнее изменение: - - - - Link target: - Цель ссылки: - - - - Open With: - Открыть с помощью: - - - - Last accessed: - Последний доступ: - - - - Permissions - Разрешения - - - - Ownership - Владение - - - - - - Group: - Группа: - - - - - - Owner: - Владелец: - - - - Access Control - Контроль доступа - - - - - Other: - Остальные: - - - - Make the file executable - Сделать файл исполняемым - - - - - - Read - Чтение - - - - - - Write - Запись - - - - - - Execute - Выполнение - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - Расширенный режим - - - - Fm::AppChooserComboBox - - - Customize - Настроить - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - Выберите приложение, чтобы открыть "%1" файлов - - - - Fm::CreateNewMenu - - - Folder - Папку - - - - Blank File - Пустой файл - - - - Fm::DirTreeModel - - - Loading... - Загрузка... - - - - <No sub folders> - <Нет подпапок> - - - - Fm::DirTreeView - - - Open in New T&ab - Открыть в новой вкл&адке - - - - Open in New Win&dow - Открыть в новом о&кне - - - - Open in Termina&l - Открыть в термина&ле - - - - Fm::DndActionMenu - - - Copy here - Копировать сюда - - - - Move here - Переместить сюда - - - - Create symlink here - Создать здесь ссылку - - - - Cancel - Отмена - - - - Fm::EditBookmarksDialog - - - New bookmark - Новая закладка - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - Этот текстовый файл '%1' похож на исполняемый скрипт. -Что вы хотите с ним сделать? - - - - This file '%1' is executable. Do you want to execute it? - Это исполняемый файл '%1' . Вы хотите выполнить его? - - - - Fm::FileMenu - - - Open - Открыть - - - - Open With... - Открыть с помощью... - - - - Other Applications - Другие приложения - - - - Create &New - &Создать - - - - &Restore - &Восстановить - - - - Cut - Вырезать - - - - Copy - Копировать - - - - Paste - Вставить - - - - - &Move to Trash - &Переместить в корзину - - - - Rename - Переименовать - - - - Extract to... - Распаковать в ... - - - - Extract Here - Распаковать здесь - - - - Compress - Сжать - - - - Properties - Свойства - - - - Output - Вывод - - - - &Delete - &Удалить - - - - Fm::FileOperation - - - Error - Ошибка - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - Некоторые файлы не могут быть помещены в корзину, поскольку файловая система не поддерживает эту операцию. -Вы всё равно хотите их удалить? - - - - - Confirm - Подтвердить - - - - Do you want to delete the selected files? - Вы действительно хотите удалить выбранные файлы? - - - - Do you want to move the selected files to trash can? - Переместить выбранные файлы в корзину? - - - - Fm::FileOperationDialog - - - Move files - Перемещение файлов - - - - Moving the following files to destination folder: - Перемещение следующих файлов в папку назначения: - - - - Copy Files - Копирование файлов - - - - Copying the following files to destination folder: - Копирование следующих файлов в папку назначения: - - - - Trash Files - Перемещение в корзину файлов - - - - Moving the following files to trash can: - Перемещение следующих файлов в корзину: - - - - Delete Files - Удалить файлы - - - - Deleting the following files - Удаление следующих файлов - - - - Create Symlinks - Создание ссылок - - - - Creating symlinks for the following files: - Создание ссылок на следующие файлы: - - - - Change Attributes - Изменение атрибутов - - - - Changing attributes of the following files: - Изменение атрибутов следующих файлов: - - - - Restore Trashed Files - Восстановить файлы из корзины - - - - Restoring the following files from trash can: - Восстановление следующих файлов из корзины: - - - - Error - Ошибка - - - - Fm::FilePropsDialog - - - View folder content - Просмотр содержимого папки - - - - View and modify folder content - Просмотр и изменение содержимого папки - - - - Read - Чтение - - - - Read and write - Чтение и запись - - - - Forbidden - Запрет - - - - Files of different types - Файлы разного типа - - - - Multiple Files - Несколько файлов - - - - Apply changes - Применить изменения - - - - Do you want to recursively apply these changes to all files and sub-folders? - Применить изменения рекурсивно ко всем файлам и подпапкам? - - - - Fm::FileSearchDialog - - - Error - Ошибка - - - - You should add at least add one directory to search. - Вы должны добавить не менее одного места для поиска. - - - - Select a folder - Выберите папку - - - - Fm::FolderMenu - - - Create &New - &Создать - - - - &Paste - &Вставить - - - - Select &All - Выбрать &всё - - - - Invert Selection - Инвертировать выделение - - - - Sorting - Сортировка - - - - Show Hidden - Показать скрытые - - - - Folder Pr&operties - &Свойства папки - - - - By File Name - По имени - - - - By Modification Time - По времени изменения - - - - By File Size - По размеру - - - - By File Type - По типу - - - - By File Owner - По владельцу - - - - Ascending - Возрастающая - - - - Descending - Убывающая - - - - Folder First - Сначала папки - - - - Case Sensitive - Регистрочувствительность - - - - Fm::FolderModel - - - Name - Имя - - - - Type - Тип - - - - Size - Размер - - - - Modified - Изменён - - - - Owner - Владелец - - - - Fm::FontButton - - - Bold - Жирный - - - - Italic - Курсив - - - - Fm::MountOperationPasswordDialog - - - &Connect - &Соединить - - - - Fm::PlacesModel - - - Places - Места - - - - Desktop - Рабочий стол - - - - Computer - Компьютер - - - - Applications - Программы - - - - Network - Сеть - - - - Devices - Устройства - - - - Bookmarks - Закладки - - - - Trash - Корзина - - - - Fm::PlacesView - - - Empty Trash - Очистить корзину - - - - Open in New Tab - Открыть в новой вкладке - - - - Open in New Window - Открыть в новом окне - - - - Move Bookmark Up - Сдвинуть закладку вверх - - - - Move Bookmark Down - Сдвинуть закладку вниз - - - - Rename Bookmark - Переименовать закладку - - - - Remove Bookmark - Удалить закладку - - - - - Unmount - Отключить - - - - Mount - Подключить - - - - Eject - Извлечь - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - Тип: %1 -Размер: %2 -Изменён: %3 - - - - Type: %1 -Modified: %2 - Тип: %1 -Изменён: %2 - - - - Type: %1 -Modified: %3 - Тип: %1 -Изменён: %3 - - - - &Overwrite - &Перезаписать - - - - &Rename - &Переименовать - - - - Fm::SidePane - - - - Places - Места - - - - - Directory Tree - Дерево папок - - - - Shows list of common places, devices, and bookmarks in sidebar - Показывает список обычных мест, устройств и закладок в боковой панели - - - - Shows tree of directories in sidebar - Показывает дерево папок в боковой панели - - - - MountOperationPasswordDialog - - - Mount - Подключить - - - - Connect &anonymously - Подсоединить &анонимно - - - - Connect as u&ser: - Подсоединить как &пользователь: - - - - &Username: - &Имя пользователя: - - - - &Password: - &Пароль: - - - - &Domain: - &Домен: - - - - Forget password &immediately - Забыть пароль &сразу - - - - Remember password until you &logout - Запомнить пароль пока вы не &вышли - - - - Remember &forever - Запомнить &навсегда - - - - QObject - - - - - - Error - Ошибка - - - - Rename File - Переименовать файл - - - - Please enter a new name: - Введите новое имя: - - - - Create Folder - Создать папку - - - - Please enter a new file name: - Введите имя нового файла: - - - - New text file - Новый текстовый файл - - - - Please enter a new folder name: - Введите имя новой папки: - - - - New folder - Новая папка - - - - Enter a name for the new %1: - Введите имя для нового %1: - - - - Create File - Создать файл - - - - RenameDialog - - - Confirm to replace files - Подтвердить замену файлов - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - <html><head/><body><p><span style=" font-weight:600;">В этом месте назначения уже есть файл с таким именем.</span></p><p>Вы хотите заменить существующий файл?</p></body></html> - - - - dest - - - - - with the following file? - следующим файлом? - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - &Имя файла: - - - - Apply this option to all existing files - Запомнить выбор для всех уже существующих файлов - - - - SearchDialog - - - Search Files - Искать файлы - - - - Name/Location - Имя/Расположение - - - - File Name Patterns: - Шаблоны имени файла: - - - - * - - - - - Case insensitive - Нечувствительный к регистру поиск - - - - Use regular expression - Использовать регулярные выражения - - - - Places to Search: - Места для поиска: - - - - &Add - &Добавить - - - - &Remove - &Удалить - - - - Search in sub directories - Искать в подпапках - - - - Search for hidden files - Искать скрытые файлы - - - - File Type - Тип файла - - - - Only search for files of following types: - Искать файлы только следующих типов: - - - - Text files - Текстовые файлы - - - - Image files - Изображения - - - - Audio files - Аудиофайлы - - - - Video files - Видеофайлы - - - - Documents - Документы - - - - Folders - Папки - - - - Content - Содержание - - - - File contains: - Файл содержит: - - - - Case insensiti&ve - Нечувствительн&ый к регистру поиск - - - - &Use regular expression - &Использовать регулярные выражения - - - - Properties - Свойства - - - - File Size: - Размер файла: - - - - Larger than: - Больше, чем: - - - - - Bytes - Байт - - - - - KiB - КиБ - - - - - MiB - МиБ - - - - - GiB - ГиБ - - - - Smaller than: - Меньше, чем: - - - - Last Modified Time: - Время последнего изменения: - - - - Earlier than: - Раньше, чем: - - - - Later than: - Позже, чем: - - - diff --git a/libfm-qt/translations/libfm-qt_zh_TW.ts b/libfm-qt/translations/libfm-qt_zh_TW.ts deleted file mode 100644 index 26deb47..0000000 --- a/libfm-qt/translations/libfm-qt_zh_TW.ts +++ /dev/null @@ -1,1305 +0,0 @@ - - - - - AppChooserDialog - - - Choose an Application - 選擇一個應用程式 - - - - Installed Applications - 安裝的應用程式 - - - - Custom Command - 自訂指令 - - - - Command line to execute: - 要執行的命令列: - - - - Application name: - 應用程式名稱: - - - - <b>These special codes can be used in the command line:</b> -<ul> -<li><b>%f</b>: Represents a single file name</li> -<li><b>%F</b>: Represents multiple file names</li> -<li><b>%u</b>: Represents a single URI of the file</li> -<li><b>%U</b>: Represents multiple URIs</li> -</ul> - <b>這些特殊代號可以在指令列參數使用:</b> -<ul> -<li><b>%f</b>:代表單一檔案名稱</li> -<li><b>%F</b>:代表多個檔案名稱</li> -<li><b>%u</b>:代表單一檔案 URI</li> -<li><b>%U</b>:代表多個 URI</li> -</ul> - - - - Keep terminal window open after command execution - 執行指令後保持終端機視窗開啟 - - - - Execute in terminal emulator - 在終端機模擬器執行 - - - - Set selected application as default action of this file type - 將所選應用程式設定為此類型檔案的預設處理程式 - - - - EditBookmarksDialog - - - Edit Bookmarks - 編輯書籤 - - - - Name - 名稱 - - - - Location - 位置 - - - - &Add Item - 新增項目(&A) - - - - &Remove Item - 移除項目(&R) - - - - Use drag and drop to reorder the items - 使用拖放重新排序項目 - - - - ExecFileDialog - - - Execute file - 執行檔案 - - - - &Open - 開啟(&) - - - - E&xecute - 執行(&X) - - - - Execute in &Terminal - 在終端機內執行(&T) - - - - Cancel - 取消 - - - - FileOperationDialog - - - Destination: - 目的地: - - - - Processing: - 正在處理: - - - - Preparing... - 準備中... - - - - Progress - 進度 - - - - Time remaining: - 剩餘時間: - - - - FilePropsDialog - - - File Properties - 檔案屬性 - - - - General - 一般 - - - - Location: - 位置: - - - - File type: - 檔案類型: - - - - Mime type: - Mime 類型: - - - - File size: - 檔案大小: - - - - On-disk size: - 磁碟上大小: - - - - Last modified: - 最後修改: - - - - Link target: - 連結目標: - - - - Open With: - 開啟: - - - - Last accessed: - 最後存取: - - - - Permissions - 權限 - - - - Ownership - 所有權 - - - - - - Group: - 群組: - - - - - - Owner: - 擁有者: - - - - Access Control - 存取控制 - - - - - Other: - 其他: - - - - Make the file executable - 使檔案可執行 - - - - - - Read - 讀取 - - - - - - Write - 寫入 - - - - - - Execute - 執行 - - - - Sticky - - - - - SetUID - - - - - SetGID - - - - - Advanced Mode - 進階模式 - - - - Fm::AppChooserComboBox - - - Customize - 自訂 - - - - Fm::AppChooserDialog - - - Select an application to open "%1" files - 選取用來開啟「%1」檔案的應用程式 - - - - Fm::CreateNewMenu - - - Folder - 資料夾 - - - - Blank File - 空白檔案 - - - - Fm::DirTreeModel - - - Loading... - 載入中... - - - - <No sub folders> - <沒有子資料夾> - - - - Fm::DirTreeView - - - Open in New T&ab - - - - - Open in New Win&dow - - - - - Open in Termina&l - - - - - Fm::DndActionMenu - - - Copy here - 複製到這裡 - - - - Move here - 移動到這裡 - - - - Create symlink here - 建立符號連結到這裡 - - - - Cancel - 取消 - - - - Fm::EditBookmarksDialog - - - New bookmark - 新書籤 - - - - Fm::ExecFileDialog - - - This text file '%1' seems to be an executable script. -What do you want to do with it? - 這個文字檔 '%1' 似乎是可執行的 script。 -想要進行什麼操作? - - - - This file '%1' is executable. Do you want to execute it? - 這個檔案 '%1' 是可執行檔,是否想要執行? - - - - Fm::FileMenu - - - Open - 開啟 - - - OpenWith - 用其他程式開啟 - - - - Open With... - 用其他程式開啟... - - - - Other Applications - 其他應用程式 - - - - Create &New - 新建(&N) - - - - &Restore - 恢復(&R) - - - - Cut - 剪下 - - - - Copy - 複製 - - - - Paste - 貼上 - - - - - &Move to Trash - 移動到垃圾桶(&M) - - - - Output - 輸出 - - - - &Delete - 刪除(&D) - - - Delete - 刪除 - - - - Rename - 重新命名 - - - - Extract to... - 解壓縮到... - - - - Extract Here - 在此解壓縮 - - - - Compress - 壓縮 - - - - Properties - 屬性 - - - - Fm::FileOperation - - - Error - 錯誤 - - - - Some files cannot be moved to trash can because the underlying file systems don't support this operation. -Do you want to delete them instead? - 因為檔案系統不支援,有些檔案無法丟到垃圾桶 -是否直接刪除這些檔案? - - - - - Confirm - 確認 - - - - Do you want to delete the selected files? - 你確定要刪除選取的檔案嗎? - - - - Do you want to move the selected files to trash can? - 你確定要把選取的檔案移到垃圾桶嗎? - - - - Fm::FileOperationDialog - - - Move files - 移動檔案 - - - - Moving the following files to destination folder: - 正在移動下列檔案到目的資料夾: - - - - Copy Files - 複製檔案 - - - - Copying the following files to destination folder: - 正在複製下列檔案到目的資料夾: - - - - Trash Files - 將檔案丟到垃圾桶 - - - - Moving the following files to trash can: - 正在將下列檔案移動到垃圾桶: - - - - Delete Files - 刪除檔案 - - - - Deleting the following files - 正在刪除下列檔案 - - - - Create Symlinks - 建立符號連結 - - - - Creating symlinks for the following files: - 正在建立下列檔案的符號連結: - - - - Change Attributes - 改變屬性 - - - - Changing attributes of the following files: - 正在更改下列檔案的屬性: - - - - Restore Trashed Files - 恢復被刪除的檔案 - - - - Restoring the following files from trash can: - 正在恢復下列被刪除的檔案 - - - - Error - 錯誤 - - - - Fm::FilePropsDialog - - - View folder content - 檢視資料夾內容 - - - - View and modify folder content - 檢視及修改資料夾內容 - - - - Read - 讀取 - - - - Read and write - 讀取及寫入 - - - - Forbidden - 禁止 - - - - Files of different types - 不同類型的檔案 - - - - Multiple Files - 多個檔案 - - - - Apply changes - 套用變更 - - - - Do you want to recursively apply these changes to all files and sub-folders? - 你是否想將這些變更套用到所有子資料夾和其內的檔案? - - - - Fm::FileSearchDialog - - - Error - 錯誤 - - - - You should add at least add one directory to search. - - - - - Select a folder - - - - - Fm::FolderMenu - - - Create &New - 新建(&N) - - - - &Paste - 貼上(&P) - - - - Select &All - 全選(&A) - - - - Invert Selection - 反向選取 - - - - Sorting - 排序 - - - - Show Hidden - 顯示隱藏檔 - - - - Folder Pr&operties - 資料夾屬性(&O) - - - Folder - 資料夾 - - - File - 檔案 - - - Blank File - 空白檔案 - - - - By File Name - 依照檔名 - - - - By Modification Time - 依照修改時間 - - - - By File Size - 依照檔案大小 - - - - By File Type - 依照檔案型態 - - - - By File Owner - 依照檔案所有者 - - - - Ascending - 升冪排列 - - - - Descending - 降冪排列 - - - - Folder First - 資料夾優先 - - - - Case Sensitive - 區分大小寫 - - - - Fm::FolderModel - - - Name - 名稱 - - - - Type - 類型 - - - - Size - 大小 - - - - Modified - 修改 - - - - Owner - 所有者 - - - - Fm::FontButton - - - Bold - 粗體 - - - - Italic - 斜體 - - - - Fm::MountOperationPasswordDialog - - - &Connect - 連接(&C) - - - - Fm::PlacesModel - - - Places - 位置 - - - - Desktop - 桌面 - - - - Trash - 垃圾桶 - - - - Computer - 電腦 - - - - Applications - 應用程式 - - - - Network - 網路 - - - - Devices - 裝置 - - - - Bookmarks - 書籤 - - - - Fm::PlacesView - - - Empty Trash - 清空垃圾桶 - - - Rename - 重新命名 - - - Delete - 刪除 - - - - Open in New Tab - - - - - Open in New Window - - - - - Move Bookmark Up - - - - - Move Bookmark Down - - - - - Rename Bookmark - - - - - Remove Bookmark - - - - - - Unmount - 卸載 - - - - Mount - 掛載 - - - - Eject - 退出 - - - - Fm::RenameDialog - - - - Type: %1 -Size: %2 -Modified: %3 - 類型: %1 -大小: %2 -最後修改: %3 - - - - Type: %1 -Modified: %2 - 類型: %1 -最後修改: %2 - - - - Type: %1 -Modified: %3 - 類型: %1 -最後修改: %3 - - - - &Overwrite - 覆蓋(&O) - - - - &Rename - 重新命名(&R) - - - - Fm::SidePane - - - - Places - 位置 - - - - - Directory Tree - 目錄樹 - - - - Shows list of common places, devices, and bookmarks in sidebar - - - - - Shows tree of directories in sidebar - - - - - MountOperationPasswordDialog - - - Mount - 掛載 - - - - Connect &anonymously - 匿名連線(&A) - - - - Connect as u&ser: - 以使用者帳號連線(&S): - - - - &Username: - 使用者名稱(&U): - - - - &Password: - 密碼(&P): - - - - &Domain: - - - - - Forget password &immediately - 立刻忘記密碼(&I) - - - - Remember password until you &logout - 記住密碼直到登出(&L) - - - - Remember &forever - 永遠記住密碼(&F) - - - - QObject - - - - - - Error - 錯誤 - - - - Rename File - 重新命名 - - - - Please enter a new name: - 請輸入一個新名稱: - - - - Create Folder - - - - - Please enter a new file name: - 請輸入一個新檔名: - - - - Please enter a new folder name: - 請輸入一個新資料夾名稱: - - - - New folder - 新資料夾 - - - - New text file - 新文字檔 - - - - Enter a name for the new %1: - 幫新的 %1 輸入一個名稱: - - - - Create File - 建立檔案 - - - - RenameDialog - - - Confirm to replace files - 確認取代檔案 - - - - <html><head/><body><p><span style=" font-weight:600;">There is already a file with the same name in this location.</span></p><p>Do you want to replace the existing file?</p></body></html> - - - - - dest - - - - - with the following file? - - - - - src file info - - - - - dest file info - - - - - src - - - - - &File name: - 檔名(&F): - - - - Apply this option to all existing files - 套用這個選項到所有已存在的檔案 - - - - SearchDialog - - - Search Files - - - - - Name/Location - - - - - File Name Patterns: - - - - - * - - - - - Case insensitive - - - - - Use regular expression - - - - - Places to Search: - - - - - &Add - - - - - &Remove - - - - - Search in sub directories - - - - - Search for hidden files - - - - - File Type - - - - - Only search for files of following types: - - - - - Text files - - - - - Image files - - - - - Audio files - - - - - Video files - - - - - Documents - - - - - Folders - - - - - Content - - - - - File contains: - - - - - Case insensiti&ve - - - - - &Use regular expression - - - - - Properties - 屬性 - - - - File Size: - - - - - Larger than: - - - - - - Bytes - - - - - - KiB - - - - - - MiB - - - - - - GiB - - - - - Smaller than: - - - - - Last Modified Time: - - - - - Earlier than: - - - - - Later than: - - - - diff --git a/libfm-qt/utilities.cpp b/libfm-qt/utilities.cpp deleted file mode 100644 index ff7662e..0000000 --- a/libfm-qt/utilities.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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. -*/ - - -#include "utilities.h" -#include "utilities_p.h" -#include -#include -#include -#include -#include -#include -#include -#include "fileoperation.h" -#include - -#include -#include -#include -#include - -using namespace Fm; - -namespace Fm { - -FmPathList* pathListFromQUrls(QList urls) { - QList::const_iterator it; - FmPathList* pathList = fm_path_list_new(); - - for(it = urls.begin(); it != urls.end(); ++it) { - QUrl url = *it; - FmPath* path = fm_path_new_for_uri(url.toString().toUtf8()); - fm_path_list_push_tail(pathList, path); - fm_path_unref(path); - } - - return pathList; -} - -void pasteFilesFromClipboard(FmPath* destPath, QWidget* parent) { - QClipboard* clipboard = QApplication::clipboard(); - const QMimeData* data = clipboard->mimeData(); - bool isCut = false; - FmPathList* paths = NULL; - - if(data->hasFormat("x-special/gnome-copied-files")) { - // Gnome, LXDE, and XFCE - QByteArray gnomeData = data->data("x-special/gnome-copied-files"); - char* pdata = gnomeData.data(); - char* eol = strchr(pdata, '\n'); - - if(eol) { - *eol = '\0'; - isCut = (strcmp(pdata, "cut") == 0 ? true : false); - paths = fm_path_list_new_from_uri_list(eol + 1); - } - } - - if(!paths && data->hasUrls()) { - // The KDE way - paths = Fm::pathListFromQUrls(data->urls()); - QByteArray cut = data->data("x-kde-cut-selection"); - - if(!cut.isEmpty() && cut.at(0) == '1') - isCut = true; - } - - if(paths) { - if(isCut) - FileOperation::moveFiles(paths, destPath, parent); - else - FileOperation::copyFiles(paths, destPath, parent); - - fm_path_list_unref(paths); - } -} - -void copyFilesToClipboard(FmPathList* files) { - QClipboard* clipboard = QApplication::clipboard(); - QMimeData* data = new QMimeData(); - char* urilist = fm_path_list_to_uri_list(files); - // Gnome, LXDE, and XFCE - data->setData("x-special/gnome-copied-files", (QString("copy\n") + urilist).toUtf8()); - // The KDE way - data->setData("text/uri-list", urilist); - // data.setData("x-kde-cut-selection", "0"); - g_free(urilist); - clipboard->setMimeData(data); -} - -void cutFilesToClipboard(FmPathList* files) { - QClipboard* clipboard = QApplication::clipboard(); - QMimeData* data = new QMimeData(); - char* urilist = fm_path_list_to_uri_list(files); - // Gnome, LXDE, and XFCE - data->setData("x-special/gnome-copied-files", (QString("cut\n") + urilist).toUtf8()); - // The KDE way - data->setData("text/uri-list", urilist); - data->setData("x-kde-cut-selection", "1"); - g_free(urilist); - clipboard->setMimeData(data); -} - -void renameFile(FmFileInfo *file, QWidget *parent) { - FmPath* path = fm_file_info_get_path(file); - FilenameDialog dlg(parent); - dlg.setWindowTitle(QObject::tr("Rename File")); - dlg.setLabelText(QObject::tr("Please enter a new name:")); - // FIXME: what's the best way to handle non-UTF8 filename encoding here? - QString old_name = QString::fromLocal8Bit(fm_path_get_basename(path)); - dlg.setTextValue(old_name); - - if(fm_file_info_is_dir(file)) // select filename extension for directories - dlg.setSelectExtension(true); - - if(dlg.exec() != QDialog::Accepted) - return; - - QString new_name = dlg.textValue(); - - if(new_name == old_name) - return; - - GFile* gf = fm_path_to_gfile(path); - GFile* parent_gf = g_file_get_parent(gf); - GFile* dest = g_file_get_child(G_FILE(parent_gf), new_name.toLocal8Bit().data()); - g_object_unref(parent_gf); - - GError* err = NULL; - if(!g_file_move(gf, dest, - GFileCopyFlags(G_FILE_COPY_ALL_METADATA | - G_FILE_COPY_NO_FALLBACK_FOR_MOVE | - G_FILE_COPY_NOFOLLOW_SYMLINKS), - NULL, /* make this cancellable later. */ - NULL, NULL, &err)) { - QMessageBox::critical(parent, QObject::tr("Error"), err->message); - g_error_free(err); - } - - g_object_unref(dest); - g_object_unref(gf); -} - -// templateFile is a file path used as a template of the new file. -void createFileOrFolder(CreateFileType type, FmPath* parentDir, FmTemplate* templ, QWidget* parent) { - QString defaultNewName; - QString prompt; - QString dialogTitle = type == CreateNewFolder ? QObject::tr("Create Folder") - : QObject::tr("Create File"); - - switch(type) { - case CreateNewTextFile: - prompt = QObject::tr("Please enter a new file name:"); - defaultNewName = QObject::tr("New text file"); - break; - - case CreateNewFolder: - prompt = QObject::tr("Please enter a new folder name:"); - defaultNewName = QObject::tr("New folder"); - break; - - case CreateWithTemplate: { - FmMimeType* mime = fm_template_get_mime_type(templ); - prompt = QObject::tr("Enter a name for the new %1:").arg(QString::fromUtf8(fm_mime_type_get_desc(mime))); - defaultNewName = QString::fromUtf8(fm_template_get_name(templ, NULL)); - } - break; - } - -_retry: - // ask the user to input a file name - bool ok; - QString new_name = QInputDialog::getText(parent, dialogTitle, - prompt, - QLineEdit::Normal, - defaultNewName, - &ok); - - if(!ok) - return; - - GFile* parent_gf = fm_path_to_gfile(parentDir); - GFile* dest_gf = g_file_get_child(G_FILE(parent_gf), new_name.toLocal8Bit().data()); - g_object_unref(parent_gf); - - GError* err = NULL; - switch(type) { - case CreateNewTextFile: { - GFileOutputStream* f = g_file_create(dest_gf, G_FILE_CREATE_NONE, NULL, &err); - if(f) { - g_output_stream_close(G_OUTPUT_STREAM(f), NULL, NULL); - g_object_unref(f); - } - break; - } - case CreateNewFolder: - g_file_make_directory(dest_gf, NULL, &err); - break; - case CreateWithTemplate: - fm_template_create_file(templ, dest_gf, &err, false); - break; - } - g_object_unref(dest_gf); - - if(err) { - if(err->domain == G_IO_ERROR && err->code == G_IO_ERROR_EXISTS) { - g_error_free(err); - err = NULL; - goto _retry; - } - - QMessageBox::critical(parent, QObject::tr("Error"), err->message); - g_error_free(err); - } -} - -uid_t uidFromName(QString name) { - uid_t ret; - if(name.isEmpty()) - return -1; - if(name.at(0).digitValue() != -1) { - ret = uid_t(name.toUInt()); - } - else { - struct passwd* pw = getpwnam(name.toLatin1()); - // FIXME: use getpwnam_r instead later to make it reentrant - ret = pw ? pw->pw_uid : -1; - } - - return ret; -} - -QString uidToName(uid_t uid) { - QString ret; - struct passwd* pw = getpwuid(uid); - - if(pw) - ret = pw->pw_name; - else - ret = QString::number(uid); - - return ret; -} - -gid_t gidFromName(QString name) { - gid_t ret; - if(name.isEmpty()) - return -1; - if(name.at(0).digitValue() != -1) { - ret = gid_t(name.toUInt()); - } - else { - // FIXME: use getgrnam_r instead later to make it reentrant - struct group* grp = getgrnam(name.toLatin1()); - ret = grp ? grp->gr_gid : -1; - } - - return ret; -} - -QString gidToName(gid_t gid) { - QString ret; - struct group* grp = getgrgid(gid); - - if(grp) - ret = grp->gr_name; - else - ret = QString::number(gid); - - return ret; -} - -int execModelessDialog(QDialog* dlg) { - // FIXME: this does much less than QDialog::exec(). Will this work flawlessly? - QEventLoop loop; - QObject::connect(dlg, &QDialog::finished, &loop, &QEventLoop::quit); - // DialogExec does not seem to be documented in the Qt API doc? - // However, in the source code of QDialog::exec(), it's used so let's use it too. - dlg->show(); - (void)loop.exec(QEventLoop::DialogExec); - return dlg->result(); -} - -// check if GVFS can support this uri scheme (lower case) -// NOTE: this does not work reliably due to some problems in gio/gvfs and causes bug lxde/lxqt#512 -// https://github.com/lxde/lxqt/issues/512 -// Use uriExists() whenever possible. -bool isUriSchemeSupported(const char* uriScheme) { - const gchar * const * schemes = g_vfs_get_supported_uri_schemes(g_vfs_get_default()); - if(Q_UNLIKELY(schemes == NULL)) - return false; - for(const gchar * const * scheme = schemes; *scheme; ++scheme) - if(strcmp(uriScheme, *scheme) == 0) - return true; - return false; -} - -// check if the URI exists. -// NOTE: this is a blocking call possibly involving I/O. -// So it's better to use it in limited cases, like checking trash:// or computer://. -// Avoid calling this on a slow filesystem. -// Checking "network:///" is very slow, for example. -bool uriExists(const char* uri) { - GFile* gf = g_file_new_for_uri(uri); - bool ret = (bool)g_file_query_exists(gf, NULL); - g_object_unref(gf); - return ret; -} - -} diff --git a/libfm-qt/utilities.h b/libfm-qt/utilities.h deleted file mode 100644 index 4db45dc..0000000 --- a/libfm-qt/utilities.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - - Copyright (C) 2013 Hong Jen Yee (PCMan) - - 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 FM_UTILITIES_H -#define FM_UTILITIES_H - -#include "libfmqtglobals.h" -#include -#include -#include -#include -#include - -class QDialog; - -namespace Fm { - -LIBFM_QT_API FmPathList* pathListFromQUrls(QList urls); - -LIBFM_QT_API void pasteFilesFromClipboard(FmPath* destPath, QWidget* parent = 0); - -LIBFM_QT_API void copyFilesToClipboard(FmPathList* files); - -LIBFM_QT_API void cutFilesToClipboard(FmPathList* files); - -LIBFM_QT_API void renameFile(FmFileInfo* file, QWidget* parent = 0); - -enum CreateFileType { - CreateNewFolder, - CreateNewTextFile, - CreateWithTemplate -}; - -LIBFM_QT_API void createFileOrFolder(CreateFileType type, FmPath* parentDir, FmTemplate* templ = NULL, QWidget* parent = 0); - -LIBFM_QT_API uid_t uidFromName(QString name); - -LIBFM_QT_API QString uidToName(uid_t uid); - -LIBFM_QT_API gid_t gidFromName(QString name); - -LIBFM_QT_API QString gidToName(gid_t gid); - -LIBFM_QT_API int execModelessDialog(QDialog* dlg); - -// NOTE: this does not work reliably due to some problems in gio/gvfs -// Use uriExists() whenever possible. -LIBFM_QT_API bool isUriSchemeSupported(const char* uriScheme); - -LIBFM_QT_API bool uriExists(const char* uri); - -} - -#endif // FM_UTILITIES_H diff --git a/libfm-qt/utilities_p.h b/libfm-qt/utilities_p.h deleted file mode 100644 index b1c43c2..0000000 --- a/libfm-qt/utilities_p.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - - Copyright (C) 2014 Hong Jen Yee (PCMan) - - 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 __UTILITS_P_H__ -#define __UTILITS_P_H__ - -#include -#include -#include - -namespace Fm { - -// private class used in internal implementation -class FilenameDialog : public QInputDialog { - Q_OBJECT -public: - FilenameDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0): - QInputDialog(parent, flags), - selectExtension_(false) { - } - - virtual void showEvent(QShowEvent * event) { - QWidget::showEvent(event); - if(!selectExtension_) // dot not select filename extension - QTimer::singleShot(0, this, SLOT(initSelection())); - } - - bool selectExtension() const { - return selectExtension_; - } - - void setSelectExtension(bool value) { - selectExtension_ = value; - } - -private Q_SLOTS: - // do not select filename extensions - void initSelection() { - // find the QLineEdit child widget - QLineEdit* lineEdit = findChild(); - if(lineEdit) { - QString filename = lineEdit->text(); - if(!filename.isEmpty()) { - // only select filename part without extension name. - int ext = filename.lastIndexOf('.'); - if(ext != -1) { - // add special cases for tar.gz, tar.bz2, and other tar.* files - if(filename.leftRef(ext).endsWith(".tar")) - ext -= 4; - // FIXME: should we also handle other special cases? - lineEdit->setSelection(0, ext); - } - } - } - } - -private: - bool selectExtension_; -}; - -} // namespace Fm - -#endif diff --git a/pcmanfm-qt.1.in b/pcmanfm-qt.1.in index 6cd499e..81bd758 100644 --- a/pcmanfm-qt.1.in +++ b/pcmanfm-qt.1.in @@ -1,12 +1,12 @@ .TH PCManFM-Qt "1" "September 2014" "@CMAKE_PROJECT_NAME@ @PCMANFM_QT_VERSION@" "User Commands" .SH NAME -PCManFM-Qt \- A lightweight Qt based file manager for X Window. +PCManFM-Qt \- A lightweight Qt-based file manager for X Window. .SH SYNOPSIS pcmanfm\-qt [OPTION...] [FILE1, FILE2,...] .SH DESCRIPTION -PCMan File Manager Qt (\fBPCManFM-Qt\fP) is an extremly fast, lightweight, yet +PCMan File Manager Qt (\fBPCManFM-Qt\fP) is an extremely fast, lightweight, yet feature-rich file manager with tabbed browsing. It is the default file manager -for the lightweight desktop environment, \fBLXQt\fP. +for the lightweight desktop environment \fBLXQt\fP. .SH OPTIONS .SS "Help Options:" .TP @@ -15,7 +15,7 @@ Show help options .SS "Application Options:" .TP \fB\-p\fR, \fB\-\-profile\fR=\fI\,PROFILE\/\fR -Name of configuration profile +Set name of configuration profile .TP \fB\-d\fR, \fB\-\-daemon\-mode\fR Run PCManFM as a daemon diff --git a/pcmanfm/CMakeLists.txt b/pcmanfm/CMakeLists.txt index ffd30c3..d6a7fd8 100644 --- a/pcmanfm/CMakeLists.txt +++ b/pcmanfm/CMakeLists.txt @@ -1,22 +1,3 @@ -set(LIBFM_LIBRARY "fm-qt5") -set(QTX_INCLUDE_DIRS "") -set(QTX_LIBRARIES Qt5::Widgets Qt5::DBus Qt5::X11Extras) - -include_directories( - ${QTX_INCLUDE_DIRS} - ${LIBFM_INCLUDE_DIRS} - ${LIBMENUCACHE_INCLUDE_DIRS} - ${SYSTEM_LIBS_INCLUDE_DIRS} - "${CMAKE_CURRENT_BINARY_DIR}" - "${PROJECT_SOURCE_DIR}/libfm-qt" -) - -link_directories( - ${LIBFM_LIBRARY_DIRS} - ${LIBMENUCACHE_LIBRARY_DIRS} - ${SYSTEM_LIBS_LIBRARY_DIRS} -) - set(pcmanfm_SRCS application.cpp pcmanfm.cpp @@ -56,7 +37,7 @@ qt5_wrap_ui(pcmanfm_UIS_H ${pcmanfm_UIS}) # add translation for pcmanfm-qt lxqt_translate_ts(QM_FILES UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} - SOURCES ${pcmanfm_SRCS} ${pcmanfm_UIS_H} + SOURCES ${pcmanfm_SRCS} ${pcmanfm_UIS} ) # translate desktop entry files for pcmanfm-qt and desktop preferences @@ -75,18 +56,20 @@ add_executable(pcmanfm-qt set_property( TARGET pcmanfm-qt APPEND PROPERTY COMPILE_DEFINITIONS - LIBFM_QT_API=Q_DECL_IMPORT PCMANFM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/pcmanfm-qt" - LIBFM_DATA_DIR="${LIBFM_PREFIX}/share/libfm" # This is a little bit dirty PCMANFM_QT_VERSION="${PCMANFM_QT_VERSION}" ) +target_include_directories(pcmanfm-qt + PRIVATE "${LIB_XCB_INDLUDE_DIRS}" +) + target_link_libraries(pcmanfm-qt - ${QTX_LIBRARIES} - ${LIBFM_LIBRARIES} - ${LIBMENUCACHE_LIBRARIES} - ${SYSTEM_LIBS_LIBRARIES} - ${LIBFM_LIBRARY} + Qt5::X11Extras + Qt5::Widgets + Qt5::DBus + fm-qt + "${LIB_XCB_LIBRARIES}" ) install(TARGETS pcmanfm-qt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) @@ -99,5 +82,3 @@ install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/pcmanfm-qt/trans # prevent the generated files from being deleted during make clean set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true) - -qt5_use_modules(pcmanfm-qt Widgets DBus) diff --git a/pcmanfm/application.cpp b/pcmanfm/application.cpp index 5de57a5..86fd524 100644 --- a/pcmanfm/application.cpp +++ b/pcmanfm/application.cpp @@ -39,10 +39,10 @@ #include "applicationadaptor.h" #include "preferencesdialog.h" #include "desktoppreferencesdialog.h" -#include "mountoperation.h" +#include #include "autorundialog.h" #include "launcher.h" -#include "filesearchdialog.h" +#include #include #include @@ -52,7 +52,8 @@ #include "xdgdir.h" #include -using namespace PCManFM; +namespace PCManFM { + static const char* serviceName = "org.pcmanfm.PCManFM"; static const char* ifaceName = "org.pcmanfm.Application"; @@ -80,6 +81,8 @@ Application::Application(int& argc, char** argv): argc_ = argc; argv_ = argv; + setApplicationVersion(PCMANFM_QT_VERSION); + // QDBusConnection::sessionBus().registerObject("/org/pcmanfm/Application", this); QDBusConnection dbus = QDBusConnection::sessionBus(); if(dbus.registerService(serviceName)) { @@ -338,7 +341,7 @@ void Application::onUserDirsChanged() } } else { qWarning("Application::onUserDirsChanged: %s doesn't exist", - qUtf8Printable(userDesktopFolder_)); + userDesktopFolder_.toUtf8().constData()); } } } @@ -820,7 +823,7 @@ void Application::installSigtermHandler() { struct sigaction action; action.sa_handler = sigtermHandler; ::sigemptyset(&action.sa_mask); - action.sa_flags |= SA_RESTART; + action.sa_flags = SA_RESTART; if(::sigaction(SIGTERM, &action, 0) != 0) { qWarning("Couldn't install SIGTERM handler"); } @@ -838,3 +841,5 @@ void Application::onSigtermNotified() { notifier->setEnabled(true); } } + +} // namespace PCManFM diff --git a/pcmanfm/application.h b/pcmanfm/application.h index f8e6fd3..e3b1669 100644 --- a/pcmanfm/application.h +++ b/pcmanfm/application.h @@ -23,8 +23,8 @@ #include #include "settings.h" -#include "libfmqt.h" -#include "editbookmarksdialog.h" +#include +#include #include #include #include diff --git a/pcmanfm/autorundialog.cpp b/pcmanfm/autorundialog.cpp index 1799653..3c2dd1e 100644 --- a/pcmanfm/autorundialog.cpp +++ b/pcmanfm/autorundialog.cpp @@ -19,12 +19,12 @@ #include "autorundialog.h" -#include "icontheme.h" +#include #include #include "application.h" #include "mainwindow.h" -using namespace PCManFM; +namespace PCManFM { AutoRunDialog::AutoRunDialog(GVolume* volume, GMount* mount, QWidget* parent, Qt::WindowFlags f): cancellable(g_cancellable_new()), @@ -135,3 +135,5 @@ void AutoRunDialog::onContentTypeFinished(GMount* mount, GAsyncResult* res, Auto // select the first item pThis->ui.listWidget->item(0)->setSelected(true); } + +} // namespace PCManFM diff --git a/pcmanfm/desktop-preferences.ui b/pcmanfm/desktop-preferences.ui index 37df3c1..746c11c 100644 --- a/pcmanfm/desktop-preferences.ui +++ b/pcmanfm/desktop-preferences.ui @@ -269,12 +269,12 @@ Fm::ColorButton QPushButton -
colorbutton.h
+
libfm-qt/colorbutton.h
Fm::FontButton QPushButton -
fontbutton.h
+
libfm-qt/fontbutton.h
diff --git a/pcmanfm/desktopitemdelegate.cpp b/pcmanfm/desktopitemdelegate.cpp index 1f5c6bb..5d7abbc 100644 --- a/pcmanfm/desktopitemdelegate.cpp +++ b/pcmanfm/desktopitemdelegate.cpp @@ -19,7 +19,7 @@ #include "desktopitemdelegate.h" -#include "foldermodel.h" +#include #include #include #include @@ -28,7 +28,7 @@ #include #include -using namespace PCManFM; +namespace PCManFM { DesktopItemDelegate::DesktopItemDelegate(QListView* view, QObject* parent): QStyledItemDelegate(parent ? parent : view), @@ -74,7 +74,20 @@ void DesktopItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o } // draw text - QRectF textRect(opt.rect.x(), opt.rect.y() + opt.decorationSize.height(), opt.rect.width(), opt.rect.height() - opt.decorationSize.height()); + QSize gridSize = view_->gridSize() - QSize(6, 6); + QRectF textRect(opt.rect.x() - (gridSize.width() - opt.rect.width()) / 2, + opt.rect.y() + opt.decorationSize.height(), + gridSize.width(), + gridSize.height() - opt.decorationSize.height()); + drawText(painter, opt, textRect); + + if(opt.state & QStyle::State_HasFocus) { + // FIXME: draw focus rect + } + painter->restore(); +} + +void DesktopItemDelegate::drawText(QPainter* painter, QStyleOptionViewItemV4& opt, QRectF& textRect) const { QTextLayout layout(opt.text, opt.font); QTextOption textOption; @@ -87,7 +100,7 @@ void DesktopItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o int visibleLines = 0; layout.beginLayout(); QString elidedText; - + textRect.adjust(2, 2, -2, -2); // a 2-px margin is considered at FolderView::updateGridSize() for(;;) { QTextLine line = layout.createLine(); if(!line.isValid()) @@ -107,13 +120,23 @@ void DesktopItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o ++ visibleLines; } layout.endLayout(); + width = qMax(width, (qreal)opt.fontMetrics.width(elidedText)); QRectF boundRect = layout.boundingRect(); boundRect.setWidth(width); + boundRect.setHeight(height); boundRect.moveTo(textRect.x() + (textRect.width() - width)/2, textRect.y()); + + QRectF selRect = boundRect.adjusted(-2, -2, 2, 2); + + if(!painter) { // no painter, calculate the bounding rect only + textRect = selRect; + return; + } + if((opt.state & QStyle::State_Selected) && opt.widget) { QPalette palette = opt.widget->palette(); // qDebug("w: %f, h:%f, m:%f", boundRect.width(), boundRect.height(), layout.minimumWidth()); - painter->fillRect(boundRect, palette.highlight()); + painter->fillRect(selRect, palette.highlight()); } else { // only draw shadow for non-selected items // draw shadow, FIXME: is it possible to use QGraphicsDropShadowEffect here? @@ -122,7 +145,7 @@ void DesktopItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o for(int i = 0; i < visibleLines; ++i) { QTextLine line = layout.lineAt(i); if(i == (visibleLines - 1) && !elidedText.isEmpty()) { // the last line, draw elided text - QPointF pos(textRect.x() + line.position().x() + 1, textRect.y() + line.y() + line.ascent() + 1); + QPointF pos(boundRect.x() + line.position().x() + 1, boundRect.y() + line.y() + line.ascent() + 1); painter->drawText(pos, elidedText); } else { @@ -136,18 +159,13 @@ void DesktopItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o for(int i = 0; i < visibleLines; ++i) { QTextLine line = layout.lineAt(i); if(i == (visibleLines - 1) && !elidedText.isEmpty()) { // the last line, draw elided text - QPointF pos(textRect.x() + line.position().x(), textRect.y() + line.y() + line.ascent()); + QPointF pos(boundRect.x() + line.position().x(), boundRect.y() + line.y() + line.ascent()); painter->drawText(pos, elidedText); } else { line.draw(painter, textRect.topLeft()); } } - - if(opt.state & QStyle::State_HasFocus) { - // FIXME: draw focus rect - } - painter->restore(); } QSize DesktopItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const { @@ -156,12 +174,21 @@ QSize DesktopItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QM return qvariant_cast(value); QStyleOptionViewItemV4 opt = option; initStyleOption(&opt, index); - - // use grid size as size hint - QSize gridSize = view_->gridSize(); - return QSize(gridSize.width() -2, gridSize.height() - 2); + opt.decorationAlignment = Qt::AlignHCenter|Qt::AlignTop; + opt.displayAlignment = Qt::AlignTop|Qt::AlignHCenter; + + QSize gridSize = view_->gridSize() + - QSize(6, 6); // a 6-px margin is added at FolderView::updateGridSize() + Q_ASSERT(gridSize != QSize()); + QRectF textRect(0, 0, gridSize.width(), gridSize.height() - opt.decorationSize.height()); + drawText(NULL, opt, textRect); // passing NULL for painter will calculate the bounding rect only. + int width = qMax((int)textRect.width(), opt.decorationSize.width()); + int height = opt.decorationSize.height() + textRect.height(); + return QSize(width, height); } DesktopItemDelegate::~DesktopItemDelegate() { } + +} // namespace PCManFM diff --git a/pcmanfm/desktopitemdelegate.h b/pcmanfm/desktopitemdelegate.h index e9a0d39..3162691 100644 --- a/pcmanfm/desktopitemdelegate.h +++ b/pcmanfm/desktopitemdelegate.h @@ -46,6 +46,9 @@ public: return shadowColor_; } +private: + void drawText(QPainter* painter, QStyleOptionViewItemV4& opt, QRectF& textRect) const; + private: QListView* view_; QIcon symlinkIcon_; diff --git a/pcmanfm/desktoppreferencesdialog.cpp b/pcmanfm/desktoppreferencesdialog.cpp index 5836906..8f52730 100644 --- a/pcmanfm/desktoppreferencesdialog.cpp +++ b/pcmanfm/desktoppreferencesdialog.cpp @@ -31,7 +31,7 @@ #include #include -using namespace PCManFM; +namespace PCManFM { DesktopPreferencesDialog::DesktopPreferencesDialog(QWidget* parent, Qt::WindowFlags f): QDialog(parent, f), @@ -197,3 +197,5 @@ void DesktopPreferencesDialog::setEditDesktopFolder(const bool enabled) if (editDesktopFolderEnabled) setupDesktopFolderUi(); } + +} // namespace PCManFM diff --git a/pcmanfm/desktopwindow.cpp b/pcmanfm/desktopwindow.cpp index 7b34d78..fcdf1a2 100644 --- a/pcmanfm/desktopwindow.cpp +++ b/pcmanfm/desktopwindow.cpp @@ -40,14 +40,14 @@ #include "./application.h" #include "mainwindow.h" #include "desktopitemdelegate.h" -#include "foldermenu.h" -#include "filemenu.h" -#include "cachedfoldermodel.h" -#include "folderview_p.h" -#include "fileoperation.h" -#include "filepropsdialog.h" -#include "utilities.h" -#include "path.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "xdgdir.h" #include @@ -55,7 +55,7 @@ #include #include -using namespace PCManFM; +namespace PCManFM { DesktopWindow::DesktopWindow(int screenNum): View(Fm::FolderView::IconMode), @@ -77,7 +77,7 @@ DesktopWindow::DesktopWindow(int screenNum): View::setFileLauncher(&fileLauncher_); listView_ = static_cast(childView()); - listView_->setMovement(QListView::Free); + listView_->setMovement(QListView::Snap); listView_->setResizeMode(QListView::Adjust); listView_->setFlow(QListView::TopToBottom); @@ -398,18 +398,24 @@ void DesktopWindow::onRowsInserted(const QModelIndex& parent, int start, int end } void DesktopWindow::onRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) { + Q_UNUSED(parent); + Q_UNUSED(start); + Q_UNUSED(end); if(!customItemPos_.isEmpty()) { // also delete stored custom item positions for the items currently being removed. - bool changed = false; - for(int row = start; row <= end ;++row) { - QModelIndex index = parent.child(row, 0); - FmFileInfo* file = proxyModel_->fileInfoFromIndex(index); - if(file) { // remove custom position for the item - if(customItemPos_.remove(fm_file_info_get_name(file))) - changed = true; - } + // Here we can't rely on ProxyFolderModel::fileInfoFromIndex() because, although rows + // aren't removed yet, files are already removed. + QHash _customItemPos = customItemPos_; + char* dektopPath = fm_path_to_str(fm_path_get_desktop()); + QString desktopDir = QString(dektopPath) + QString("/"); + g_free(dektopPath); + QHash::iterator it; + for(it = _customItemPos.begin(); it != _customItemPos.end(); ++it) { + const QByteArray& name = it.key(); + if(!QFile::exists(desktopDir + QString::fromUtf8(name, name.length()))) + customItemPos_.remove(it.key()); } - if(changed) + if(customItemPos_ != _customItemPos) saveItemPositions(); } queueRelayout(); @@ -430,9 +436,17 @@ void DesktopWindow::onIndexesMoved(const QModelIndexList& indexes) { if(index.column() == 0) { FmFileInfo* file = proxyModel_->fileInfoFromIndex(index); QRect itemRect = listView_->rectForIndex(index); - QByteArray name = fm_file_info_get_name(file); - customItemPos_[name] = itemRect.topLeft(); - // qDebug() << "indexMoved:" << name << index << itemRect; + QPoint tl = itemRect.topLeft(); + QRect workArea = qApp->desktop()->availableGeometry(screenNum_); + workArea.adjust(12, 12, -12, -12); + if(customItemPos_.keys(tl).isEmpty() // don't put items on each other + && tl.x() >= workArea.x() && tl.y() >= workArea.y() + && tl.x() + listView_->gridSize().width() <= workArea.right() + && tl.y() + listView_->gridSize().height() <= workArea.bottom()) { + QByteArray name = fm_file_info_get_name(file); + customItemPos_[name] = tl; + // qDebug() << "indexMoved:" << name << index << itemRect; + } } } saveItemPositions(); @@ -442,6 +456,7 @@ void DesktopWindow::onIndexesMoved(const QModelIndexList& indexes) { // QListView does item layout in a very inflexible way, so let's do our custom layout again. // FIXME: this is very inefficient, but due to the design flaw of QListView, this is currently the only workaround. void DesktopWindow::relayoutItems() { + loadItemPositions(); // something may have changed // qDebug("relayoutItems()"); if(relayoutTimer_) { // this slot might be called from the timer, so we cannot delete it directly here. @@ -468,12 +483,14 @@ void DesktopWindow::relayoutItems() { QPoint pos = workArea.topLeft(); for(; row < rowCount; ++row) { QModelIndex index = proxyModel_->index(row, 0); + int itemWidth = delegate_->sizeHint(listView_->getViewOptions(), index).width(); FmFileInfo* file = proxyModel_->fileInfoFromIndex(index); QByteArray name = fm_file_info_get_name(file); QHash::iterator it = customItemPos_.find(name); if(it != customItemPos_.end()) { // the item has a custom position QPoint customPos = *it; - listView_->setPositionForIndex(customPos, index); + // center the contents vertically + listView_->setPositionForIndex(customPos + QPoint((grid.width() - itemWidth) / 2, 0), index); // qDebug() << "set custom pos:" << name << row << index << customPos; continue; } @@ -490,7 +507,8 @@ void DesktopWindow::relayoutItems() { --row; } else { - listView_->setPositionForIndex(pos, index); + // center the contents vertically + listView_->setPositionForIndex(pos + QPoint((grid.width() - itemWidth) / 2, 0), index); // qDebug() << "set pos" << name << row << index << pos; } // move to next cell in the column @@ -517,14 +535,46 @@ void DesktopWindow::relayoutItems() { void DesktopWindow::loadItemPositions() { // load custom item positions + customItemPos_.clear(); Settings& settings = static_cast(qApp)->settings(); QString configFile = QString("%1/desktop-items-%2.conf").arg(settings.profileDir(settings.profileName())).arg(screenNum_); QSettings file(configFile, QSettings::IniFormat); + QSize grid = listView_->gridSize(); + QRect workArea = qApp->desktop()->availableGeometry(screenNum_); + workArea.adjust(12, 12, -12, -12); + char* dektopPath = fm_path_to_str(fm_path_get_desktop()); + QString desktopDir = QString(dektopPath) + QString("/"); + g_free(dektopPath); Q_FOREACH(const QString& name, file.childGroups()) { + if(!QFile::exists(desktopDir + name.toUtf8())) { + // the file may have been removed from outside LXQT + continue; + } file.beginGroup(name); QVariant var = file.value("pos"); - if(var.isValid()) - customItemPos_[name.toUtf8()] = var.toPoint(); + if(var.isValid()) { + QPoint customPos = var.toPoint(); + if (customPos.x() >= workArea.x() && customPos.y() >= workArea.y() + && customPos.x() + listView_->gridSize().width() <= workArea.right() + && customPos.y() + listView_->gridSize().height() <= workArea.bottom()) + { + // correct positions that are't aligned to the grid + qreal w = qAbs((qreal)customPos.x() - (qreal)workArea.x()) + / (qreal)(grid.width() + listView_->spacing()); + qreal h = qAbs(customPos.y() - (qreal)workArea.y()) + / (qreal)(grid.height() + listView_->spacing()); + customPos.setX(workArea.x() + qRound(w) * (grid.width() + listView_->spacing())); + customPos.setY(workArea.y() + qRound(h) * (grid.height() + listView_->spacing())); + while(customItemPos_.values().contains(customPos)) { + customPos.setY(customPos.y() + grid.height() + listView_->spacing()); + if(customPos.y() + grid.height() > workArea.bottom()) { + customPos.setX(customPos.x() + grid.width() + listView_->spacing()); + customPos.setY(workArea.top()); + } + } + customItemPos_[name.toUtf8()] = customPos; + } + } file.endGroup(); } } @@ -799,3 +849,5 @@ void DesktopWindow::setScreenNum(int num) { queueRelayout(); } } + +} // namespace PCManFM diff --git a/pcmanfm/launcher.h b/pcmanfm/launcher.h index 482d986..f29ce9d 100644 --- a/pcmanfm/launcher.h +++ b/pcmanfm/launcher.h @@ -21,7 +21,7 @@ #ifndef PCMANFM_LAUNCHER_H #define PCMANFM_LAUNCHER_H -#include "filelauncher.h" +#include namespace PCManFM { diff --git a/pcmanfm/main-win.ui b/pcmanfm/main-win.ui index 1784279..5691de0 100644 --- a/pcmanfm/main-win.ui +++ b/pcmanfm/main-win.ui @@ -15,8 +15,7 @@ - - + .. @@ -249,8 +248,7 @@ - - + .. Go &Up @@ -265,8 +263,7 @@ - - + .. &Home @@ -278,8 +275,7 @@ - - + .. &Reload @@ -291,8 +287,7 @@ - - + .. Go @@ -301,8 +296,7 @@ - - + .. Quit @@ -311,8 +305,7 @@ - - + .. &About @@ -321,8 +314,7 @@ - - + .. &New Window @@ -348,8 +340,7 @@ - - + .. &Computer @@ -358,8 +349,7 @@ - - + .. &Trash @@ -373,8 +363,7 @@ - - + .. &Desktop @@ -383,8 +372,7 @@ - - + .. &Add to Bookmarks @@ -435,8 +423,7 @@ - - + .. Cu&t @@ -448,8 +435,7 @@ - - + .. &Copy @@ -461,8 +447,7 @@ - - + .. &Paste @@ -543,8 +528,7 @@ - - + .. New &Tab @@ -559,8 +543,7 @@ - - + .. Go &Back @@ -575,8 +558,7 @@ - - + .. Go &Forward @@ -596,8 +578,7 @@ - - + .. &Delete @@ -682,8 +663,7 @@ - - + .. &Folder @@ -695,8 +675,7 @@ - - + .. &Blank File @@ -718,7 +697,30 @@ true - Filter + &Filter + + + + + + .. + + + Close &left tabs + + + + + + .. + + + Close &right tabs + + + + + Close &other tabs @@ -732,7 +734,7 @@ Fm::SidePane QWidget -
sidepane.h
+
libfm-qt/sidepane.h
1
diff --git a/pcmanfm/mainwindow.cpp b/pcmanfm/mainwindow.cpp index 38617b5..e7f1118 100644 --- a/pcmanfm/mainwindow.cpp +++ b/pcmanfm/mainwindow.cpp @@ -32,16 +32,16 @@ #include #include "tabpage.h" -#include "filelauncher.h" -#include "filemenu.h" -#include "bookmarkaction.h" -#include "fileoperation.h" -#include "utilities.h" -#include "filepropsdialog.h" -#include "pathedit.h" +#include "launcher.h" +#include +#include +#include +#include +#include +#include #include "ui_about.h" #include "application.h" -#include "../libfm-qt/path.h" +#include // #include "qmodeltest/modeltest.h" @@ -51,7 +51,8 @@ namespace PCManFM { MainWindow::MainWindow(FmPath* path): QMainWindow(), - fileLauncher_(this) { + fileLauncher_(this), + rightClickIndex(-1) { Settings& settings = static_cast(qApp)->settings(); setAttribute(Qt::WA_DeleteOnClose); @@ -91,9 +92,15 @@ MainWindow::MainWindow(FmPath* path): ui.tabBar->setAcceptDrops(true); #endif + ui.tabBar->setContextMenuPolicy(Qt::CustomContextMenu); + connect(ui.actionCloseRight, &QAction::triggered, this, &MainWindow::closeRightTabs); + connect(ui.actionCloseLeft, &QAction::triggered, this, &MainWindow::closeLeftTabs); + connect(ui.actionCloseOther, &QAction::triggered, this, &MainWindow::closeOtherTabs); + connect(ui.tabBar, &QTabBar::currentChanged, this, &MainWindow::onTabBarCurrentChanged); connect(ui.tabBar, &QTabBar::tabCloseRequested, this, &MainWindow::onTabBarCloseRequested); connect(ui.tabBar, &QTabBar::tabMoved, this, &MainWindow::onTabBarTabMoved); + connect(ui.tabBar, &QTabBar::customContextMenuRequested, this, &MainWindow::tabContextMenu); connect(ui.stackedWidget, &QStackedWidget::widgetRemoved, this, &MainWindow::onStackedWidgetWidgetRemoved); // FIXME: should we make the filter bar a per-view configuration? @@ -171,6 +178,15 @@ MainWindow::MainWindow(FmPath* path): shortcut = new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab, this); connect(shortcut, &QShortcut::activated, this, &MainWindow::onShortcutPrevTab); + // Add Ctrl+PgUp and Ctrl+PgDown as well, because they are common in Firefox + // , Opera, Google Chromium/Google Chrome and most other tab-using + // applications. + shortcut = new QShortcut(Qt::CTRL + Qt::Key_PageDown, this); + connect(shortcut, &QShortcut::activated, this, &MainWindow::onShortcutNextTab); + + shortcut = new QShortcut(Qt::CTRL + Qt::Key_PageUp, this); + connect(shortcut, &QShortcut::activated, this, &MainWindow::onShortcutPrevTab); + int i; for(i = 0; i < 10; ++i) { shortcut = new QShortcut(QKeySequence(Qt::ALT + Qt::Key_0 + i), this); @@ -204,8 +220,10 @@ MainWindow::MainWindow(FmPath* path): } MainWindow::~MainWindow() { - if(bookmarks) + if(bookmarks) { + g_signal_handlers_disconnect_by_func(bookmarks, (gpointer)G_CALLBACK(onBookmarksChanged), this); g_object_unref(bookmarks); + } } void MainWindow::chdir(FmPath* path) { @@ -900,6 +918,39 @@ void MainWindow::onBackForwardContextMenu(QPoint pos) { } } +void MainWindow::tabContextMenu(const QPoint& pos) { + int tabNum = ui.tabBar->count(); + if(tabNum <= 1) return; + + rightClickIndex = ui.tabBar->tabAt(pos); + if(rightClickIndex < 0) return; + + QMenu menu; + if(rightClickIndex > 0) + menu.addAction(ui.actionCloseLeft); + if(rightClickIndex < tabNum - 1) { + menu.addAction(ui.actionCloseRight); + if(rightClickIndex > 0) { + menu.addSeparator(); + menu.addAction(ui.actionCloseOther); + } + } + menu.exec(ui.tabBar->mapToGlobal(pos)); +} + +void MainWindow::closeLeftTabs() { + while(rightClickIndex > 0) { + closeTab(rightClickIndex - 1); + --rightClickIndex; + } +} + +void MainWindow::closeRightTabs() { + if(rightClickIndex < 0) return; + while(rightClickIndex < ui.tabBar->count() - 1) + closeTab(rightClickIndex + 1); +} + void MainWindow::updateFromSettings(Settings& settings) { // apply settings diff --git a/pcmanfm/mainwindow.h b/pcmanfm/mainwindow.h index f9b2999..310f273 100644 --- a/pcmanfm/mainwindow.h +++ b/pcmanfm/mainwindow.h @@ -143,6 +143,14 @@ protected Q_SLOTS: void onBackForwardContextMenu(QPoint pos); + void tabContextMenu(const QPoint& pos); + void closeLeftTabs(); + void closeRightTabs(); + void closeOtherTabs() { + closeLeftTabs(); + closeRightTabs(); + } + protected: // void changeEvent( QEvent * event); void closeTab(int index); @@ -162,6 +170,7 @@ private: QLabel* fsInfoLabel; FmBookmarks* bookmarks; Launcher fileLauncher_; + int rightClickIndex; }; } diff --git a/pcmanfm/pcmanfm.cpp b/pcmanfm/pcmanfm.cpp index 2508307..a17d774 100644 --- a/pcmanfm/pcmanfm.cpp +++ b/pcmanfm/pcmanfm.cpp @@ -1,6 +1,6 @@ #include #include "application.h" -#include "libfmqt.h" +#include int main(int argc, char** argv) { // ensure that glib integration of Qt is not turned off diff --git a/pcmanfm/preferencesdialog.cpp b/pcmanfm/preferencesdialog.cpp index 8b49b47..ecae7d8 100644 --- a/pcmanfm/preferencesdialog.cpp +++ b/pcmanfm/preferencesdialog.cpp @@ -26,9 +26,9 @@ #include #include -#include "folderview.h" +#include -using namespace PCManFM; +namespace PCManFM { static int bigIconSizes[] = {96, 72, 64, 48, 36, 32, 24, 20}; static int smallIconSizes[] = {48, 36, 32, 24, 20, 16, 12}; @@ -362,3 +362,4 @@ void PreferencesDialog::accept() { QDialog::accept(); } +} // namespace PCManFM diff --git a/pcmanfm/settings.cpp b/pcmanfm/settings.cpp index dce0d3f..1fac65d 100644 --- a/pcmanfm/settings.cpp +++ b/pcmanfm/settings.cpp @@ -25,10 +25,10 @@ #include #include #include "desktopwindow.h" -#include "utilities.h" +#include // #include -using namespace PCManFM; +namespace PCManFM { inline static const char* bookmarkOpenMethodToString(OpenDirTargetType value); inline static OpenDirTargetType bookmarkOpenMethodFromString(const QString str); @@ -109,7 +109,11 @@ Settings::~Settings() { QString Settings::profileDir(QString profile, bool useFallback) { // NOTE: it's a shame that QDesktopServices does not handle XDG_CONFIG_HOME // try user-specific config file first - QString dirName = QLatin1String(qgetenv("XDG_CONFIG_HOME")); + QString dirName; + // WARNING: Don't use XDG_CONFIG_HOME with root because it might + // give the user config directory if gksu-properties is set to su. + if(geteuid()) + dirName = QLatin1String(qgetenv("XDG_CONFIG_HOME")); if (dirName.isEmpty()) dirName = QDir::homePath() % QLatin1String("/.config"); dirName = dirName % "/pcmanfm-qt/" % profile; @@ -156,7 +160,7 @@ bool Settings::loadFile(QString filePath) { setSiUnit(settings.value("SIUnit", false).toBool()); setOnlyUserTemplates(settings.value("OnlyUserTemplates", false).toBool()); - setTemplateTypeOnce(settings.value("OemplateTypeOnce", false).toBool()); + setTemplateTypeOnce(settings.value("TemplateTypeOnce", false).toBool()); setTemplateRunApp(settings.value("TemplateRunApp", false).toBool()); settings.endGroup(); @@ -251,7 +255,7 @@ bool Settings::saveFile(QString filePath) { settings.setValue("SIUnit", siUnit_); settings.setValue("OnlyUserTemplates", onlyUserTemplates_); - settings.setValue("OemplateTypeOnce", templateTypeOnce_); + settings.setValue("TemplateTypeOnce", templateTypeOnce_); settings.setValue("TemplateRunApp", templateRunApp_); settings.endGroup(); @@ -511,4 +515,6 @@ void Settings::setTerminal(QString terminalCommand) { g_free(fm_config->terminal); fm_config->terminal = g_strdup(terminal_.toLocal8Bit().constData()); g_signal_emit_by_name(fm_config, "changed::terminal"); - } +} + +} // namespace PCManFM diff --git a/pcmanfm/settings.h b/pcmanfm/settings.h index 21e2d1d..cf8db3d 100644 --- a/pcmanfm/settings.h +++ b/pcmanfm/settings.h @@ -23,11 +23,11 @@ #include #include -#include "folderview.h" -#include "foldermodel.h" +#include +#include #include "desktopwindow.h" -#include "sidepane.h" -#include "thumbnailloader.h" +#include +#include namespace PCManFM { diff --git a/pcmanfm/tabpage.cpp b/pcmanfm/tabpage.cpp index b9d5b11..b40f872 100644 --- a/pcmanfm/tabpage.cpp +++ b/pcmanfm/tabpage.cpp @@ -19,17 +19,17 @@ #include "tabpage.h" -#include "filelauncher.h" -#include "filemenu.h" -#include "mountoperation.h" +#include "launcher.h" +#include +#include #include #include #include #include -#include "proxyfoldermodel.h" +#include #include "settings.h" #include "application.h" -#include "cachedfoldermodel.h" +#include #include #include @@ -161,6 +161,16 @@ void TabPage::freeFolder() { void TabPage::restoreScrollPos() { // scroll to recorded position folderView_->childView()->verticalScrollBar()->setValue(browseHistory().currentScrollPos()); + + // if the current folder is the parent folder of the last browsed folder, + // select the folder item in current view. + if(lastFolderPath_.parent() == path()) { + QModelIndex index = folderView_->indexFromFolderPath(lastFolderPath_.data()); + if(index.isValid()) { + folderView_->childView()->scrollTo(index, QAbstractItemView::EnsureVisible); + folderView_->childView()->setCurrentIndex(index); + } + } } /*static*/ void TabPage::onFolderFinishLoading(FmFolder* _folder, TabPage* pThis) { @@ -329,6 +339,9 @@ void TabPage::chdir(FmPath* newPath, bool addHistory) { if(fm_path_equal(newPath, fm_folder_get_path(folder_))) return; + // remember the previous folder path that we have browsed. + lastFolderPath_ = fm_folder_get_path(folder_); + if(addHistory) { // store current scroll pos in the browse history BrowseHistoryItem& item = history_.currentItem(); @@ -493,8 +506,9 @@ void TabPage::up() { FmPath* _path = path(); if(_path) { FmPath* parent = fm_path_get_parent(_path); - if(parent) + if(parent) { chdir(parent, true); + } } } @@ -521,4 +535,4 @@ void TabPage:: applyFilter() { Q_EMIT statusChanged(StatusTextNormal, statusText_[StatusTextNormal]); } -}; +} // namespace PCManFM diff --git a/pcmanfm/tabpage.h b/pcmanfm/tabpage.h index 199f3bb..3a0f145 100644 --- a/pcmanfm/tabpage.h +++ b/pcmanfm/tabpage.h @@ -24,9 +24,9 @@ #include #include #include -#include "browsehistory.h" +#include #include "view.h" -#include "path.h" +#include namespace Fm { class FileLauncher; @@ -69,7 +69,7 @@ public: }; public: - explicit TabPage(FmPath* path, QWidget* parent = 0); + explicit TabPage(FmPath* path, QWidget* parent = nullptr); virtual ~TabPage(); void chdir(FmPath* newPath, bool addHistory = true); @@ -118,7 +118,7 @@ public: void setShowHidden(bool showHidden); FmPath* path() { - return folder_ ? fm_folder_get_path(folder_) : NULL; + return folder_ ? fm_folder_get_path(folder_) : nullptr; } QString pathName(); @@ -243,6 +243,7 @@ private: QString title_; QString statusText_[StatusTextNum]; Fm::BrowseHistory history_; // browsing history + Fm::Path lastFolderPath_; // last browsed folder bool overrideCursor_; }; diff --git a/pcmanfm/translations/pcmanfm-qt-desktop-pref_ru.desktop b/pcmanfm/translations/pcmanfm-qt-desktop-pref_ru.desktop new file mode 100644 index 0000000..e83806c --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt-desktop-pref_ru.desktop @@ -0,0 +1,4 @@ +#Translations +Name[ru]=Рабочий стол +GenericName[ru]=Настройки рабочего стола +Comment[ru]=Изменить обои и поведение менеджера рабочего стола \ No newline at end of file diff --git a/pcmanfm/translations/pcmanfm-qt-desktop-pref_ru_RU.desktop b/pcmanfm/translations/pcmanfm-qt-desktop-pref_ru_RU.desktop new file mode 100644 index 0000000..d579083 --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt-desktop-pref_ru_RU.desktop @@ -0,0 +1,4 @@ +#Translations +Name[ru_RU]=Рабочий стол +GenericName[ru_RU]=Настройки рабочего стола +Comment[ru_RU]=Изменить обои и поведение менеджера рабочего стола \ No newline at end of file diff --git a/pcmanfm/translations/pcmanfm-qt_fr.ts b/pcmanfm/translations/pcmanfm-qt_fr.ts index 381e176..e5d7245 100644 --- a/pcmanfm/translations/pcmanfm-qt_fr.ts +++ b/pcmanfm/translations/pcmanfm-qt_fr.ts @@ -21,7 +21,7 @@ <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> - + <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> @@ -42,28 +42,17 @@ 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. - Gestionnaire de fichiers de PCMan + Gestionnaire de fichiers de PCMan -Copyright (C) 2009 - 2013 洪任諭 (Hong Jen Yee) +Copyright © 2009 - 2015 洪任諭 (Hong Jen Yee) -Ce programme est du logiciel libre ; vous le redistribuer -avec ou sans modification sous les termes de la licence pu- -blique générale GNU telle que publiée par le fondation pour -le logiciel libre, soit en version 2, soit en n'importe quelle -version ultérieure (à votre discrétion). +Ce programme est un logiciel libre ; vous pouvez le redistribuer ou le modifier suivant les termes de la “GNU General Public License” telle que publiée par la Free Software Foundation, soit en version 2, soit (à votre gré) toute version ultérieure. -Ce programme est distribué dans l'espoir qu'il soit utile, -mais SANS AUCUNE GARANTIE ; sans même la garantie impli- -cite de QUALITÉ MARCHANDE ou d'APTITUDE À UN CERTAIN -BUT. Voir la licence publique générale GNU pour de plus am- -ples détails. +Ce programme est distribué dans l'espoir qu'il vous sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISABILITÉ, ni d’ADÉQUATION À UN OBJECTIF PARTICULIER. Consultez la Licence Générale Publique GNU pour plus de détails. -Vous devriez avoir reçu une copie de la licence publique géné- -rale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la -fondation pour le logiciel libre à l'adresse ci-dessous : +Vous devriez avoir reçu une copie de la licence publique générale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la fondation pour le logiciel libre à l'adresse ci-dessous : Free Software Foundation, Inc.n 51 Franklin Street, -Fifth Floor, Boston, MA 02110-1301, USA. {2009 ?} {2014 ?} {2 -?} {51 ?} {02110-1301,?} +Fifth Floor, Boston, MA 02110-1301, USA. <html><head/><body><p><a href="http://pcmanfm.sourceforge.net/"><span style=" text-decoration: underline; color:#0000ff;">http://pcmanfm.sourceforge.net/</span></a></p></body></html> @@ -103,23 +92,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Gestionnaire de fichiers de PCMan -Copyright (C) 2009 - 2013 洪任諭 (Hong Jen Yee) +Copyright © 2009 - 2015 洪任諭 (Hong Jen Yee) -Ce programme est du logiciel libre ; vous le redistribuer -avec ou sans modification sous les termes de la licence pu- -blique générale GNU telle que publiée par le fondation pour -le logiciel libre, soit en version 2, soit en n'importe quelle -version ultérieure (à votre discrétion). +Ce programme est un logiciel libre ; vous pouvez le redistribuer ou le modifier suivant les termes de la “GNU General Public License” telle que publiée par la Free Software Foundation, soit en version 2, soit (à votre gré) toute version ultérieure. -Ce programme est distribué dans l'espoir qu'il soit utile, -mais SANS AUCUNE GARANTIE ; sans même la garantie impli- -cite de QUALITÉ MARCHANDE ou d'APTITUDE À UN CERTAIN -BUT. Voir la licence publique générale GNU pour de plus am- -ples détails. +Ce programme est distribué dans l'espoir qu'il vous sera utile, mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de COMMERCIALISABILITÉ, ni d’ADÉQUATION À UN OBJECTIF PARTICULIER. Consultez la Licence Générale Publique GNU pour plus de détails. -Vous devriez avoir reçu une copie de la licence publique géné- -rale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la -fondation pour le logiciel libre à l'adresse ci-dessous : +Vous devriez avoir reçu une copie de la licence publique générale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la fondation pour le logiciel libre à l'adresse ci-dessous : Free Software Foundation, Inc.n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -149,7 +128,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Detecting... - Détection en cours... + Détection en cours… @@ -162,7 +141,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Form - + Formulaire @@ -177,7 +156,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Image file - Fichier image + Fichier image @@ -187,7 +166,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. &Browse - &Parcourir + &Parcourir @@ -235,7 +214,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Label Text - Texte de l'étiquette + Texte de l'étiquette @@ -260,7 +239,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Window Manager - + Gestionnaire de fenêtre @@ -322,7 +301,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Go - Aller à… + Aller à @@ -422,37 +401,37 @@ Fifth Floor, Boston, MA 02110-1301, USA. &Ascending - + &Croissant &Descending - + &Décroissant &By File Name - + &Par nom de fichier By &Modification Time - + Par date de &modification By File &Type - + Par &type de fichier By &Owner - + Par &Propriétaire &Folder First - + &Dossiers d'abord @@ -472,17 +451,17 @@ Fifth Floor, Boston, MA 02110-1301, USA. &Case Sensitive - + Sensible à la &casse By File &Size - + Par &taille de fichier &Close Window - + &Fermer la fenêtre @@ -625,22 +604,22 @@ Fifth Floor, Boston, MA 02110-1301, USA. Ctrl+Shift+N - + Ctrl+Maj+N Ctrl+Alt+N - + Ctrl+Alt+N Filter - + Filtrer C&reate New - + Créer un &nouveau @@ -702,27 +681,27 @@ Fifth Floor, Boston, MA 02110-1301, USA. &Folder - + &Dossier &Blank File - + &Fichier vide &Find Files - + &Trouver des fichiers F3 - F3 + F3 Filter by string... - + Filtrer par chaîne… @@ -737,7 +716,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. &View - + &Voir @@ -846,7 +825,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Files or directories to open - + Fichiers ou dossiers à ouvrir @@ -924,12 +903,12 @@ Fifth Floor, Boston, MA 02110-1301, USA. Clear text (Ctrl+K) - + Effacer le texte (Ctrl+K) Version: %1 - + Version: %1 @@ -1119,7 +1098,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Remember the size of the last closed window - + Mémoriser la taille de la dernière fenêtre fermée @@ -1134,7 +1113,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. Delay of auto-selection in single click mode (0 to disable) - + Délai avant auto-sélection en mode simple click (0 pour désactiver) @@ -1144,7 +1123,7 @@ Fifth Floor, Boston, MA 02110-1301, USA. sec - + s @@ -1179,22 +1158,22 @@ Fifth Floor, Boston, MA 02110-1301, USA. Bookmarks: - + Marque-pages : Open in current tab - + Ouvrir dans l'onglet courant Open in new tab - + Ouvrir dans un nouvel onglet Open in new window - + Ouvrir dans une nouvelle fenêtre @@ -1204,32 +1183,32 @@ Fifth Floor, Boston, MA 02110-1301, USA. Confirm before moving files into "trash can" - + Confirmer avant de déplacer des fichiers à la poubelle Don't ask options on launch executable file - + Ne pas poser de questions avant lancement de fichier exécutable User interface - + Interface utilisateur Treat backup files as hidden - + Cacher les fichiers de sauvegarde Always show full file names - + Toujours montrer le nom complet des fichiers Show icons of hidden files shadowed - + Montrer les icônes de fichiers cachés ombragées @@ -1239,37 +1218,37 @@ Fifth Floor, Boston, MA 02110-1301, USA. Home - Page d'accueil + Page d'accueil Desktop - + Bureau Trash can - + Poubelle Computer - + Ordinateur Applications - + Applications Devices - + Périphériques Network - + Réseau @@ -1329,17 +1308,17 @@ Fifth Floor, Boston, MA 02110-1301, USA. Templates - + Modèles Show only user defined templates in menu - + Ne montrer que les modèles définis par l'utilisateur dans le menu Show only one template for each MIME type - + Ne montrer qu'un modèle pour chaque type MIME diff --git a/pcmanfm/translations/pcmanfm-qt_hu.ts b/pcmanfm/translations/pcmanfm-qt_hu.ts index eb4adf2..dcc5d60 100644 --- a/pcmanfm/translations/pcmanfm-qt_hu.ts +++ b/pcmanfm/translations/pcmanfm-qt_hu.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -11,13 +11,31 @@ <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html> - + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html> Lightweight file manager Könnyed fájlkezelő + + + <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> + <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> + + + + Programming: +* Hong Jen Yee (PCMan) <pcman.tw@gmail.com> + + Programozó: +* Hong Jen Yee (PCMan) <pcman.tw@gmail.com> + + + + Authors + Szerzők + PCMan File Manager @@ -37,25 +55,23 @@ 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. - - - - - Programming: -* Hong Jen Yee (PCMan) <pcman.tw@gmail.com> - - Programfejlesztő: -* Hong Jen Yee (PCMan) <pcman.tw@gmail.com> - - - - <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> - - - - - Authors - Szerzők + PCMan File Manager + +Copyright (C) 2009 - 2014 洪任諭 (Hong Jen Yee) + +Ez egy szabad szoftver, ami a Free Software Foundation által +megjelentetett GNU General Public Licensz 2-es, vagy későbbi +verzióiban felsorolt feltételekkel szabadon terjeszthető, módosítható. + +A megjelentetők remélik, hogy a program hasznos, viszont +SEMMILYEN GARANCIÁT NEM VÁLLALNAK, beleértve áttételesen az +ÜZLETI célú hasznosítására, továbbá a SPECIÁLIS CÉLRA TÖRTÉNŐ +HASZNÁLHATÓSÁGÁRA sem. További részletek a GNU General Public Licensz soraiban. + +Ezzel a programmal együtt meg kellett kapnia a GNU General +Public Licensz másolatát is, ha nem, akkor írjon a Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA címre. + @@ -68,7 +84,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Removable medium is inserted - Új hordozható adathordozó észlelve + Új cserélhető adathordozó észlelve @@ -96,32 +112,32 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Form - + Űrlap Desktop - Asztal + Asztal Desktop folder: - Asztal mappa: + Asztal mappa: Image file - Képfájl + Képfájl Folder path - Könyvtár útvonal + Könyvtár útvonal &Browse - &Böngészés + &Böngészés @@ -201,18 +217,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Show menus provided by window managers when desktop is clicked Asztalra kattintva az ablakkezelő menüje látszik - - Desktop - Asztal - - - Desktop folder: - Asztal mappa: - - - Folder path - Könyvtár útvonal - Advanced @@ -226,6 +230,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< File Manager Fájlkezelő + + + Go &Up + &Föl + Go Up @@ -237,33 +246,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Alt+Föl - Home - Saját könyvtár + + &Home + &Saját könyvtár Alt+Home - + Alt+Home - - Reload - Újratölt + + &Reload + Új&ratölt F5 - - - - - &Home - - - - - &Reload - Új&ratölt + F5 @@ -280,6 +280,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &About Ról&am + + + &New Window + Ú&J ablak + New Window @@ -288,7 +293,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Ctrl+N - + Ctrl+N @@ -298,7 +303,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Ctrl+H - + Ctrl+H @@ -330,10 +335,40 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Applications &Alkalmazások + + + Reload + Újratölt + + + + &Icon View + &Ikonnézet + + + + &Compact View + &Tömör nézet + + + + &Detailed List + &Teljes lista + + + + &Thumbnail View + &Bélyegképek + + + + Cu&t + &Kivág + Ctrl+X - + Ctrl+X @@ -343,7 +378,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Ctrl+C - + Ctrl+C @@ -353,13 +388,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Ctrl+V - + Ctrl+V Select &All &Mindet + + + Ctrl+A + Ctrl+A + Pr&eferences @@ -368,135 +408,62 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Ascending - + &Növekvő &Descending - + &Csökkenő &By File Name - + &Fájlnév szerint By &Modification Time - + &Módosítási idő szerint By File &Type - + Fájl&típus szerint By &Owner - + &Tulajdonos szerint &Folder First - - - - - &Invert Selection - K&ijelölés megfordítás - - - - &Delete - &Töröl - - - - &Rename - &Átnevez + Ma&ppák elől &Case Sensitive - + Na&gybetűérzékeny By File &Size - + Fá&jlméret szerint &Close Window - - - - - Ctrl+A - - - - - Go &Up - &Föl - - - - &New Window - &ÚJ ablak - - - - &Icon View - &Ikonnézet - - - - &Compact View - &Tömör nézet - - - - &Detailed List - &Teljes lista - - - - &Thumbnail View - &Bélyegképek - - - - Cu&t - &Kivág + A&blak bezárás - Ascending - Növekvő - - - Descending - Csökkenő - - - By File Name - Név - - - By Modification Time - Módosítási idő - - - By File Type - Típus - - - By Owner - Tulajdonos + + &Folder + &Mappa - Folder First - Mappák elől + + &Blank File + &Üres fájl @@ -511,7 +478,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Ctrl+T - + Ctrl+T @@ -543,82 +510,55 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Alt+Right Alt+Jobb + + + &Invert Selection + K&ijelölés megfordítás + + + + &Delete + &Töröl + Del - + Del + + + + &Rename + &Átnevez F2 - + F2 C&lose Tab Fü&l bezárás + + + Ctrl+W + Ctrl+W + File &Properties &Fájljellemzők - - - &Folder Properties - &Mappajellemzők - - - - Ctrl+Shift+N - - - - - Ctrl+Alt+N - - - - - Filter - - - - - C&reate New - - - - - &Sorting - &Rendezés - - - - Main Toolbar - Eszközsáv - - - - Ctrl+W - - Alt+Return - - - - Case Sensitive - Nagybetűérzékeny - - - By File Size - Fájlméret + Alt+Return - Close Window - Ablak bezárás + + &Folder Properties + &Mappajellemzők @@ -633,7 +573,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< F4 - + F4 @@ -646,35 +586,45 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Könyvj&elzőkezelés - - &Folder - + + Ctrl+Shift+N + Ctrl+Shift+N - - &Blank File - + + Ctrl+Alt+N + Ctrl+Alt+N &Find Files - + &Fájlkeresés F3 - + F3 + + + + Filter + Szűrő Filter by string... - + Szövegszűrő... &File &Fájl + + + C&reate New + Ú&j létrehozás + &Help @@ -685,6 +635,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &View &Nézet + + + &Sorting + Rendezé&s + &Edit @@ -705,6 +660,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Tool &Eszközök + + + Main Toolbar + Eszközsáv + PCManFM::Application @@ -716,12 +676,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< PROFILE - + PROFIL Run PCManFM as a daemon - A PCManFM mint daemon fut + PCManFM daemon-ként @@ -747,7 +707,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< NAME - + NÉV @@ -767,7 +727,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< FILE - FILE + FÁJL @@ -777,7 +737,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< MODE - + MÓD @@ -792,7 +752,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< [FILE1, FILE2,...] - + [FÁJL1, FÁJL2,...] @@ -870,7 +830,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Clear text (Ctrl+K) - + Szövegtörlés (Ctrl+K) @@ -896,7 +856,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Switch user command is not set. - A felhasználót váltó alkalmazás beállítatlan. + Felhasználóváltó parancs határozatlan. @@ -1040,16 +1000,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Window Ablak - - - Default width of new windows: - Új ablak alapszélessége: - - - - Default height of new windows: - Új ablak alapmagassága: - Always show the tab bar @@ -1065,6 +1015,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Remember the size of the last closed window Utoljára bezárt ablak méretének megjegyzése + + + Default width of new windows: + Új ablak alapszélessége: + + + + Default height of new windows: + Új ablak alapmagassága: + Browsing @@ -1083,27 +1043,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Default view mode: - Alapértelmezett nézet: + Alapértelmezett nézetmód: sec - + mp File Operations - Fájlkezelések + Fájlműveletek Confirm before deleting files - Törlés előtti megerősítés + Törlés előtt megerősítés Move deleted files to "trash bin" instead of erasing from disk. - Törölt fájlok lemezről törlés helyett a kukába a kukába mennek. + Törölt fájlok lemezről törlés helyett a kukába mennek. @@ -1118,112 +1078,112 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Display - + Képernyő Bookmarks: - + Könyvjelzők: Open in current tab - + Megnyitás itt Open in new tab - + Megnyitás új fülön Open in new window - + Megnyitás új ablakban Erase files on removable media instead of "trash can" creation - + Cserélhető adathordozón a fájlok törlése "kukázás" helyett Confirm before moving files into "trash can" - + Megerősítés "kukázás" előtt Don't ask options on launch executable file - + Fájl futtatás előtt nincs opció kérés User interface - + Kezelőfelület Treat backup files as hidden - + Biztonsági mentett fájlokat rejtettként kezel Always show full file names - + Mindig részletes fájlnevek Show icons of hidden files shadowed - + Rejtett fájlok ikonjai árnyékoltak Show in places - + Helyben látható Home - Saját könyvtár + Saját könyvtár Desktop - Asztal + Asztal Trash can - + Kuka Computer - + Számítógép Applications - + Alkalmazások Devices - + Eszközök Network - + Hálózat Do not generate thumbnails for image files exceeding this size: - Nincs, ha a fájl ennél nagyobb: + Nincs kép, ha a fájl ennél nagyobb: KB - + KB @@ -1253,80 +1213,64 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Close &tab containing removable medium - + Cserélhe&tő adathortozós fül bezárása Chan&ge folder in the tab to home folder - + A &fül a saját mappát fogja mutatni + + + + Programs + Programok + + + + Terminal emulator: + Terminálemulátor: Switch &user command: - + Fel&használó váltási parancs: + + + + Examples: "xterm -e %s" for terminal or "gksu %s" for switching user. +%s = the command line you want to execute with terminal or su. + Példa: "xterm -e %s" terminálhoz "gksu %s" felhasználóváltáshoz. +%s = A parancs, mely terminálhoz, vagy rendszergazdakénti végrehajtáshoz kell. Archiver in&tegration: - + Csomagoló beépí&tés: Templates - + Társítások Show only user defined templates in menu - + Menüben csak felhasználói társítások Show only one template for each MIME type - + Minden MIME típushoz csak egy társítás látható Run default application after creation from template - - - - Close tab containing removable medium - Cserélhető adathordozó fülének bezárása - - - Change folder in the tab to home folder - A fül a saját mappát fogja mutatni - - - - Programs - Programok - - - - Terminal emulator: - Terminálemulátor: - - - Switch user command: - Felhasználó váltási parancs: - - - - Examples: "xterm -e %s" for terminal or "gksu %s" for switching user. -%s = the command line you want to execute with terminal or su. - Példa: "xterm -e %s" terminálhoz "gksu %s" felhasználóváltáshoz. -%s = A parancs, mely terminálhoz, vagy rendszergazdakénti végrehajtáshoz kell. - - - Archiver integration: - Csomagoló beépítés: + Tásítás után az alapértelmezett alkalmazás fut Use SI decimal prefixes instead of IEC binary prefixes - + IEC bináris helyett SI decimális prefix használata diff --git a/pcmanfm/translations/pcmanfm-qt_it.ts b/pcmanfm/translations/pcmanfm-qt_it.ts index 36150e5..a1cee94 100644 --- a/pcmanfm/translations/pcmanfm-qt_it.ts +++ b/pcmanfm/translations/pcmanfm-qt_it.ts @@ -21,7 +21,7 @@ <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> - + <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> @@ -42,11 +42,27 @@ 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. - + PCMan Gestore file + +Copyright (C) 2009 - 2014 洪任諭 (Hong Jen Yee) + +Questo programma è software libero; puoi redistribuirlo e/o +modificarlo nei termini della GNU General Public License +come pubblicata dalla Free Software Foundation; nella versione 2 +della licenza, o (a tua scelta) qualsiasi versione successiva. + +Questo programma è distribuito nella speranza che possa essere utile, +ma SENZA ALCUNA GARANZIA; senza nemmeno la garanzia implicita di +COMMERCIABILITÀ o IDONEITÀ PER FINI PARTICOLARI. Vedi la +GNU General Public License per ulteriori dettagli. + +Dovresti aver ricevuto una copia della GNU General Public License +insieme a questo programma; In caso contrario, scrivi a Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. <html><head/><body><p><a href="http://pcmanfm.sourceforge.net/"><span style=" text-decoration: underline; color:#0000ff;">http://pcmanfm.sourceforge.net/</span></a></p></body></html> - <html><head/><body><p><a href="http://pcmanfm.sourceforge.net/"><span style=" text-decoration: underline; color:#0000ff;">http://pcmanfm.sourceforge.net/</span></a></p></body></html> + <html><head/><body><p><a href="http://pcmanfm.sourceforge.net/"><span style=" text-decoration: underline; color:#0000ff;">http://pcmanfm.sourceforge.net/</span></a></p></body></html> @@ -93,7 +109,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Please select the action you want to perform: - Scegliere l'azione da eseguire: + Seleziona l'azione da eseguire: @@ -101,32 +117,32 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Form - + Modulo Desktop - Scrivania + Scrivania Desktop folder: - Cartella scrivania: + Cartella della scrivania: Image file - File immagine + File immagine Folder path - Percorso + Percorso della cartella &Browse - &Sfoglia + &Sfoglia @@ -149,12 +165,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Wallpaper image file: - File immagine sfondo: + File immagine di sfondo: Select background color: - Colore sfondo: + Seleziona il colore di sfondo: @@ -179,44 +195,44 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Select text color: - Colore testo: + Seleziona il colore del testo: Select shadow color: - Colore dell'ombra: + Seleziona il colore delle ombre: Select font: - Carattere: + Seleziona il carattere: General - Generali + Generale Window Manager - Gestore finestre + Gestore delle finestre Show menus provided by window managers when desktop is clicked - Mostra il menu forniti dal gestore finestre quando si fa click sulla scrivania + Mostra i menu forniti dal gestore delle finestre quando fai clic sul desktop Desktop - Scrivania + Scrivania Desktop folder: - Cartella scrivania: + Cartella della scrivania: Folder path - Percorso + Percorso della cartella @@ -243,7 +259,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Home - Cartella home + Cartella home @@ -263,7 +279,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Home - + &Home @@ -298,7 +314,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Show &Hidden - Mostra file &nascosti + Mostra i file &nascosti @@ -373,37 +389,37 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Ascending - + &Crescente &Descending - + &Decrescente &By File Name - + &Per nome file By &Modification Time - + Per data di &modifica By File &Type - + Per &tipo di file By &Owner - + Per pr&oprietario &Folder First - + Prima le ca&rtelle @@ -413,7 +429,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Delete - &Rimuovi + &Elimina @@ -462,31 +478,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Ascending - Crescente + Crescente Descending - Decrescente + Decrescente By File Name - Per nome file + Per nome file By Modification Time - Per data modifica + Per data modifica By File Type - Per tipo file + Per tipo file By Owner - Per proprietario + Per proprietario Folder First - Prima le cartelle + Prima le cartelle @@ -561,62 +577,62 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Case Sensitive - + Distingui le maius&cole By File &Size - + Per dimen&sione del file &Close Window - + &Chiudi finestra &Folder - + &Cartella Ctrl+Shift+N - + Ctrl+Shift+N &Blank File - + File &vuoto Ctrl+Alt+N - + Ctrl+Alt+N &Find Files - + Trova &file F3 - F3 + F3 Filter - + Filtro Filter by string... - + Filtra per stringa... C&reate New - + C&rea nuovo @@ -626,7 +642,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Main Toolbar - Barra strumenti principale + Barra degli strumenti principale @@ -640,15 +656,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Case Sensitive - Distingui MAIUSCOLE/minuscole + Distingui le maiuscole By File Size - Per dimensione file + Per dimensione del file Close Window - Chiudi finestra + Chiudi finestra @@ -726,12 +742,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Run PCManFM as a daemon - Esegue PCManFM come demone + Esegui PCManFM come demone Quit PCManFM - Esce da PCManFM + Esci da PCManFM @@ -741,7 +757,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Turn off desktop manager if it's running - Spegne il gestore della scrivania se è in esecuzione + Spegni il gestore della scrivania se è in esecuzione @@ -772,7 +788,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< MODE - MODE + MODO @@ -798,7 +814,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Files or directories to open - Cartelle o file da aprire + File o cartelle da aprire @@ -876,7 +892,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Clear text (Ctrl+K) - + Cancella il testo (Ctrl+K) @@ -891,7 +907,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< &Delete - &Rimuovi + &Elimina @@ -944,8 +960,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< %n item(s) - %n oggetto - %n oggetti + %n elemento + %n elementi @@ -1006,7 +1022,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Volume - Periferiche + Volume @@ -1071,7 +1087,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Remember the size of the last closed window - Ricorda dimensione della ultima finestra chiusa + Ricorda la dimensione della ultima finestra chiusa @@ -1081,12 +1097,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Open files with single click - Apri file con un click singolo + Apri file con un clic singolo Delay of auto-selection in single click mode (0 to disable) - Ritardo per l'auto-selezione in modalità click singolo + Ritardo per la selezione automatica in modalità con clic singolo (0 per disabilitare) @@ -1126,102 +1142,102 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Display - + Schermo Bookmarks: - + Segnalibri: Open in current tab - + Apri nella scheda attuale Open in new tab - + Apri in una nuova scheda Open in new window - + Apri una nuova finestra Erase files on removable media instead of "trash can" creation - + Cancella i file sui supporti rimovibile invece di cestinarli Confirm before moving files into "trash can" - + Conferma prima di cestinare i file Don't ask options on launch executable file - + Non chiedere opzioni all'avvio dei file eseguibili User interface - + Interfaccia utente Treat backup files as hidden - + Tratta i file di backup come nascosti Always show full file names - + Mostra sempre il nome completo dei file Show icons of hidden files shadowed - + Mostra le icone dei file nascosti come ombreggiate Show in places - + Mostra in Risorse Home - Cartella home + Home Desktop - Scrivania + Scrivania Trash can - + Cestino Computer - + Computer Applications - + Applicazioni Devices - + Dispositivi Network - + Rete @@ -1281,22 +1297,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Templates - + Modelli Show only user defined templates in menu - + Mostra solo i modelli definiti dall'utente nel menu Show only one template for each MIME type - + Mostra solo un modello per ogni tipo MIME Run default application after creation from template - + Esegui l'applicazione predefinita dopo la creazione da modello @@ -1310,7 +1326,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Switch user command: - Comando per cambiare utente: + Comando per cambiare utente: @@ -1321,7 +1337,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Archiver integration: - Integrazione con gli archivi: + Integrazione con gli archivi: diff --git a/pcmanfm/translations/pcmanfm-qt_ru.desktop b/pcmanfm/translations/pcmanfm-qt_ru.desktop new file mode 100644 index 0000000..b98b6a3 --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt_ru.desktop @@ -0,0 +1,4 @@ +#Translations +Name[ru]=Диспетчер файлов PCManFM +GenericName[ru]=Диспетчер файлов +Comment[ru]=Просматривайте файловую систему и управляйте файлами \ No newline at end of file diff --git a/pcmanfm/translations/pcmanfm-qt_ru.ts b/pcmanfm/translations/pcmanfm-qt_ru.ts index 493dbb0..d09589b 100644 --- a/pcmanfm/translations/pcmanfm-qt_ru.ts +++ b/pcmanfm/translations/pcmanfm-qt_ru.ts @@ -4,32 +4,32 @@ AboutDialog - + About О программе - + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html> <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html> - + Lightweight file manager Легковесный диспетчер файлов - + <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> - + Authors Авторы - + Programming: * Hong Jen Yee (PCMan) <pcman.tw@gmail.com> @@ -38,12 +38,12 @@ - + License Лицензия - + PCMan File Manager Copyright (C) 2009 - 2014 洪任諭 (Hong Jen Yee) @@ -85,27 +85,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, AutoRunDialog - + Removable medium is inserted Вставлен съёмный носитель - + <b>Removable medium is inserted</b> <b>Вставлен съёмный носитель</b> - + Type of medium: Тип носителя: - + Detecting... Обнаружение... - + Please select the action you want to perform: Выберите действие, которое хотите совершить: @@ -113,105 +113,105 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, DesktopFolder - + Form - + Desktop - Рабочий стол + Рабочий стол - + Desktop folder: - Папка рабочего стола: + Папка рабочего стола: - + Image file - Файл изображения + Файл изображения - + Folder path - Путь к папке + Путь к папке - + &Browse - &Обзор + &Обзор DesktopPreferencesDialog - + Desktop Preferences Настройки рабочего стола - + General Общие - + Background Фон - + Wallpaper mode: Режим обоев: - + Wallpaper image file: Файл изображения обоев: - + Select background color: Выбрать цвет фона: - + Image file Файл изображения - + Image file path Путь к файлу изображения - + &Browse &Обзор - + Label Text Текст ярлыков - + Select text color: Выбрать цвет текста: - + Select shadow color: Выбрать цвет тени: - + Select font: Выбрать шрифт: - + Window Manager Оконный менеджер @@ -228,12 +228,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, Путь к папке - + Advanced Расширенные - + Show menus provided by window managers when desktop is clicked Показывать меню, предоставляемые оконными менеджерами по клику на рабочий стол @@ -241,553 +241,598 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, FindFilesDialog + Find Files - Найnb файлы + Найnb файлы + Name/Location - Имя/расположение + Имя/расположение + File name patterns - Шаблоны имён файлов + Шаблоны имён файлов + Pattern: - Шаблон: + Шаблон: + + Case insensitive - Регистрочувствительный + Регистрочувствительный + + Use regular expression - Использовать регулярные выражения + Использовать регулярные выражения + Places to search - Места поиска + Места поиска + Add - Добавить + Добавить + Remove - Удалить + Удалить + Search in sub directories - Искать в подпапках + Искать в подпапках + Search hidden files - Искать скрытые файлы + Искать скрытые файлы + + File Type - Тип файла + Тип файла + Only search for files of following types: - Искать только следующие типы файлов: + Искать только следующие типы файлов: + Text files - Текстовые файлы + Текстовые файлы + Image files - Файлы изображений + Файлы изображений + Audio files - Аудиофайлы + Аудиофайлы + Video files - Видеофайлы + Видеофайлы + Documents - Документы + Документы + Content - Содержание + Содержание + File contains - Содержание файла + Содержание файла + Properties - Свойства + Свойства + File Size - Размер файла + Размер файла + Bigger than: - Больше чем: + Больше чем: + Smaller than: - Меньше чем: + Меньше чем: + Last Modified Time - Время последнего изменения + Время последнего изменения + Earlier than: - Раньше чем: + Раньше чем: + Later than: - Позже чем: + Позже чем: MainWindow - + File Manager Диспетчер файлов - + Ctrl+Shift+N - + Ctrl+Alt+N - + Filter - + Фильтр - + Filter by string... - + Фильтровать по строке... - + &File &Файл - + C&reate New С&оздать новое - + &Help &Справка - + &View &Вид - + &Sorting &Сортировка - + &Edit &Правка - + &Bookmarks &Закладки - + &Go &Перейти - + &Tool &Инструмент - + Main Toolbar Главная панель инструментов - + Go &Up Перейти &вверх - + Go Up Перейти вверх - + Alt+Up - + &Home &Домой - + Alt+Home - + &Reload &Обновить - + F5 - + Go Перейти - + Quit Выйти - + &About &О программе - + &New Window &Новое окно - + New Window Новое окно - + Ctrl+N - + Show &Hidden Показать &скрытые - + Ctrl+H - + &Computer &Компьютер - + &Trash &Корзина - + &Network &Сеть - + &Desktop &Рабочий стол - + &Add to Bookmarks &Добавить в закладки - + &Applications &Приложения - + Reload Обновить - + &Icon View Просмотр &значками - + &Compact View &Компактный просмотр - + &Detailed List Просмотр &подробным списком - + &Thumbnail View Просмотр &эскизами - + Cu&t &Вырезать - + Ctrl+X - + &Copy &Копировать - + Ctrl+C - + &Paste &Вставить - + Ctrl+V - + Select &All Выделить &всё - + Ctrl+A - + Pr&eferences &Настройки - + &Ascending По &возрастанию - + &Descending По &убыванию - + &By File Name &По имени файла - + By &Modification Time По времени &изменения - + By File &Type По &типу файла - + By &Owner По &владельцу - + &Folder First Сначала &папки - + &Case Sensitive &Регистрочувствительная - + By File &Size По &размеру файла - + &Close Window &Закрыть окно - + &Folder &Папка - + &Blank File &Пустой файл - + &Find Files &Найти файлы - + F3 - + + Close &left tabs + Закрыть вкладки &слева + + + + Close &right tabs + Закрыть вкладки &справа + + + + Close &other tabs + Закрыть &другие + + + New &Tab Новая &вкладка - + New Tab Новая вкладка - + Ctrl+T - + Go &Back Перейти &назад - + Go Back Перейти назад - + Alt+Left - + Go &Forward Перейти &вперёд - + Go Forward Перейти вперёд - + Alt+Right - + &Invert Selection &Инвертировать выделение - + &Delete &Удалить - + Del - + &Rename &Переименовать - + F2 - + C&lose Tab &Закрыть вкладку - + Ctrl+W - + File &Properties &Свойства файла - + Alt+Return - + &Folder Properties &Свойства папки - + Edit Bookmarks Изменить закладки - + Open &Terminal Открыть &терминал - + F4 - + Open as &Root Открыть от имени &суперпользователя - + &Edit Bookmarks &Изменить закладки @@ -795,99 +840,99 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PCManFM::Application - + Name of configuration profile Имя профиля конфигурации - + PROFILE ПРОФИЛЬ - + Run PCManFM as a daemon Запустить PCManFM как демон - + Quit PCManFM Выйти из PCManFM - + Launch desktop manager Запустить менеджер рабочего стола - + Turn off desktop manager if it's running Отключить менеджер рабочего стола, если он запущен - + Open desktop preference dialog on the page with the specified name Открыть диалог настроек рабочего стола на странице с указанным именем - - + + NAME ИМЯ - + Set desktop wallpaper from image FILE Выбрать обои рабочего стола из ФАЙЛА изображения - + FILE ФАЙЛ - + Set mode of desktop wallpaper. MODE=(color|stretch|fit|center|tile) Выбрать режим обоев рабочего стола. РЕЖИМ=(цвет|растянуть|вместить|по центру|черепицей) - + MODE РЕЖИМ - + Open Preferences dialog on the page with the specified name Открыть диалог настроек на странице с указанным именем - + Open new window Открыть новое окно - + Open Find Files utility Открыть утилиту поиска файлов - + [FILE1, FILE2,...] [ФАЙЛ1, ФАЙЛ2,...] - + Files or directories to open Файлы или папки для открытия - - + + Error Ошибка - + Terminal emulator is not set. Эмулятор терминала не указан. @@ -954,33 +999,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PCManFM::MainWindow - + Clear text (Ctrl+K) - + Стереть текст (Ctrl+K) - + Version: %1 Версия: %1 - + &Move to Trash &Переместить в корзину - + &Delete &Удалить - - + + Error Ошибка - + Switch user command is not set. Команда переключения пользователя не задана. @@ -1011,17 +1056,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PCManFM::TabPage - + Error Ошибка - + Free space: %1 (Total: %2) Свободное место: %1 (всего: %2) - + %n item(s) %n объект @@ -1030,7 +1075,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, - + (%n hidden) (%n скрыт) @@ -1039,7 +1084,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, - + %1 item(s) selected %1 объекта(ов) выделено @@ -1065,340 +1110,340 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PreferencesDialog - + Preferences Настройки - + User Interface Интерфейс пользователя - + Behavior Поведение - - + + Thumbnail Эскизы - + Volume Том - + Advanced Расширенные - + Icons Значки - + Size of big icons: Размер больших значков: - + Size of small icons: Размер маленьких значков: - + Size of thumbnails: Размер значков: - + Size of side pane icons: Размер значков боковой панели: - + Icon theme: Тема значков: - + Window Окно - + Always show the tab bar Всегда показывать панель вкладок - + Show 'Close' buttons on tabs Показывать кнопку «Закрыть» на вкладках - + Remember the size of the last closed window Запоминать размер последнего закрытого окна - + Default width of new windows: Ширина новых окон по умолчанию: - + Default height of new windows: Высота новых окон по умолчанию: - + Browsing Просмотр - + Open files with single click Открывать файлы по одиночному щелчку мыши - + Delay of auto-selection in single click mode (0 to disable) Задержка автовыделения в режиме одиночного щелчка (0 для отключения) - + Default view mode: Режим просмотра по умолчанию: - + sec сек - + File Operations Операции с файлами - + Confirm before deleting files Подтверждение перед удалением файлов - + Move deleted files to "trash bin" instead of erasing from disk. Перемещать удалённые файлы в корзину вместо удаления их с диска. - + Show thumbnails of files Показывать эскизы файлов - + Only show thumbnails for local files Показывать эскизы только для локальных файлов - + Display Вид - + Bookmarks: Закладки: - + Open in current tab Открывать в текущей вкладке - + Open in new tab Открывать в новой вкладке - + Open in new window Открывать в новом окне - + Erase files on removable media instead of "trash can" creation Удалять файлы на съёмных носителях вместо создания «Корзины» - + Confirm before moving files into "trash can" Просить подтверждения перед удалением файлов в «Корзину» - + Don't ask options on launch executable file Не предлагать варианты запуска исполняемых файлов - + User interface Интерфейс пользователя - + Treat backup files as hidden Рассматривать резервные файлы как скрытые - + Always show full file names Всегда показывать полные имена файлов - + Show icons of hidden files shadowed Показывать значки скрытых файлов затенёнными - + Show in places Показвать в «Местах» - + Home Домой - + Desktop Рабочий стол - + Trash can Корзина - + Computer Компьютер - + Applications Приложения - + Devices Устройства - + Network Сеть - + Do not generate thumbnails for image files exceeding this size: Не создавать эскизы для файлов изображений больших чем: - + KB КБ - + Auto Mount Автоподключение - + Mount mountable volumes automatically on program startup Подключать съёмные тома автоматически при запуске программы - + Mount removable media automatically when they are inserted Подключать съёмные тома автоматически при их подключении - + Show available options for removable media when they are inserted Показывать доступные варианты для съёмных устройств при их вставлении - + When removable medium unmounted: При отключении съёмного устройства: - + Close &tab containing removable medium Закрыть &вкладку, отображающую содержимое съёмного носителя - + Chan&ge folder in the tab to home folder Изме&нить папку во вкладке на домашнюю - + Switch &user command: Команда смены &пользователя: - + Archiver in&tegration: Ин&теграция с архиваторами: - + Templates Шаблоны - + Show only user defined templates in menu Показывать только шаблоны, определённые пользователем, в меню - + Show only one template for each MIME type Показывать только один шаблон для каждого типа MIME - + Run default application after creation from template Запускать приложение по умолчанию после создания шаблона - + Programs Программы - + Terminal emulator: Эмулятор терминала: - + Examples: "xterm -e %s" for terminal or "gksu %s" for switching user. %s = the command line you want to execute with terminal or su. Примеры: "xterm -e %s" для терминала или "gksu %s" для переключения пользователя. %s = командная строка,которую вы хотите выполнить с терминалом или su. - + Use SI decimal prefixes instead of IEC binary prefixes Использовать десятичные префиксы СИ вместо двоичных префиксов IEC diff --git a/pcmanfm/translations/pcmanfm-qt_ru_RU.desktop b/pcmanfm/translations/pcmanfm-qt_ru_RU.desktop new file mode 100644 index 0000000..7f7a0fd --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt_ru_RU.desktop @@ -0,0 +1,4 @@ +#Translations +Name[ru_RU]=Диспетчер файлов PCManFM +GenericName[ru_RU]=Диспетчер файлов +Comment[ru_RU]=Просматривайте файловую систему и управляйте файлами \ No newline at end of file diff --git a/pcmanfm/translations/pcmanfm-qt_ru_RU.ts b/pcmanfm/translations/pcmanfm-qt_ru_RU.ts index 8f26a3c..ad922f8 100644 --- a/pcmanfm/translations/pcmanfm-qt_ru_RU.ts +++ b/pcmanfm/translations/pcmanfm-qt_ru_RU.ts @@ -4,32 +4,32 @@ AboutDialog - + About О программе - + <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html> <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html> - + Lightweight file manager Легковесный диспетчер файлов - + <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> <html><head/><body><p><a href="http://lxqt.org/"><span style=" text-decoration: underline; color:#0000ff;">http://lxqt.org/</span></a></p></body></html> - + Authors Авторы - + Programming: * Hong Jen Yee (PCMan) <pcman.tw@gmail.com> @@ -38,12 +38,12 @@ - + License Лицензия - + PCMan File Manager Copyright (C) 2009 - 2014 洪任諭 (Hong Jen Yee) @@ -85,27 +85,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, AutoRunDialog - + Removable medium is inserted Вставлен съёмный носитель - + <b>Removable medium is inserted</b> <b>Вставлен съёмный носитель</b> - + Type of medium: Тип носителя: - + Detecting... Обнаружение... - + Please select the action you want to perform: Выберите действие, которое хотите совершить: @@ -113,105 +113,105 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, DesktopFolder - + Form - + Desktop - Рабочий стол + Рабочий стол - + Desktop folder: - Папка рабочего стола: + Папка рабочего стола: - + Image file - Файл изображения + Файл изображения - + Folder path - Путь к папке + Путь к папке - + &Browse - &Обзор + &Обзор DesktopPreferencesDialog - + Desktop Preferences Настройки рабочего стола - + General Общие - + Background Фон - + Wallpaper mode: Режим обоев: - + Wallpaper image file: Файл изображения обоев: - + Select background color: Выбрать цвет фона: - + Image file Файл изображения - + Image file path Путь к файлу изображения - + &Browse &Обзор - + Label Text Текст ярлыков - + Select text color: Выбрать цвет текста: - + Select shadow color: Выбрать цвет тени: - + Select font: Выбрать шрифт: - + Window Manager Оконный менеджер @@ -228,12 +228,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, Путь к папке - + Advanced Расширенные - + Show menus provided by window managers when desktop is clicked Показывать меню, предоставляемые оконными менеджерами по клику на рабочий стол @@ -241,553 +241,598 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, FindFilesDialog + Find Files - Найnb файлы + Найnb файлы + Name/Location - Имя/расположение + Имя/расположение + File name patterns - Шаблоны имён файлов + Шаблоны имён файлов + Pattern: - Шаблон: + Шаблон: + + Case insensitive - Регистрочувствительный + Регистрочувствительный + + Use regular expression - Использовать регулярные выражения + Использовать регулярные выражения + Places to search - Места поиска + Места поиска + Add - Добавить + Добавить + Remove - Удалить + Удалить + Search in sub directories - Искать в подпапках + Искать в подпапках + Search hidden files - Искать скрытые файлы + Искать скрытые файлы + + File Type - Тип файла + Тип файла + Only search for files of following types: - Искать только следующие типы файлов: + Искать только следующие типы файлов: + Text files - Текстовые файлы + Текстовые файлы + Image files - Файлы изображений + Файлы изображений + Audio files - Аудиофайлы + Аудиофайлы + Video files - Видеофайлы + Видеофайлы + Documents - Документы + Документы + Content - Содержание + Содержание + File contains - Содержание файла + Содержание файла + Properties - Свойства + Свойства + File Size - Размер файла + Размер файла + Bigger than: - Больше чем: + Больше чем: + Smaller than: - Меньше чем: + Меньше чем: + Last Modified Time - Время последнего изменения + Время последнего изменения + Earlier than: - Раньше чем: + Раньше чем: + Later than: - Позже чем: + Позже чем: MainWindow - + File Manager Диспетчер файлов - + Ctrl+Shift+N - + Ctrl+Alt+N - + Filter - + Фильтр - + Filter by string... - + Фильтровать по строке... - + &File &Файл - + C&reate New С&оздать новое - + &Help &Справка - + &View &Вид - + &Sorting &Сортировка - + &Edit &Правка - + &Bookmarks &Закладки - + &Go &Перейти - + &Tool &Инструмент - + Main Toolbar Главная панель инструментов - + Go &Up Перейти &вверх - + Go Up Перейти вверх - + Alt+Up - + &Home &Домой - + Alt+Home - + &Reload &Обновить - + F5 - + Go Перейти - + Quit Выйти - + &About &О программе - + &New Window &Новое окно - + New Window Новое окно - + Ctrl+N - + Show &Hidden Показать &скрытые - + Ctrl+H - + &Computer &Компьютер - + &Trash &Корзина - + &Network &Сеть - + &Desktop &Рабочий стол - + &Add to Bookmarks &Добавить в закладки - + &Applications &Приложения - + Reload Обновить - + &Icon View Просмотр &значками - + &Compact View &Компактный просмотр - + &Detailed List Просмотр &подробным списком - + &Thumbnail View Просмотр &эскизами - + Cu&t &Вырезать - + Ctrl+X - + &Copy &Копировать - + Ctrl+C - + &Paste &Вставить - + Ctrl+V - + Select &All Выделить &всё - + Ctrl+A - + Pr&eferences &Настройки - + &Ascending По &возрастанию - + &Descending По &убыванию - + &By File Name &По имени файла - + By &Modification Time По времени &изменения - + By File &Type По &типу файла - + By &Owner По &владельцу - + &Folder First Сначала &папки - + &Case Sensitive &Регистрочувствительная - + By File &Size По &размеру файла - + &Close Window &Закрыть окно - + &Folder &Папка - + &Blank File &Пустой файл - + &Find Files &Найти файлы - + F3 - + + Close &left tabs + Закрыть вкладки &слева + + + + Close &right tabs + Закрыть вкладки &справа + + + + Close &other tabs + Закрыть &другие + + + New &Tab Новая &вкладка - + New Tab Новая вкладка - + Ctrl+T - + Go &Back Перейти &назад - + Go Back Перейти назад - + Alt+Left - + Go &Forward Перейти &вперёд - + Go Forward Перейти вперёд - + Alt+Right - + &Invert Selection &Инвертировать выделение - + &Delete &Удалить - + Del - + &Rename &Переименовать - + F2 - + C&lose Tab &Закрыть вкладку - + Ctrl+W - + File &Properties &Свойства файла - + Alt+Return - + &Folder Properties &Свойства папки - + Edit Bookmarks Изменить закладки - + Open &Terminal Открыть &терминал - + F4 - + Open as &Root Открыть от имени &суперпользователя - + &Edit Bookmarks &Изменить закладки @@ -795,99 +840,99 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PCManFM::Application - + Name of configuration profile Имя профиля конфигурации - + PROFILE ПРОФИЛЬ - + Run PCManFM as a daemon Запустить PCManFM как демон - + Quit PCManFM Выйти из PCManFM - + Launch desktop manager Запустить менеджер рабочего стола - + Turn off desktop manager if it's running Отключить менеджер рабочего стола, если он запущен - + Open desktop preference dialog on the page with the specified name Открыть диалог настроек рабочего стола на странице с указанным именем - - + + NAME ИМЯ - + Set desktop wallpaper from image FILE Выбрать обои рабочего стола из ФАЙЛА изображения - + FILE ФАЙЛ - + Set mode of desktop wallpaper. MODE=(color|stretch|fit|center|tile) Выбрать режим обоев рабочего стола. РЕЖИМ=(цвет|растянуть|вместить|по центру|черепицей) - + MODE РЕЖИМ - + Open Preferences dialog on the page with the specified name Открыть диалог настроек на странице с указанным именем - + Open new window Открыть новое окно - + Open Find Files utility Открыть утилиту поиска файлов - + [FILE1, FILE2,...] [ФАЙЛ1, ФАЙЛ2,...] - + Files or directories to open Файлы или папки для открытия - - + + Error Ошибка - + Terminal emulator is not set. Эмулятор терминала не указан. @@ -954,33 +999,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PCManFM::MainWindow - + Clear text (Ctrl+K) - + Стереть текст (Ctrl+K) - + Version: %1 Версия: %1 - + &Move to Trash &Переместить в корзину - + &Delete &Удалить - - + + Error Ошибка - + Switch user command is not set. Команда переключения пользователя не задана. @@ -1011,17 +1056,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PCManFM::TabPage - + Error Ошибка - + Free space: %1 (Total: %2) Свободное место: %1 (всего: %2) - + %n item(s) %n объект @@ -1030,7 +1075,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, - + (%n hidden) (%n скрыт) @@ -1039,7 +1084,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, - + %1 item(s) selected %1 объекта(ов) выделено @@ -1065,340 +1110,340 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Бостон, MA 02110-1301, PreferencesDialog - + Preferences Настройки - + User Interface Интерфейс пользователя - + Behavior Поведение - - + + Thumbnail Эскизы - + Volume Том - + Advanced Расширенные - + Icons Значки - + Size of big icons: Размер больших значков: - + Size of small icons: Размер маленьких значков: - + Size of thumbnails: Размер значков: - + Size of side pane icons: Размер значков боковой панели: - + Icon theme: Тема значков: - + Window Окно - + Always show the tab bar Всегда показывать панель вкладок - + Show 'Close' buttons on tabs Показывать кнопку «Закрыть» на вкладках - + Remember the size of the last closed window Запоминать размер последнего закрытого окна - + Default width of new windows: Ширина новых окон по умолчанию: - + Default height of new windows: Высота новых окон по умолчанию: - + Browsing Просмотр - + Open files with single click Открывать файлы по одиночному щелчку мыши - + Delay of auto-selection in single click mode (0 to disable) Задержка автовыделения в режиме одиночного щелчка (0 для отключения) - + Default view mode: Режим просмотра по умолчанию: - + sec сек - + File Operations Операции с файлами - + Confirm before deleting files Подтверждение перед удалением файлов - + Move deleted files to "trash bin" instead of erasing from disk. Перемещать удалённые файлы в корзину вместо удаления их с диска. - + Show thumbnails of files Показывать эскизы файлов - + Only show thumbnails for local files Показывать эскизы только для локальных файлов - + Display Вид - + Bookmarks: Закладки: - + Open in current tab Открывать в текущей вкладке - + Open in new tab Открывать в новой вкладке - + Open in new window Открывать в новом окне - + Erase files on removable media instead of "trash can" creation Удалять файлы на съёмных носителях вместо создания «Корзины» - + Confirm before moving files into "trash can" Просить подтверждения перед удалением файлов в «Корзину» - + Don't ask options on launch executable file Не предлагать варианты запуска исполняемых файлов - + User interface Интерфейс пользователя - + Treat backup files as hidden Рассматривать резервные файлы как скрытые - + Always show full file names Всегда показывать полные имена файлов - + Show icons of hidden files shadowed Показывать значки скрытых файлов затенёнными - + Show in places Показвать в «Местах» - + Home Домой - + Desktop Рабочий стол - + Trash can Корзина - + Computer Компьютер - + Applications Приложения - + Devices Устройства - + Network Сеть - + Do not generate thumbnails for image files exceeding this size: Не создавать эскизы для файлов изображений больших чем: - + KB КБ - + Auto Mount Автоподключение - + Mount mountable volumes automatically on program startup Подключать съёмные тома автоматически при запуске программы - + Mount removable media automatically when they are inserted Подключать съёмные тома автоматически при их подключении - + Show available options for removable media when they are inserted Показывать доступные варианты для съёмных устройств при их вставлении - + When removable medium unmounted: При отключении съёмного устройства: - + Close &tab containing removable medium Закрыть &вкладку, отображающую содержимое съёмного носителя - + Chan&ge folder in the tab to home folder Изме&нить папку во вкладке на домашнюю - + Switch &user command: Команда смены &пользователя: - + Archiver in&tegration: Ин&теграция с архиваторами: - + Templates Шаблоны - + Show only user defined templates in menu Показывать только шаблоны, определённые пользователем, в меню - + Show only one template for each MIME type Показывать только один шаблон для каждого типа MIME - + Run default application after creation from template Запускать приложение по умолчанию после создания шаблона - + Programs Программы - + Terminal emulator: Эмулятор терминала: - + Examples: "xterm -e %s" for terminal or "gksu %s" for switching user. %s = the command line you want to execute with terminal or su. Примеры: "xterm -e %s" для терминала или "gksu %s" для переключения пользователя. %s = командная строка,которую вы хотите выполнить с терминалом или su. - + Use SI decimal prefixes instead of IEC binary prefixes Использовать десятичные префиксы СИ вместо двоичных префиксов IEC diff --git a/pcmanfm/view.cpp b/pcmanfm/view.cpp index 741d7a0..5113338 100644 --- a/pcmanfm/view.cpp +++ b/pcmanfm/view.cpp @@ -19,9 +19,8 @@ #include "view.h" -#include "filemenu.h" -#include "foldermenu.h" -#include "filelauncher.h" +#include +#include #include "application.h" #include "settings.h" #include "application.h" @@ -29,7 +28,7 @@ #include "launcher.h" #include -using namespace PCManFM; +namespace PCManFM { View::View(Fm::FolderView::ViewMode _mode, QWidget* parent): Fm::FolderView(_mode, parent) { @@ -88,37 +87,43 @@ void View::prepareFileMenu(Fm::FileMenu* menu) { // add some more menu items for dirs bool all_native = true; + bool all_directory = true; FmFileInfoList* files = menu->files(); for(GList* l = fm_file_info_list_peek_head_link(files); l; l = l->next) { FmFileInfo* fi = FM_FILE_INFO(l->data); if(!fm_file_info_is_dir(fi)) - return; /* actions are valid only if all selected are directories */ - else if(!fm_file_info_is_native(fi)) + all_directory = false; + else if(fm_file_info_is_dir(fi) && !fm_file_info_is_native(fi)) all_native = false; } - // hide "Open with" for selected dirs - menu->openWithMenuAction()->setVisible(false); + if (all_directory) + { + QAction* action = new QAction(QIcon::fromTheme("window-new"), tr("Open in New T&ab"), menu); + connect(action, &QAction::triggered, this, &View::onNewTab); + menu->insertAction(menu->separator1(), action); - QAction* action = new QAction(QIcon::fromTheme("window-new"), tr("Open in New T&ab"), menu); - connect(action, &QAction::triggered, this, &View::onNewTab); - menu->insertAction(menu->separator1(), action); + action = new QAction(QIcon::fromTheme("window-new"), tr("Open in New Win&dow"), menu); + connect(action, &QAction::triggered, this, &View::onNewWindow); + menu->insertAction(menu->separator1(), action); - action = new QAction(QIcon::fromTheme("window-new"), tr("Open in New Win&dow"), menu); - connect(action, &QAction::triggered, this, &View::onNewWindow); - menu->insertAction(menu->separator1(), action); + // TODO: add search + // action = menu->addAction(_("Search")); - // TODO: add search - // action = menu->addAction(_("Search")); - if(all_native) { - action = new QAction(QIcon::fromTheme("utilities-terminal"), tr("Open in Termina&l"), menu); - connect(action, &QAction::triggered, this, &View::onOpenInTerminal); - menu->insertAction(menu->separator1(), action); + if(all_native) + { + action = new QAction(QIcon::fromTheme("utilities-terminal"), tr("Open in Termina&l"), menu); + connect(action, &QAction::triggered, this, &View::onOpenInTerminal); + menu->insertAction(menu->separator1(), action); + } + } + else { + menu->pasteAction()->setVisible(false); + menu->createAction()->setVisible(false); } } void View::prepareFolderMenu(Fm::FolderMenu* menu) { - } void View::updateFromSettings(Settings& settings) { @@ -136,3 +141,4 @@ void View::updateFromSettings(Settings& settings) { } } +} // namespace PCManFM diff --git a/pcmanfm/view.h b/pcmanfm/view.h index 79286dc..e7e920a 100644 --- a/pcmanfm/view.h +++ b/pcmanfm/view.h @@ -21,7 +21,7 @@ #ifndef PCMANFM_FOLDERVIEW_H #define PCMANFM_FOLDERVIEW_H -#include "folderview.h" +#include namespace Fm { class FileMenu;