From 3194275f967805e260dd1b56fa3132608821cf9e Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Thu, 22 Dec 2016 02:02:45 +0100 Subject: [PATCH] Cherry-picking upstream release 0.11.2. * Removed build dependencies: - libfm-dev - liblxqt0-dev * Bumped minimum versions - libfm-qt-dev (>= 0.11.2) - lxqt-build-tools (>= 0.3.0) - libfm-qt3 (>= 0.11.2) * Suggests: cdtool -> cdtool [linux-any] --- .gitignore | 3 - CHANGELOG | 35 +++- CMakeLists.txt | 25 +-- debian/changelog | 14 ++ debian/control | 10 +- pcmanfm/CMakeLists.txt | 18 +- pcmanfm/about.ui | 4 +- pcmanfm/application.cpp | 51 +++-- pcmanfm/application.h | 3 + pcmanfm/connect.ui | 173 ++++++++++++++++ pcmanfm/connectserverdialog.cpp | 89 +++++++++ pcmanfm/connectserverdialog.h | 38 ++++ pcmanfm/desktoppreferencesdialog.cpp | 6 +- pcmanfm/desktopwindow.cpp | 37 +++- pcmanfm/desktopwindow.h | 5 +- pcmanfm/main-win.ui | 51 ++++- pcmanfm/mainwindow.cpp | 186 +++++++++++++----- pcmanfm/mainwindow.h | 37 +++- pcmanfm/preferencesdialog.cpp | 9 +- pcmanfm/settings.cpp | 8 + pcmanfm/settings.h | 9 + .../pcmanfm-qt-desktop-pref_ca.desktop | 3 + .../pcmanfm-qt-desktop-pref_da.desktop | 3 + .../pcmanfm-qt-desktop-pref_fr.desktop | 4 + pcmanfm/translations/pcmanfm-qt_ca.desktop | 4 + pcmanfm/translations/pcmanfm-qt_da.desktop | 3 + pcmanfm/translations/pcmanfm-qt_fr.desktop | 4 + pcmanfm/translations/pcmanfm-qt_pt_BR.desktop | 4 + 28 files changed, 712 insertions(+), 124 deletions(-) delete mode 100644 .gitignore create mode 100644 pcmanfm/connect.ui create mode 100644 pcmanfm/connectserverdialog.cpp create mode 100644 pcmanfm/connectserverdialog.h create mode 100644 pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt_ca.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt_da.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt_fr.desktop create mode 100644 pcmanfm/translations/pcmanfm-qt_pt_BR.desktop diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d0df463..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build -*.kdev4 -pcmanfm/translations/pcmanfm-qt diff --git a/CHANGELOG b/CHANGELOG index 60f7ddc..ada4807 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,40 @@ -pcmanfm-qt-0.11.1 / 2016-09-24 +pcmanfm-qt-0.11.2 / 2016-12-21 ============================== + * Use static_cast instead of the C style cast + * Fix sign-compare warnings + * Prevent wrong clearing of filter-bar with path buttons (#432) + * bump patch version (#429) + * Add *da.desktop files + * Re-layout on Changing Display Name. (#355) + * Add Pathbar Separator + * New tab on middle clicking a path button + * Make dialogue "About" point out it's the Qt version of PCManFM. (#421) + * CMake: Drop finding XCB + * Avoid code duplication. + * Added a wallpaper zooming option + * Implement a "Connect to server" dialog for easily mounting remote filesystems. Add new API PCManFM::MainWindow::lastActive() to get last active window. + * Use the new button-style path bar by default. Properly handle the editing of button-style path bar. + * Add missing ui file. + * Move the pcmanfm-qt_pt_BR.ts file to lxqt-l10n repo. + * Remove context menu from toolbar and menubar + * Support button-style path bar and adjust the layout of the view menu slightly. + * Create pcmanfm-qt_fr.desktop + * Create pcmanfm-qt-desktop-pref_fr.desktop + * Adds Build PROJECT_NAME with Qt version message + * Moved LIBFM_DATA_DIR compile definition from libfm-qt + * Use target_compile_definitions(). + * Use the new lxqt-build-tools package + * Added very basic .gitattributes + * remove "building with cpack" from CMakeLists.txt - not used anymore + * Add Catalan translations + * Added Brazilian Portuguese Translation (pt_BR) + +0.11.1 / 2016-09-24 +=================== + + * Release 0.11.1: Add changelog * Bump version to 0.11.1 (#399) * Extend README.md * Ensure the existence of libfm dir. diff --git a/CMakeLists.txt b/CMakeLists.txt index 9acaf46..f0c33ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,11 @@ endif (POLICY CMP0063) set(PCMANFM_QT_VERSION_MAJOR 0) set(PCMANFM_QT_VERSION_MINOR 11) -set(PCMANFM_QT_VERSION_PATCH 1) +set(PCMANFM_QT_VERSION_PATCH 2) set(PCMANFM_QT_VERSION ${PCMANFM_QT_VERSION_MAJOR}.${PCMANFM_QT_VERSION_MINOR}.${PCMANFM_QT_VERSION_PATCH}) +set(LXQTBT_MINIMUM_VERSION "0.1.0") + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") find_package(Qt5Widgets 5.2 REQUIRED) @@ -18,11 +20,9 @@ find_package(Qt5DBus 5.2 REQUIRED) find_package(Qt5LinguistTools 5.2 REQUIRED) find_package(Qt5X11Extras 5.2 REQUIRED) find_package(fm-qt REQUIRED) -#Note: no run-time dependency on liblxqt, just a build dependency for lxqt_translate_ts/desktop -find_package(lxqt REQUIRED) +find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) -find_package(PkgConfig REQUIRED) -pkg_check_modules(LIB_XCB REQUIRED xcb) +message(STATUS "Building ${PROJECT_NAME} with Qt ${Qt5Core_VERSION_STRING}") option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF) include(GNUInstallDirs) @@ -61,18 +61,3 @@ if(BUILD_DOCUMENTATION) ) install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs" DESTINATION "${CMAKE_INSTALL_DOCDIR}") endif() - -# building tarball with CPack ------------------------------------------------- -# To create a source distribution, type: -# make package_source -include(InstallRequiredSystemLibraries) -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}) -set(CPACK_PACKAGE_VERSION_MINOR ${PCMANFM_QT_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${PCMANFM_QT_VERSION_PATCH}) -set(CPACK_GENERATOR TBZ2) -set(CPACK_SOURCE_GENERATOR TBZ2) -set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp) -include(CPack) diff --git a/debian/changelog b/debian/changelog index 8dbe7aa..2ba6fb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +pcmanfm-qt (0.11.2-1) unstable; urgency=medium + + * Cherry-picking upstream release 0.11.2. + * Removed build dependencies: + - libfm-dev + - liblxqt0-dev + * Bumped minimum versions + - libfm-qt-dev (>= 0.11.2) + - lxqt-build-tools (>= 0.3.0) + - libfm-qt3 (>= 0.11.2) + * Suggests: cdtool -> cdtool [linux-any] + + -- Alf Gaida Thu, 22 Dec 2016 02:02:37 +0100 + pcmanfm-qt (0.11.1-3) unstable; urgency=medium * Added versioned dependency libfm-qt3 (>= 0.11.1), dh detect only diff --git a/debian/control b/debian/control index b56b593..b199782 100644 --- a/debian/control +++ b/debian/control @@ -8,16 +8,14 @@ Uploaders: Alf Gaida , Section: x11 Priority: optional Build-Depends: debhelper (>= 10), - libfm-dev (>= 1.2.0), - libfm-qt-dev (>= 0.11.1), + libfm-qt-dev (>= 0.11.2), libglib2.0-dev, libkf5windowsystem-dev, - liblxqt0-dev (>= 0.11.0), libmenu-cache-dev, libqt5svg5-dev, libqt5x11extras5-dev, libx11-dev, - lxqt-build-tools (>= 0.2.0) + lxqt-build-tools (>= 0.3.0) Standards-Version: 3.9.8 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/pcmanfm-qt.git/?h=debian/sid Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/pcmanfm-qt.git -b debian/sid @@ -29,13 +27,13 @@ Depends: ${misc:Depends}, ${shlibs:Depends}, default-dbus-session-bus | dbus-session-bus | dbus-x11, libfm-modules, - libfm-qt3 (>= 0.11.1) + libfm-qt3 (>= 0.11.2) Recommends: eject, gvfs-backends, lxqt-sudo | gksu, breeze-icon-theme | oxygen-icon-theme | faenza-icon-theme | gnome-icon-theme, pcmanfm-qt-l10n -Suggests: cdtool +Suggests: cdtool [linux-any] Description: extremely fast and lightweight file and desktop icon manager PCManFM-Qt is the Qt port of the LXDE file manager PCManFM. . diff --git a/pcmanfm/CMakeLists.txt b/pcmanfm/CMakeLists.txt index 247167b..e7ddb57 100644 --- a/pcmanfm/CMakeLists.txt +++ b/pcmanfm/CMakeLists.txt @@ -12,6 +12,7 @@ set(pcmanfm_SRCS desktopwindow.cpp desktopitemdelegate.cpp autorundialog.cpp + connectserverdialog.cpp settings.cpp ) @@ -30,6 +31,7 @@ set(pcmanfm_UIS desktop-preferences.ui desktop-folder.ui autorun.ui + connect.ui ) qt5_wrap_ui(pcmanfm_UIS_H ${pcmanfm_UIS}) @@ -58,16 +60,17 @@ add_executable(pcmanfm-qt ${QM_FILES} ${DESKTOP_FILES} ) -set_property( - TARGET pcmanfm-qt APPEND - PROPERTY COMPILE_DEFINITIONS - PCMANFM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/pcmanfm-qt" - PCMANFM_QT_VERSION="${PCMANFM_QT_VERSION}" + +target_compile_definitions(pcmanfm-qt + PRIVATE + PCMANFM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/pcmanfm-qt" + PCMANFM_QT_VERSION="${PCMANFM_QT_VERSION}" + LIBFM_DATA_DIR="${PKG_FM_PREFIX}/share/libfm" ) target_include_directories(pcmanfm-qt - PRIVATE "${LIB_XCB_INDLUDE_DIRS}" - "${Qt5Gui_PRIVATE_INCLUDE_DIRS}" + PRIVATE + "${Qt5Gui_PRIVATE_INCLUDE_DIRS}" ) target_link_libraries(pcmanfm-qt @@ -75,7 +78,6 @@ target_link_libraries(pcmanfm-qt Qt5::Widgets Qt5::DBus fm-qt - "${LIB_XCB_LIBRARIES}" ) install(TARGETS pcmanfm-qt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pcmanfm/about.ui b/pcmanfm/about.ui index c844417..bfce550 100644 --- a/pcmanfm/about.ui +++ b/pcmanfm/about.ui @@ -22,7 +22,7 @@ - <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-Qt</span></p></body></html> Qt::RichText @@ -106,7 +106,7 @@ true - PCMan File Manager + PCManFM-Qt File Manager Copyright (C) 2009 - 2014 洪任諭 (Hong Jen Yee) diff --git a/pcmanfm/application.cpp b/pcmanfm/application.cpp index b81a8dc..f75e4d9 100644 --- a/pcmanfm/application.cpp +++ b/pcmanfm/application.cpp @@ -33,26 +33,28 @@ #include #include #include +#include +#include +#include + #include #include -#include "applicationadaptor.h" -#include "preferencesdialog.h" -#include "desktoppreferencesdialog.h" #include -#include "autorundialog.h" -#include "launcher.h" #include #include #include -#include -#include +#include "applicationadaptor.h" +#include "preferencesdialog.h" +#include "desktoppreferencesdialog.h" +#include "autorundialog.h" +#include "launcher.h" +#include "xdgdir.h" +#include "connectserverdialog.h" #include -#include "xdgdir.h" -#include namespace PCManFM { @@ -191,7 +193,7 @@ bool Application::parseCommandLineArgs() { QCommandLineOption setWallpaperOption(QStringList() << "w" << "set-wallpaper", tr("Set desktop wallpaper from image FILE"), tr("FILE")); parser.addOption(setWallpaperOption); - QCommandLineOption wallpaperModeOption("wallpaper-mode", tr("Set mode of desktop wallpaper. MODE=(%1)").arg("color|stretch|fit|center|tile"), tr("MODE")); + QCommandLineOption wallpaperModeOption("wallpaper-mode", tr("Set mode of desktop wallpaper. MODE=(%1)").arg("color|stretch|fit|center|tile|zoom"), tr("MODE")); parser.addOption(wallpaperModeOption); QCommandLineOption showPrefOption("show-pref", tr("Open Preferences dialog on the page with the specified name"), tr("NAME")); @@ -440,10 +442,21 @@ void Application::desktopPrefrences(QString page) { void Application::onFindFileAccepted() { Fm::FileSearchDialog* dlg = static_cast(sender()); Fm::Path uri = dlg->searchUri(); - // FIXME: we should be able to open it in an existing window Fm::PathList paths; paths.pushTail(uri); - Launcher(NULL).launchPaths(NULL, paths); + MainWindow* window = MainWindow::lastActive(); + Launcher(window).launchPaths(NULL, paths); +} + +void Application::onConnectToServerAccepted() { + ConnectServerDialog* dlg = static_cast(sender()); + QString uri = dlg->uriText(); + Fm::Path path = Fm::Path::newForStr(uri.toUtf8().constData()); + qDebug() << uri << " => " << path.toStr(); + Fm::PathList paths; + paths.pushTail(path); + MainWindow* window = MainWindow::lastActive(); + Launcher(window).launchPaths(NULL, paths); } void Application::findFiles(QStringList paths) { @@ -454,6 +467,13 @@ void Application::findFiles(QStringList paths) { dlg->show(); } +void Application::connectToServer() { + ConnectServerDialog* dlg = new ConnectServerDialog(); + connect(dlg, &QDialog::accepted, this, &Application::onConnectToServerAccepted); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->show(); +} + void Application::launchFiles(QString cwd, QStringList paths, bool inNewWindow) { Fm::PathList pathList; Fm::Path cwd_path; @@ -532,9 +552,12 @@ void Application::setWallpaper(QString path, QString modeString) { } } // convert mode string to value - for(int i = 0; i < G_N_ELEMENTS(valid_wallpaper_modes); ++i) { + for(std::size_t i = 0; i < G_N_ELEMENTS(valid_wallpaper_modes); ++i) { if(modeString == valid_wallpaper_modes[i]) { - mode = (DesktopWindow::WallpaperMode)i; + // We don't take safety checks because valid_wallpaper_modes[] is + // defined in this function and we can clearly see that it does not + // overflow. + mode = static_cast(i); if(mode != settings_.wallpaperMode()) changed = true; break; diff --git a/pcmanfm/application.h b/pcmanfm/application.h index 4351963..2d371da 100644 --- a/pcmanfm/application.h +++ b/pcmanfm/application.h @@ -37,6 +37,7 @@ class QFileSystemWatcher; namespace PCManFM { +class MainWindow; class DesktopWindow; class PreferencesDialog; class DesktopPreferencesDialog; @@ -76,6 +77,7 @@ public: void editBookmarks(); void desktopManager(bool enabled); void findFiles(QStringList paths = QStringList()); + void connectToServer(); bool desktopManagerEnabled() { return enableDesktopManager_; @@ -107,6 +109,7 @@ protected Q_SLOTS: void reloadDesktopsAsNeeded(); void onFindFileAccepted(); + void onConnectToServerAccepted(); protected: virtual bool eventFilter(QObject* watched, QEvent* event); diff --git a/pcmanfm/connect.ui b/pcmanfm/connect.ui new file mode 100644 index 0000000..5238e00 --- /dev/null +++ b/pcmanfm/connect.ui @@ -0,0 +1,173 @@ + + + ConnectServerDialog + + + + 0 + 0 + 450 + 256 + + + + Connect to remote server + + + + + + + + + Anonymous &login + + + true + + + + + + + + + + Login as &user: + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + 0 + 0 + + + + Specify remote folder to connect + + + + + + + Type: + + + + + + + Port: + + + + + + + Path: + + + + + + + + + + Host: + + + + + + + 65535 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + buttonBox + accepted() + ConnectServerDialog + accept() + + + 254 + 249 + + + 157 + 274 + + + + + buttonBox + rejected() + ConnectServerDialog + reject() + + + 322 + 249 + + + 286 + 274 + + + + + loginAsUser + toggled(bool) + userName + setEnabled(bool) + + + 65 + 194 + + + 163 + 184 + + + + + diff --git a/pcmanfm/connectserverdialog.cpp b/pcmanfm/connectserverdialog.cpp new file mode 100644 index 0000000..dd368f4 --- /dev/null +++ b/pcmanfm/connectserverdialog.cpp @@ -0,0 +1,89 @@ +#include "connectserverdialog.h" +#include +#include + +namespace PCManFM { + +ConnectServerDialog::ConnectServerDialog(QWidget *parent): QDialog(parent) { + serverTypes = QList{ + {tr("SSH"), "sftp", 22, false}, + {tr("FTP"), "ftp", 21, true}, + {tr("WebDav"), "dav", 80, true}, + {tr("Secure WebDav"), "davs", 443, false}, + {tr("HTTP"), "http", 80, true}, + {tr("HTTPS"), "https", 443, true}, + }; + + ui.setupUi(this); + + connect(ui.serverType, static_cast(&QComboBox::currentIndexChanged), + this, &ConnectServerDialog::onCurrentIndexChanged); + + connect(ui.host, &QLineEdit::textChanged, this, &ConnectServerDialog::checkInput); + connect(ui.userName, &QLineEdit::textChanged, this, &ConnectServerDialog::checkInput); + + for(const auto& serverType: serverTypes) { + ui.serverType->addItem(serverType.name); + } + + ui.serverType->setCurrentIndex(0); + onCurrentIndexChanged(0); +} + +ConnectServerDialog::~ConnectServerDialog() { +} + + +QString ConnectServerDialog::uriText() { + QString uri; + int serverTypeIdx = ui.serverType->currentIndex(); + const auto& serverType = serverTypes[serverTypeIdx]; + + // make an URI from the data + uri = QString::fromLatin1(serverType.scheme); + uri += QStringLiteral("://"); + if(ui.loginAsUser->isChecked()) { + uri += ui.userName->text(); + uri += '@'; + } + + uri += ui.host->text(); + int port = ui.port->value(); + if(port != serverType.defaultPort) { + uri += ':'; + uri += QString::number(port); + } + + QString path = ui.path->text(); + if(path.isEmpty() || path[0] != '/') { + uri += '/'; + } + uri += path; + return uri; +} + +void ConnectServerDialog::onCurrentIndexChanged(int index) { + int serverTypeIdx = ui.serverType->currentIndex(); + const auto& serverType = serverTypes[serverTypeIdx]; + ui.port->setValue(serverType.defaultPort); + ui.ananymousLogin->setEnabled(serverType.canAnonymous); + if(serverType.canAnonymous) + ui.ananymousLogin->setChecked(true); + else + ui.loginAsUser->setChecked(true); + ui.host->setFocus(); + checkInput(); +} + +void ConnectServerDialog::checkInput() { + bool valid = true; + if(ui.host->text().isEmpty()) { + valid = false; + } + else if(ui.loginAsUser->isChecked() && ui.userName->text().isEmpty()) { + valid = false; + } + ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid); +} + +} // namespace PCManFM diff --git a/pcmanfm/connectserverdialog.h b/pcmanfm/connectserverdialog.h new file mode 100644 index 0000000..7c19a27 --- /dev/null +++ b/pcmanfm/connectserverdialog.h @@ -0,0 +1,38 @@ +#ifndef CONNECTSERVERDIALOG_H +#define CONNECTSERVERDIALOG_H + +#include +#include +#include "ui_connect.h" + +namespace PCManFM { + +class ConnectServerDialog : public QDialog { + Q_OBJECT + +public: + ConnectServerDialog(QWidget* parent=nullptr); + virtual ~ConnectServerDialog(); + + QString uriText(); + +private: + struct ServerType { + QString name; + const char* scheme; + int defaultPort; + bool canAnonymous; + }; + +private Q_SLOTS: + void onCurrentIndexChanged(int index); + void checkInput(); + +private: + Ui::ConnectServerDialog ui; + QList serverTypes; +}; + +} // namespace PCManFM + +#endif // CONNECTSERVERDIALOG_H diff --git a/pcmanfm/desktoppreferencesdialog.cpp b/pcmanfm/desktoppreferencesdialog.cpp index 632ffe1..8664508 100644 --- a/pcmanfm/desktoppreferencesdialog.cpp +++ b/pcmanfm/desktoppreferencesdialog.cpp @@ -54,6 +54,7 @@ DesktopPreferencesDialog::DesktopPreferencesDialog(QWidget* parent, Qt::WindowFl ui.wallpaperMode->addItem(tr("Stretch to fit the screen"), DesktopWindow::WallpaperFit); ui.wallpaperMode->addItem(tr("Center on the screen"), DesktopWindow::WallpaperCenter); ui.wallpaperMode->addItem(tr("Tile the image to fill the entire screen"), DesktopWindow::WallpaperTile); + ui.wallpaperMode->addItem(tr("Zoom the image to fill the entire screen"), DesktopWindow::WallpaperZoom); int i; switch(settings.wallpaperMode()) { case DesktopWindow::WallpaperNone: @@ -71,6 +72,9 @@ DesktopPreferencesDialog::DesktopPreferencesDialog(QWidget* parent, Qt::WindowFl case DesktopWindow::WallpaperTile: i = 4; break; + case DesktopWindow::WallpaperZoom: + i = 5; + break; default: i = 0; } @@ -80,7 +84,7 @@ DesktopPreferencesDialog::DesktopPreferencesDialog(QWidget* parent, Qt::WindowFl qDebug("wallpaper: %s", settings.wallpaper().toUtf8().data()); ui.imageFile->setText(settings.wallpaper()); - for(int i = 0; i < G_N_ELEMENTS(iconSizes); ++i) { + for(std::size_t i = 0; i < G_N_ELEMENTS(iconSizes); ++i) { int size = iconSizes[i]; ui.iconSize->addItem(QString("%1 x %1").arg(size), size); if(settings.desktopIconSize() == size) diff --git a/pcmanfm/desktopwindow.cpp b/pcmanfm/desktopwindow.cpp index 6426e03..2bbf880 100644 --- a/pcmanfm/desktopwindow.cpp +++ b/pcmanfm/desktopwindow.cpp @@ -104,6 +104,7 @@ DesktopWindow::DesktopWindow(int screenNum): connect(proxyModel_, &Fm::ProxyFolderModel::rowsAboutToBeRemoved, this, &DesktopWindow::onRowsAboutToBeRemoved); connect(proxyModel_, &Fm::ProxyFolderModel::layoutChanged, this, &DesktopWindow::onLayoutChanged); connect(proxyModel_, &Fm::ProxyFolderModel::sortFilterChanged, this, &DesktopWindow::onModelSortFilterChanged); + connect(proxyModel_, &Fm::ProxyFolderModel::dataChanged, this, &DesktopWindow::onDataChanged); connect(listView_, &QListView::indexesMoved, this, &DesktopWindow::onIndexesMoved); } @@ -306,12 +307,13 @@ void DesktopWindow::updateWallpaper() { if(wallpaperMode_ == WallpaperCenter) { image = QImage(wallpaperFile_); // load original image } - else if(wallpaperMode_ == WallpaperFit) { + else if(wallpaperMode_ == WallpaperFit || wallpaperMode_ == WallpaperZoom) { // calculate the desired size QSize origSize = QImageReader(wallpaperFile_).size(); // get the size of the original file if(origSize.isValid()) { QSize desiredSize = origSize; - desiredSize.scale(width(), height(), Qt::KeepAspectRatio); + Qt::AspectRatioMode mode = (wallpaperMode_ == WallpaperFit ? Qt::KeepAspectRatio : Qt::KeepAspectRatioByExpanding); + desiredSize.scale(width(), height(), mode); image = loadWallpaperFile(desiredSize); // load the scaled image } } @@ -432,6 +434,33 @@ void DesktopWindow::onModelSortFilterChanged() { settings.setSesktopSortFolderFirst(proxyModel_->folderFirst()); } +void DesktopWindow::onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { + /**************************************************************************** + NOTE: The display names of desktop entries and shortcuts may change without + their files being renamed and, on such occasions, a relayout will be needed. + Since there is no signal for that, we use the signal dataChanged() and the + QHash displayNames_, which remembers such display names with every relayout. + ****************************************************************************/ + if(topLeft.column() == 0) { + bool relayout(false); + for(int i = topLeft.row(); i <= bottomRight.row(); ++i) { + QModelIndex index = topLeft.sibling(i, 0); + if(index.isValid() && displayNames_.contains(index)) { + Fm::FileInfo file = proxyModel_->fileInfoFromIndex(index); + if(displayNames_[index] != file.getDispName()) { + relayout = true; + break; + } + } + } + if(relayout) { + queueRelayout(); + // parts of the old display name might still be visible if it's long + listView_->viewport()->update(); + } + } +} + void DesktopWindow::onIndexesMoved(const QModelIndexList& indexes) { // remember the custom position for the items Q_FOREACH(const QModelIndex& index, indexes) { @@ -505,6 +534,7 @@ void DesktopWindow::removeBottomGap() { // 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() { + displayNames_.clear(); loadItemPositions(); // something may have changed // qDebug("relayoutItems()"); if(relayoutTimer_) { @@ -534,6 +564,9 @@ void DesktopWindow::relayoutItems() { QModelIndex index = proxyModel_->index(row, 0); int itemWidth = delegate_->sizeHint(listView_->getViewOptions(), index).width(); Fm::FileInfo file = proxyModel_->fileInfoFromIndex(index); + // remember display names of desktop entries and shortcuts + if(file.isDesktopEntry() || file.isShortcut()) + displayNames_[index] = QString(file.getDispName()); QByteArray name = file.getName(); QHash::iterator it = customItemPos_.find(name); if(it != customItemPos_.end()) { // the item has a custom position diff --git a/pcmanfm/desktopwindow.h b/pcmanfm/desktopwindow.h index fe6d8f3..1576245 100644 --- a/pcmanfm/desktopwindow.h +++ b/pcmanfm/desktopwindow.h @@ -50,7 +50,8 @@ public: WallpaperStretch, WallpaperFit, WallpaperCenter, - WallpaperTile + WallpaperTile, + WallpaperZoom }; explicit DesktopWindow(int screenNum); @@ -101,6 +102,7 @@ protected Q_SLOTS: void onLayoutChanged(); void onModelSortFilterChanged(); void onIndexesMoved(const QModelIndexList& indexes); + void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); void relayoutItems(); void onStickToCurrentPos(bool toggled); @@ -136,6 +138,7 @@ private: int screenNum_; QHash customItemPos_; + QHash displayNames_; // only for desktop entries and shortcuts QTimer* relayoutTimer_; }; diff --git a/pcmanfm/main-win.ui b/pcmanfm/main-win.ui index e632f77..145c6d8 100644 --- a/pcmanfm/main-win.ui +++ b/pcmanfm/main-win.ui @@ -112,6 +112,9 @@ 30 + + Qt::PreventContextMenu + &File @@ -170,6 +173,20 @@ + + + &Toolbars + + + + + + + Path &Bar + + + + @@ -177,8 +194,8 @@ - - + + @@ -216,6 +233,8 @@ + + @@ -235,6 +254,9 @@ + + Qt::PreventContextMenu + Main Toolbar @@ -255,8 +277,8 @@ - + @@ -756,7 +778,7 @@ true - Menu bar + &Menu bar Menu bar @@ -785,6 +807,27 @@ &Preserve Settings for This Folder + + + Connect to &Server + + + + + true + + + &Location + + + + + true + + + &Path Buttons + + diff --git a/pcmanfm/mainwindow.cpp b/pcmanfm/mainwindow.cpp index 79b0c0d..f4c144a 100644 --- a/pcmanfm/mainwindow.cpp +++ b/pcmanfm/mainwindow.cpp @@ -41,22 +41,26 @@ #include #include #include +#include #include #include #include #include "ui_about.h" #include "application.h" -// #include "qmodeltest/modeltest.h" - using namespace Fm; namespace PCManFM { +// static +MainWindow* MainWindow::lastActive_ = nullptr; + MainWindow::MainWindow(Path path): QMainWindow(), + pathEntry_(nullptr), + pathBar_(nullptr), fileLauncher_(this), - rightClickIndex(-1), + rightClickIndex_(-1), updatingViewMenu_(false) { Settings& settings = static_cast(qApp)->settings(); @@ -131,14 +135,15 @@ MainWindow::MainWindow(Path path): connect(ui.splitter, &QSplitter::splitterMoved, this, &MainWindow::onSplitterMoved); // path bar - pathEntry = new Fm::PathEdit(this); - connect(pathEntry, &Fm::PathEdit::returnPressed, this, &MainWindow::onPathEntryReturnPressed); - connect(pathEntry, &QLineEdit::textEdited, this, &MainWindow::onPathEntryEdited); - ui.toolBar->insertWidget(ui.actionGo, pathEntry); + createPathBar(settings.pathBarButtons()); + if(settings.pathBarButtons()) + ui.actionPathButtons->setChecked(true); + else + ui.actionLocationBar->setChecked(true); // add filesystem info to status bar - fsInfoLabel = new QLabel(ui.statusbar); - ui.statusbar->addPermanentWidget(fsInfoLabel); + fsInfoLabel_ = new QLabel(ui.statusbar); + ui.statusbar->addPermanentWidget(fsInfoLabel_); // setup the splitter ui.splitter->setStretchFactor(1, 1); // only the right pane can be stretched @@ -148,8 +153,8 @@ MainWindow::MainWindow(Path path): ui.splitter->setSizes(sizes); // load bookmark menu - bookmarks = Fm::Bookmarks::dup(); - g_signal_connect(bookmarks, "changed", G_CALLBACK(onBookmarksChanged), this); + bookmarks_ = Fm::Bookmarks::dup(); + g_signal_connect(bookmarks_, "changed", G_CALLBACK(onBookmarksChanged), this); loadBookmarksMenu(); // Fix the menu groups which is not done by Qt designer @@ -174,6 +179,11 @@ MainWindow::MainWindow(Path path): group->addAction(ui.actionAscending); group->addAction(ui.actionDescending); + group = new QActionGroup(ui.menuPathBarStyle); + group->setExclusive(true); + group->addAction(ui.actionLocationBar); + group->addAction(ui.actionPathButtons); + // Add menubar actions to the main window this is necessary so that actions // shortcuts are still working when the menubar is hidden. addActions(ui.menubar->actions()); @@ -190,13 +200,11 @@ MainWindow::MainWindow(Path path): ui.actionMenu->setMenu(menu); if(ui.actionMenu->icon().isNull()) ui.actionMenu->setIcon(QIcon::fromTheme("applications-system")); - QList list = ui.toolBar->findChildren(); - if (!list.isEmpty()) - list.at(list.count() - 1)->setPopupMode(QToolButton::InstantPopup); - Q_FOREACH(QAction *action, ui.toolBar->actions()) { - if(action->isSeparator()) - action->setVisible(!settings.showMenuBar()); - } + QToolButton* menuBtn = static_cast(ui.toolBar->widgetForAction(ui.actionMenu)); + menuBtn->setPopupMode(QToolButton::InstantPopup); + + menuSep_ = ui.toolBar->insertSeparator(ui.actionMenu); + menuSep_->setVisible(!settings.showMenuBar()); ui.actionMenu->setVisible(!settings.showMenuBar()); ui.menubar->setVisible(settings.showMenuBar()); ui.actionMenu_bar->setChecked(settings.showMenuBar()); @@ -271,8 +279,8 @@ MainWindow::MainWindow(Path path): } MainWindow::~MainWindow() { - if(!bookmarks.isNull()) { - g_signal_handlers_disconnect_by_func(bookmarks, (gpointer)G_CALLBACK(onBookmarksChanged), this); + if(!bookmarks_.isNull()) { + g_signal_handlers_disconnect_by_func(bookmarks_, (gpointer)G_CALLBACK(onBookmarksChanged), this); } } @@ -286,6 +294,23 @@ void MainWindow::chdir(Path path) { } } +void MainWindow::createPathBar(bool usePathButtons) { + QWidget* bar; + if(usePathButtons) { + bar = pathBar_ = new Fm::PathBar(this); + connect(pathBar_, &Fm::PathBar::chdir, this, &MainWindow::onPathBarChdir); + connect(pathBar_, &Fm::PathBar::middleClickChdir, this, &MainWindow::onPathBarMiddleClickChdir); + connect(pathBar_, &Fm::PathBar::editingFinished, this, &MainWindow::onResetFocus); + } + else { + bar = pathEntry_ = new Fm::PathEdit(this); + connect(pathEntry_, &Fm::PathEdit::returnPressed, this, &MainWindow::onPathEntryReturnPressed); + connect(pathEntry_, &QLineEdit::textEdited, this, &MainWindow::onPathEntryEdited); + } + ui.toolBar->insertWidget(ui.actionGo, bar); + ui.actionGo->setVisible(!usePathButtons); +} + // add a new tab int MainWindow::addTab(Path path) { Settings& settings = static_cast(qApp)->settings(); @@ -325,16 +350,13 @@ void MainWindow::toggleMenuBar(bool checked) { ui.menubar->setVisible(showMenuBar); ui.actionMenu_bar->setChecked(showMenuBar); - Q_FOREACH(QAction *action, ui.toolBar->actions()) { - if(action->isSeparator()) - action->setVisible(!showMenuBar); - } + menuSep_->setVisible(!showMenuBar); ui.actionMenu->setVisible(!showMenuBar); settings.setShowMenuBar(showMenuBar); } void MainWindow::onPathEntryReturnPressed() { - QString text = pathEntry->text(); + QString text = pathEntry_->text(); QByteArray utext = text.toUtf8(); chdir(Fm::Path::newForDisplayName(utext)); } @@ -343,10 +365,22 @@ void MainWindow::onPathEntryEdited(const QString& text) { QString realText(text); if(realText == "~" || realText.startsWith("~/")) { realText.replace(0, 1, QDir::homePath()); - pathEntry->setText(realText); + pathEntry_->setText(realText); } } +void MainWindow::onPathBarChdir(FmPath* dirPath) { + // call chdir() only when needed because otherwise + // filter bar will be cleard on changing current tab + TabPage* page = currentPage(); + if(page && dirPath != page->path()) + chdir(dirPath); +} + +void MainWindow::onPathBarMiddleClickChdir(FmPath* dirPath) { + addTab(dirPath); +} + void MainWindow::on_actionGoUp_triggered() { TabPage* page = currentPage(); @@ -383,7 +417,13 @@ void MainWindow::on_actionHome_triggered() { void MainWindow::on_actionReload_triggered() { currentPage()->reload(); - pathEntry->setText(currentPage()->pathName()); + if(pathEntry_ != nullptr) + pathEntry_->setText(currentPage()->pathName()); +} + +void MainWindow::on_actionConnectToServer_triggered() { + Application* app = static_cast(qApp); + app->connectToServer(); } void MainWindow::on_actionGo_triggered() { @@ -518,6 +558,32 @@ void MainWindow::on_actionFilter_triggered(bool checked) { static_cast(qApp)->settings().setShowFilter(checked); } +void MainWindow::on_actionLocationBar_triggered(bool checked) { + if(checked) { + // show current path in a location bar entry + if(pathBar_ != nullptr) { + delete pathBar_; + pathBar_ = nullptr; + } + createPathBar(false); + pathEntry_->setText(currentPage()->pathName()); + static_cast(qApp)->settings().setPathBarButtons(false); + } +} + +void MainWindow::on_actionPathButtons_triggered(bool checked) { + if(checked && pathBar_ == nullptr) { + // show current path as buttons + if(pathEntry_ != nullptr) { + delete pathEntry_; + pathEntry_ = nullptr; + } + createPathBar(true); + pathBar_->setPath(currentPage()->path()); + static_cast(qApp)->settings().setPathBarButtons(true); + } +} + void MainWindow::on_actionComputer_triggered() { chdir(Fm::Path::newForUri("computer:///")); } @@ -544,7 +610,7 @@ void MainWindow::on_actionAddToBookmarks_triggered() { Fm::Path cwd = page->path(); if(!cwd.isNull()) { char* dispName = cwd.displayBasename(); - bookmarks.insert(cwd, dispName, -1); + bookmarks_.insert(cwd, dispName, -1); g_free(dispName); } } @@ -654,6 +720,9 @@ void MainWindow::resizeEvent(QResizeEvent *event) { void MainWindow::closeEvent(QCloseEvent *event) { + if(lastActive_ == this) + lastActive_ = nullptr; + QWidget::closeEvent(event); Settings& settings = static_cast(qApp)->settings(); if(settings.rememberWindowSize()) { @@ -681,8 +750,8 @@ void MainWindow::updateStatusBarForCurrentPage() { ui.statusbar->showMessage(text); text = tabPage->statusText(TabPage::StatusTextFSInfo); - fsInfoLabel->setText(text); - fsInfoLabel->setVisible(!text.isEmpty()); + fsInfoLabel_->setText(text); + fsInfoLabel_->setVisible(!text.isEmpty()); } void MainWindow::updateViewMenuForCurrentPage() { @@ -743,9 +812,14 @@ void MainWindow::updateUIForCurrentPage() { if(tabPage) { setWindowTitle(tabPage->title()); - pathEntry->setText(tabPage->pathName()); + if(pathEntry_ != nullptr) { + pathEntry_->setText(tabPage->pathName()); + } + else if(pathBar_ != nullptr) { + pathBar_->setPath(tabPage->path()); + } ui.statusbar->showMessage(tabPage->statusText()); - fsInfoLabel->setText(tabPage->statusText(TabPage::StatusTextFSInfo)); + fsInfoLabel_->setText(tabPage->statusText(TabPage::StatusTextFSInfo)); tabPage->folderView()->childView()->setFocus(); // update side pane @@ -804,8 +878,8 @@ void MainWindow::onTabPageStatusChanged(int type, QString statusText) { break; } case TabPage::StatusTextFSInfo: - fsInfoLabel->setText(tabPage->statusText(TabPage::StatusTextFSInfo)); - fsInfoLabel->setVisible(!statusText.isEmpty()); + fsInfoLabel_->setText(tabPage->statusText(TabPage::StatusTextFSInfo)); + fsInfoLabel_->setVisible(!statusText.isEmpty()); break; } } @@ -879,7 +953,7 @@ void MainWindow::onSplitterMoved(int pos, int index) { } void MainWindow::loadBookmarksMenu() { - GList* allBookmarks = bookmarks.getAll(); + GList* allBookmarks = bookmarks_.getAll(); QAction* before = ui.actionAddToBookmarks; for(GList* l = allBookmarks; l; l = l->next) { @@ -999,6 +1073,16 @@ void MainWindow::setRTLIcons(bool isRTL) { } } +bool MainWindow::event(QEvent* event) { + switch(event->type()) { + case QEvent::WindowActivate: + lastActive_ = this; + default: + break; + } + return QMainWindow::event(event); +} + void MainWindow::changeEvent(QEvent *event) { switch(event->type()) { case QEvent::LayoutDirectionChange: @@ -1045,15 +1129,15 @@ void MainWindow::tabContextMenu(const QPoint& pos) { int tabNum = ui.tabBar->count(); if(tabNum <= 1) return; - rightClickIndex = ui.tabBar->tabAt(pos); - if(rightClickIndex < 0) return; + rightClickIndex_ = ui.tabBar->tabAt(pos); + if(rightClickIndex_ < 0) return; QMenu menu; - if(rightClickIndex > 0) + if(rightClickIndex_ > 0) menu.addAction(ui.actionCloseLeft); - if(rightClickIndex < tabNum - 1) { + if(rightClickIndex_ < tabNum - 1) { menu.addAction(ui.actionCloseRight); - if(rightClickIndex > 0) { + if(rightClickIndex_ > 0) { menu.addSeparator(); menu.addAction(ui.actionCloseOther); } @@ -1062,22 +1146,26 @@ void MainWindow::tabContextMenu(const QPoint& pos) { } void MainWindow::closeLeftTabs() { - while(rightClickIndex > 0) { - closeTab(rightClickIndex - 1); - --rightClickIndex; + while(rightClickIndex_ > 0) { + closeTab(rightClickIndex_ - 1); + --rightClickIndex_; } } void MainWindow::closeRightTabs() { - if(rightClickIndex < 0) return; - while(rightClickIndex < ui.tabBar->count() - 1) - closeTab(rightClickIndex + 1); + if(rightClickIndex_ < 0) return; + while(rightClickIndex_ < ui.tabBar->count() - 1) + closeTab(rightClickIndex_ + 1); } void MainWindow::focusPathEntry() { - if(pathEntry != nullptr) { - pathEntry->setFocus(); - pathEntry->selectAll(); + // use text entry for the path bar + if(pathEntry_ != nullptr) { + pathEntry_->setFocus(); + pathEntry_->selectAll(); + } + else if (pathBar_ != nullptr) { // use button-style path bar + pathBar_->openEditor(); } } diff --git a/pcmanfm/mainwindow.h b/pcmanfm/mainwindow.h index 4526dda..3d21ffd 100644 --- a/pcmanfm/mainwindow.h +++ b/pcmanfm/mainwindow.h @@ -35,6 +35,11 @@ #include #include +namespace Fm { + class PathEdit; + class PathBar; +} + namespace PCManFM { class TabPage; @@ -55,10 +60,16 @@ public: void updateFromSettings(Settings& settings); + static MainWindow* lastActive() { + return lastActive_; + } + protected Q_SLOTS: void onPathEntryReturnPressed(); void onPathEntryEdited(const QString& text); + void onPathBarChdir(FmPath* dirPath); + void onPathBarMiddleClickChdir(FmPath* dirPath); void on_actionNewTab_triggered(); void on_actionNewWin_triggered(); @@ -83,6 +94,7 @@ protected Q_SLOTS: void on_actionGoUp_triggered(); void on_actionHome_triggered(); void on_actionReload_triggered(); + void on_actionConnectToServer_triggered(); void on_actionIconView_triggered(); void on_actionCompactView_triggered(); @@ -104,6 +116,9 @@ protected Q_SLOTS: void on_actionCaseSensitive_triggered(bool checked); void on_actionFilter_triggered(bool checked); + void on_actionLocationBar_triggered(bool checked); + void on_actionPathButtons_triggered(bool checked); + void on_actionApplications_triggered(); void on_actionComputer_triggered(); void on_actionTrash_triggered(); @@ -160,27 +175,33 @@ protected Q_SLOTS: void toggleMenuBar(bool checked); protected: - void changeEvent(QEvent *event); + bool event(QEvent* event) override; + void changeEvent(QEvent *event) override; void closeTab(int index); - virtual void resizeEvent(QResizeEvent *event); - virtual void closeEvent(QCloseEvent *event); + virtual void resizeEvent(QResizeEvent *event) override; + virtual void closeEvent(QCloseEvent *event) override; private: - static void onBookmarksChanged(FmBookmarks* bookmarks, MainWindow* pThis); + static void onBookmarksChanged(FmBookmarks* bookmarks_, MainWindow* pThis); void loadBookmarksMenu(); void updateUIForCurrentPage(); void updateViewMenuForCurrentPage(); void updateStatusBarForCurrentPage(); void setRTLIcons(bool isRTL); + void createPathBar(bool usePathButtons); private: Ui::MainWindow ui; - QLineEdit* pathEntry; - QLabel* fsInfoLabel; - Fm::Bookmarks bookmarks; + Fm::PathEdit* pathEntry_; + Fm::PathBar* pathBar_; + QLabel* fsInfoLabel_; + Fm::Bookmarks bookmarks_; Launcher fileLauncher_; - int rightClickIndex; + int rightClickIndex_; bool updatingViewMenu_; + QAction* menuSep_; + + static MainWindow* lastActive_; }; } diff --git a/pcmanfm/preferencesdialog.cpp b/pcmanfm/preferencesdialog.cpp index 7abe5ca..b2c48d5 100644 --- a/pcmanfm/preferencesdialog.cpp +++ b/pcmanfm/preferencesdialog.cpp @@ -132,14 +132,13 @@ void PreferencesDialog::initArchivers(Settings& settings) { void PreferencesDialog::initDisplayPage(Settings& settings) { initIconThemes(settings); // icon sizes - int i; - for(i = 0; i < G_N_ELEMENTS(bigIconSizes); ++i) { + for(std::size_t i = 0; i < G_N_ELEMENTS(bigIconSizes); ++i) { int size = bigIconSizes[i]; ui.bigIconSize->addItem(QString("%1 x %1").arg(size), size); if(settings.bigIconSize() == size) ui.bigIconSize->setCurrentIndex(i); } - for(i = 0; i < G_N_ELEMENTS(smallIconSizes); ++i) { + for(std::size_t i = 0; i < G_N_ELEMENTS(smallIconSizes); ++i) { int size = smallIconSizes[i]; QString text = QString("%1 x %1").arg(size); ui.smallIconSize->addItem(text, size); @@ -150,7 +149,7 @@ void PreferencesDialog::initDisplayPage(Settings& settings) { if(settings.sidePaneIconSize() == size) ui.sidePaneIconSize->setCurrentIndex(i); } - for(i = 0; i < G_N_ELEMENTS(thumbnailIconSizes); ++i) { + for(std::size_t i = 0; i < G_N_ELEMENTS(thumbnailIconSizes); ++i) { int size = thumbnailIconSizes[i]; ui.thumbnailIconSize->addItem(QString("%1 x %1").arg(size), size); if(settings.thumbnailIconSize() == size) @@ -196,7 +195,7 @@ void PreferencesDialog::initBehaviorPage(Settings& settings) { Fm::FolderView::ThumbnailMode, Fm::FolderView::DetailedListMode }; - for(int i = 0; i < G_N_ELEMENTS(modes); ++i) { + for(std::size_t i = 0; i < G_N_ELEMENTS(modes); ++i) { if(modes[i] == settings.viewMode()) { ui.viewMode->setCurrentIndex(i); break; diff --git a/pcmanfm/settings.cpp b/pcmanfm/settings.cpp index 341061c..d418a29 100644 --- a/pcmanfm/settings.cpp +++ b/pcmanfm/settings.cpp @@ -91,6 +91,7 @@ Settings::Settings(): sortFolderFirst_(true), sortCaseSensitive_(false), showFilter_(false), + pathBarButtons_(true), // settings for use with libfm singleClick_(false), autoSelectionDelay_(600), @@ -279,6 +280,7 @@ bool Settings::loadFile(QString filePath) { sidePaneMode_ = sidePaneModeFromString(settings.value("SidePaneMode").toString()); showMenuBar_ = settings.value("ShowMenuBar", true).toBool(); fullWidthTabBar_ = settings.value("FullWidthTabBar", true).toBool(); + pathBarButtons_ = settings.value("PathBarButtons", true).toBool(); settings.endGroup(); return true; @@ -388,6 +390,7 @@ bool Settings::saveFile(QString filePath) { settings.setValue("SidePaneMode", sidePaneModeToString(sidePaneMode_)); settings.setValue("ShowMenuBar", showMenuBar_); settings.setValue("FullWidthTabBar", fullWidthTabBar_); + settings.setValue("PathBarButtons", pathBarButtons_); settings.endGroup(); // save per-folder settings @@ -524,6 +527,9 @@ static const char* wallpaperModeToString(int value) { case DesktopWindow::WallpaperTile: ret = "tile"; break; + case DesktopWindow::WallpaperZoom: + ret = "zoom"; + break; } return ret; } @@ -538,6 +544,8 @@ static int wallpaperModeFromString(const QString str) { ret = DesktopWindow::WallpaperCenter; else if(str == "tile") ret = DesktopWindow::WallpaperTile; + else if(str == "zoom") + ret = DesktopWindow::WallpaperZoom; else ret = DesktopWindow::WallpaperNone; return ret; diff --git a/pcmanfm/settings.h b/pcmanfm/settings.h index 75a4c5a..971ba8c 100644 --- a/pcmanfm/settings.h +++ b/pcmanfm/settings.h @@ -534,6 +534,14 @@ public: showFilter_ = value; } + bool pathBarButtons() const { + return pathBarButtons_; + } + + void setPathBarButtons(bool value) { + pathBarButtons_ = value; + } + // settings for use with libfm bool singleClick() const { return singleClick_; @@ -790,6 +798,7 @@ private: bool sortFolderFirst_; bool sortCaseSensitive_; bool showFilter_; + bool pathBarButtons_; // settings for use with libfm bool singleClick_; diff --git a/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop b/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop new file mode 100644 index 0000000..3f6ba8a --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop @@ -0,0 +1,3 @@ +Name[ca]=Escriptori +GenericName[ca]=Ajusts de l'escriptori +Comment[ca]=Canvieu les imatges dels fons i el comportament del gestor d'escriptoris diff --git a/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop b/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop new file mode 100644 index 0000000..2b1cd51 --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop @@ -0,0 +1,3 @@ +Name[da]=Skrivebord +GenericName[da]=Skrivebordsindstillinger +Comment[da]=Skift desktop managerens tapeter og adfærd diff --git a/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop b/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop new file mode 100644 index 0000000..b0fb244 --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop @@ -0,0 +1,4 @@ +#Translations +Name[fr]=Bureau +GenericName[fr]=Paramétrage du bureau +Comment[fr]=Paramètres tels que papier-peint et autres réglages du bureau diff --git a/pcmanfm/translations/pcmanfm-qt_ca.desktop b/pcmanfm/translations/pcmanfm-qt_ca.desktop new file mode 100644 index 0000000..004f601 --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt_ca.desktop @@ -0,0 +1,4 @@ +#Translations +Name[ca]=Gestor de fitxers PCManFM +GenericName[ca]=Gestor de fitxers +Comment[ca]=Navegueu pel sistema de fitxers i gestioneu els fitxers diff --git a/pcmanfm/translations/pcmanfm-qt_da.desktop b/pcmanfm/translations/pcmanfm-qt_da.desktop new file mode 100644 index 0000000..c3c2e2b --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt_da.desktop @@ -0,0 +1,3 @@ +Name[da]=PCManFM-filhåndtering +GenericName[da]=Filhåndtering +Comment[da]=Gennemse filsystemet og håndtér filerne diff --git a/pcmanfm/translations/pcmanfm-qt_fr.desktop b/pcmanfm/translations/pcmanfm-qt_fr.desktop new file mode 100644 index 0000000..85724bd --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt_fr.desktop @@ -0,0 +1,4 @@ +#Translations +Name[fr]=PCManFM-Qt +GenericName[fr]=Gestionnaire de fichiers +Comment[fr]=Gestionnaire de fichiers de l'environnement LXQt diff --git a/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop b/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop new file mode 100644 index 0000000..c823793 --- /dev/null +++ b/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop @@ -0,0 +1,4 @@ +#Translations +Name[pt_BR]=Gerenciador de Arquivos PCManFM +GenericName[pt_BR]=Gerenciador de Arquivos +Comment[pt_BR]=Navegue pelo sistema de arquivos e gerencie arquivos e pastas