Hello community, here is the log from the commit of package pcmanfm-qt for openSUSE:Factory checked in at 2017-03-13 15:32:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pcmanfm-qt (Old) and /work/SRC/openSUSE:Factory/.pcmanfm-qt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pcmanfm-qt" Mon Mar 13 15:32:32 2017 rev:7 rq:460515 version:0.11.2 Changes: -------- --- /work/SRC/openSUSE:Factory/pcmanfm-qt/pcmanfm-qt.changes 2016-10-06 12:44:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pcmanfm-qt.new/pcmanfm-qt.changes 2017-03-13 15:33:35.281390020 +0100 @@ -1,0 +2,33 @@ +Fri Feb 24 19:42:18 UTC 2017 - [email protected] + +- Update to 0.11.2: + * 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) + +------------------------------------------------------------------- Old: ---- pcmanfm-qt-0.11.1.tar.xz pcmanfm-qt-0.11.1.tar.xz.asc New: ---- pcmanfm-qt-0.11.2.tar.xz pcmanfm-qt-0.11.2.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pcmanfm-qt.spec ++++++ --- /var/tmp/diff_new_pack.dUe36B/_old 2017-03-13 15:33:35.933297890 +0100 +++ /var/tmp/diff_new_pack.dUe36B/_new 2017-03-13 15:33:35.937297325 +0100 @@ -17,7 +17,7 @@ Name: pcmanfm-qt -Version: 0.11.1 +Version: 0.11.2 Release: 0 Summary: File manager and desktop icon manager License: GPL-2.0+ @@ -30,6 +30,7 @@ BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkgconfig +BuildRequires: lxqt-build-tools-devel BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5UiTools) ++++++ pcmanfm-qt-0.11.1.tar.xz -> pcmanfm-qt-0.11.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/.gitignore new/pcmanfm-qt-0.11.2/.gitignore --- old/pcmanfm-qt-0.11.1/.gitignore 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -build -*.kdev4 -pcmanfm/translations/pcmanfm-qt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/CHANGELOG new/pcmanfm-qt-0.11.2/CHANGELOG --- old/pcmanfm-qt-0.11.1/CHANGELOG 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/CHANGELOG 2016-12-21 18:44:38.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/CMakeLists.txt new/pcmanfm-qt-0.11.2/CMakeLists.txt --- old/pcmanfm-qt-0.11.1/CMakeLists.txt 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/CMakeLists.txt 2016-12-21 18:44:38.000000000 +0100 @@ -8,9 +8,11 @@ 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(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 @@ ) 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/CMakeLists.txt new/pcmanfm-qt-0.11.2/pcmanfm/CMakeLists.txt --- old/pcmanfm-qt-0.11.1/pcmanfm/CMakeLists.txt 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/CMakeLists.txt 2016-12-21 18:44:38.000000000 +0100 @@ -12,6 +12,7 @@ desktopwindow.cpp desktopitemdelegate.cpp autorundialog.cpp + connectserverdialog.cpp settings.cpp ) @@ -30,6 +31,7 @@ desktop-preferences.ui desktop-folder.ui autorun.ui + connect.ui ) qt5_wrap_ui(pcmanfm_UIS_H ${pcmanfm_UIS}) @@ -58,16 +60,17 @@ ${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 @@ Qt5::Widgets Qt5::DBus fm-qt - "${LIB_XCB_LIBRARIES}" ) install(TARGETS pcmanfm-qt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/about.ui new/pcmanfm-qt-0.11.2/pcmanfm/about.ui --- old/pcmanfm-qt-0.11.1/pcmanfm/about.ui 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/about.ui 2016-12-21 18:44:38.000000000 +0100 @@ -22,7 +22,7 @@ <item> <widget class="QLabel" name="label"> <property name="text"> - <string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM</span></p></body></html></string> + <string><html><head/><body><p><span style=" font-size:16pt; font-weight:600;">PCManFM-Qt</span></p></body></html></string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> @@ -106,7 +106,7 @@ <bool>true</bool> </property> <property name="plainText"> - <string>PCMan File Manager + <string>PCManFM-Qt File Manager Copyright (C) 2009 - 2014 洪任諭 (Hong Jen Yee) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/application.cpp new/pcmanfm-qt-0.11.2/pcmanfm/application.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/application.cpp 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/application.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -33,26 +33,28 @@ #include <QMessageBox> #include <QCommandLineParser> #include <QSocketNotifier> +#include <QScreen> +#include <QWindow> +#include <QFileSystemWatcher> + #include <gio/gio.h> #include <sys/socket.h> -#include "applicationadaptor.h" -#include "preferencesdialog.h" -#include "desktoppreferencesdialog.h" #include <libfm-qt/mountoperation.h> -#include "autorundialog.h" -#include "launcher.h" #include <libfm-qt/filesearchdialog.h> #include <libfm-qt/path.h> #include <libfm-qt/terminal.h> -#include <QScreen> -#include <QWindow> +#include "applicationadaptor.h" +#include "preferencesdialog.h" +#include "desktoppreferencesdialog.h" +#include "autorundialog.h" +#include "launcher.h" +#include "xdgdir.h" +#include "connectserverdialog.h" #include <X11/Xlib.h> -#include "xdgdir.h" -#include <QFileSystemWatcher> namespace PCManFM { @@ -191,7 +193,7 @@ 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::onFindFileAccepted() { Fm::FileSearchDialog* dlg = static_cast<Fm::FileSearchDialog*>(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<ConnectServerDialog*>(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 @@ 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 @@ } } // 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<DesktopWindow::WallpaperMode>(i); if(mode != settings_.wallpaperMode()) changed = true; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/application.h new/pcmanfm-qt-0.11.2/pcmanfm/application.h --- old/pcmanfm-qt-0.11.1/pcmanfm/application.h 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/application.h 2016-12-21 18:44:38.000000000 +0100 @@ -37,6 +37,7 @@ namespace PCManFM { +class MainWindow; class DesktopWindow; class PreferencesDialog; class DesktopPreferencesDialog; @@ -76,6 +77,7 @@ void editBookmarks(); void desktopManager(bool enabled); void findFiles(QStringList paths = QStringList()); + void connectToServer(); bool desktopManagerEnabled() { return enableDesktopManager_; @@ -107,6 +109,7 @@ void reloadDesktopsAsNeeded(); void onFindFileAccepted(); + void onConnectToServerAccepted(); protected: virtual bool eventFilter(QObject* watched, QEvent* event); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/connect.ui new/pcmanfm-qt-0.11.2/pcmanfm/connect.ui --- old/pcmanfm-qt-0.11.1/pcmanfm/connect.ui 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/connect.ui 2016-12-21 18:44:38.000000000 +0100 @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ConnectServerDialog</class> + <widget class="QDialog" name="ConnectServerDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>450</width> + <height>256</height> + </rect> + </property> + <property name="windowTitle"> + <string>Connect to remote server</string> + </property> + <property name="windowIcon"> + <iconset theme="folder-remote"/> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="5" column="0" colspan="4"> + <widget class="QRadioButton" name="ananymousLogin"> + <property name="text"> + <string>Anonymous &login</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="4" column="1" colspan="3"> + <widget class="QLineEdit" name="path"/> + </item> + <item row="6" column="0"> + <widget class="QRadioButton" name="loginAsUser"> + <property name="text"> + <string>Login as &user:</string> + </property> + </widget> + </item> + <item row="6" column="1" colspan="3"> + <widget class="QLineEdit" name="userName"/> + </item> + <item row="1" column="1" colspan="3"> + <widget class="QComboBox" name="serverType"/> + </item> + <item row="8" column="0" colspan="4"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + <item row="0" column="0" colspan="4"> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Specify remote folder to connect</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Type:</string> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Port:</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Path:</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="host"/> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Host:</string> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QSpinBox" name="port"> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item row="7" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>ConnectServerDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>254</x> + <y>249</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>ConnectServerDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>322</x> + <y>249</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>loginAsUser</sender> + <signal>toggled(bool)</signal> + <receiver>userName</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>65</x> + <y>194</y> + </hint> + <hint type="destinationlabel"> + <x>163</x> + <y>184</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/connectserverdialog.cpp new/pcmanfm-qt-0.11.2/pcmanfm/connectserverdialog.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/connectserverdialog.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/connectserverdialog.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -0,0 +1,89 @@ +#include "connectserverdialog.h" +#include <QMessageBox> +#include <QPushButton> + +namespace PCManFM { + +ConnectServerDialog::ConnectServerDialog(QWidget *parent): QDialog(parent) { + serverTypes = QList<ServerType>{ + {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<void(QComboBox::*)(int)>(&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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/connectserverdialog.h new/pcmanfm-qt-0.11.2/pcmanfm/connectserverdialog.h --- old/pcmanfm-qt-0.11.1/pcmanfm/connectserverdialog.h 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/connectserverdialog.h 2016-12-21 18:44:38.000000000 +0100 @@ -0,0 +1,38 @@ +#ifndef CONNECTSERVERDIALOG_H +#define CONNECTSERVERDIALOG_H + +#include <QDialog> +#include <QList> +#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<ServerType> serverTypes; +}; + +} // namespace PCManFM + +#endif // CONNECTSERVERDIALOG_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/desktoppreferencesdialog.cpp new/pcmanfm-qt-0.11.2/pcmanfm/desktoppreferencesdialog.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/desktoppreferencesdialog.cpp 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/desktoppreferencesdialog.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -54,6 +54,7 @@ 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 @@ case DesktopWindow::WallpaperTile: i = 4; break; + case DesktopWindow::WallpaperZoom: + i = 5; + break; default: i = 0; } @@ -80,7 +84,7 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/desktopwindow.cpp new/pcmanfm-qt-0.11.2/pcmanfm/desktopwindow.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/desktopwindow.cpp 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/desktopwindow.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -104,6 +104,7 @@ 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 @@ 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 @@ 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 @@ // 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 @@ 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<QByteArray, QPoint>::iterator it = customItemPos_.find(name); if(it != customItemPos_.end()) { // the item has a custom position diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/desktopwindow.h new/pcmanfm-qt-0.11.2/pcmanfm/desktopwindow.h --- old/pcmanfm-qt-0.11.1/pcmanfm/desktopwindow.h 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/desktopwindow.h 2016-12-21 18:44:38.000000000 +0100 @@ -50,7 +50,8 @@ WallpaperStretch, WallpaperFit, WallpaperCenter, - WallpaperTile + WallpaperTile, + WallpaperZoom }; explicit DesktopWindow(int screenNum); @@ -101,6 +102,7 @@ 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 @@ int screenNum_; QHash<QByteArray, QPoint> customItemPos_; + QHash<QModelIndex, QString> displayNames_; // only for desktop entries and shortcuts QTimer* relayoutTimer_; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/main-win.ui new/pcmanfm-qt-0.11.2/pcmanfm/main-win.ui --- old/pcmanfm-qt-0.11.1/pcmanfm/main-win.ui 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/main-win.ui 2016-12-21 18:44:38.000000000 +0100 @@ -112,6 +112,9 @@ <height>30</height> </rect> </property> + <property name="contextMenuPolicy"> + <enum>Qt::PreventContextMenu</enum> + </property> <widget class="QMenu" name="menu_File"> <property name="title"> <string>&File</string> @@ -170,6 +173,20 @@ <addaction name="actionDetailedList"/> <addaction name="separator"/> </widget> + <widget class="QMenu" name="menuToolbars"> + <property name="title"> + <string>&Toolbars</string> + </property> + <addaction name="actionFilter"/> + <addaction name="actionMenu_bar"/> + </widget> + <widget class="QMenu" name="menuPathBarStyle"> + <property name="title"> + <string>Path &Bar</string> + </property> + <addaction name="actionLocationBar"/> + <addaction name="actionPathButtons"/> + </widget> <addaction name="actionReload"/> <addaction name="separator"/> <addaction name="actionShowHidden"/> @@ -177,8 +194,8 @@ <addaction name="menu_View_2"/> <addaction name="actionPreserveView"/> <addaction name="separator"/> - <addaction name="actionFilter"/> - <addaction name="actionMenu_bar"/> + <addaction name="menuToolbars"/> + <addaction name="menuPathBarStyle"/> </widget> <widget class="QMenu" name="menu_Editw"> <property name="title"> @@ -216,6 +233,8 @@ <addaction name="actionGoBack"/> <addaction name="actionGoForward"/> <addaction name="actionGoUp"/> + <addaction name="separator"/> + <addaction name="actionConnectToServer"/> </widget> <widget class="QMenu" name="menu_Tool"> <property name="title"> @@ -235,6 +254,9 @@ </widget> <widget class="QStatusBar" name="statusbar"/> <widget class="QToolBar" name="toolBar"> + <property name="contextMenuPolicy"> + <enum>Qt::PreventContextMenu</enum> + </property> <property name="windowTitle"> <string>Main Toolbar</string> </property> @@ -255,8 +277,8 @@ <addaction name="actionGoForward"/> <addaction name="actionGoUp"/> <addaction name="actionReload"/> - <addaction name="actionGo"/> <addaction name="separator"/> + <addaction name="actionGo"/> <addaction name="actionMenu"/> </widget> <action name="actionGoUp"> @@ -756,7 +778,7 @@ <bool>true</bool> </property> <property name="text"> - <string>Menu bar</string> + <string>&Menu bar</string> </property> <property name="toolTip"> <string>Menu bar</string> @@ -785,6 +807,27 @@ <string>&Preserve Settings for This Folder</string> </property> </action> + <action name="actionConnectToServer"> + <property name="text"> + <string>Connect to &Server</string> + </property> + </action> + <action name="actionLocationBar"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Location</string> + </property> + </action> + <action name="actionPathButtons"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Path Buttons</string> + </property> + </action> </widget> <customwidgets> <customwidget> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/mainwindow.cpp new/pcmanfm-qt-0.11.2/pcmanfm/mainwindow.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/mainwindow.cpp 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/mainwindow.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -41,22 +41,26 @@ #include <libfm-qt/utilities.h> #include <libfm-qt/filepropsdialog.h> #include <libfm-qt/pathedit.h> +#include <libfm-qt/pathbar.h> #include <libfm-qt/path.h> #include <libfm-qt/fileinfo.h> #include <libfm-qt/folder.h> #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<Application*>(qApp)->settings(); @@ -131,14 +135,15 @@ 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 @@ 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 @@ 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 @@ ui.actionMenu->setMenu(menu); if(ui.actionMenu->icon().isNull()) ui.actionMenu->setIcon(QIcon::fromTheme("applications-system")); - QList<QToolButton *> list = ui.toolBar->findChildren<QToolButton *>(); - 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<QToolButton*>(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() { - 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::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<Application*>(qApp)->settings(); @@ -325,16 +350,13 @@ 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 @@ 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_actionReload_triggered() { currentPage()->reload(); - pathEntry->setText(currentPage()->pathName()); + if(pathEntry_ != nullptr) + pathEntry_->setText(currentPage()->pathName()); +} + +void MainWindow::on_actionConnectToServer_triggered() { + Application* app = static_cast<Application*>(qApp); + app->connectToServer(); } void MainWindow::on_actionGo_triggered() { @@ -518,6 +558,32 @@ static_cast<Application*>(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<Application*>(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<Application*>(qApp)->settings().setPathBarButtons(true); + } +} + void MainWindow::on_actionComputer_triggered() { chdir(Fm::Path::newForUri("computer:///")); } @@ -544,7 +610,7 @@ 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::closeEvent(QCloseEvent *event) { + if(lastActive_ == this) + lastActive_ = nullptr; + QWidget::closeEvent(event); Settings& settings = static_cast<Application*>(qApp)->settings(); if(settings.rememberWindowSize()) { @@ -681,8 +750,8 @@ 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 @@ 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 @@ 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::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 @@ } } +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 @@ 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::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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/mainwindow.h new/pcmanfm-qt-0.11.2/pcmanfm/mainwindow.h --- old/pcmanfm-qt-0.11.1/pcmanfm/mainwindow.h 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/mainwindow.h 2016-12-21 18:44:38.000000000 +0100 @@ -35,6 +35,11 @@ #include <libfm-qt/bookmarks.h> #include <libfm-qt/path.h> +namespace Fm { + class PathEdit; + class PathBar; +} + namespace PCManFM { class TabPage; @@ -55,10 +60,16 @@ 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 @@ 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 @@ 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 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/preferencesdialog.cpp new/pcmanfm-qt-0.11.2/pcmanfm/preferencesdialog.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/preferencesdialog.cpp 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/preferencesdialog.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -132,14 +132,13 @@ 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 @@ 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 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/settings.cpp new/pcmanfm-qt-0.11.2/pcmanfm/settings.cpp --- old/pcmanfm-qt-0.11.1/pcmanfm/settings.cpp 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/settings.cpp 2016-12-21 18:44:38.000000000 +0100 @@ -91,6 +91,7 @@ sortFolderFirst_(true), sortCaseSensitive_(false), showFilter_(false), + pathBarButtons_(true), // settings for use with libfm singleClick_(false), autoSelectionDelay_(600), @@ -279,6 +280,7 @@ 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 @@ 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 @@ case DesktopWindow::WallpaperTile: ret = "tile"; break; + case DesktopWindow::WallpaperZoom: + ret = "zoom"; + break; } return ret; } @@ -538,6 +544,8 @@ ret = DesktopWindow::WallpaperCenter; else if(str == "tile") ret = DesktopWindow::WallpaperTile; + else if(str == "zoom") + ret = DesktopWindow::WallpaperZoom; else ret = DesktopWindow::WallpaperNone; return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/settings.h new/pcmanfm-qt-0.11.2/pcmanfm/settings.h --- old/pcmanfm-qt-0.11.1/pcmanfm/settings.h 2016-09-24 00:49:29.000000000 +0200 +++ new/pcmanfm-qt-0.11.2/pcmanfm/settings.h 2016-12-21 18:44:38.000000000 +0100 @@ -534,6 +534,14 @@ 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 @@ bool sortFolderFirst_; bool sortCaseSensitive_; bool showFilter_; + bool pathBarButtons_; // settings for use with libfm bool singleClick_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt-desktop-pref_ca.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt-desktop-pref_da.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -0,0 +1,3 @@ +Name[da]=Skrivebord +GenericName[da]=Skrivebordsindstillinger +Comment[da]=Skift desktop managerens tapeter og adfærd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt-desktop-pref_fr.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_ca.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_ca.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_ca.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_ca.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_da.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_da.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_da.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_da.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -0,0 +1,3 @@ +Name[da]=PCManFM-filhåndtering +GenericName[da]=Filhåndtering +Comment[da]=Gennemse filsystemet og håndtér filerne diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_fr.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_fr.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_fr.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_fr.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -0,0 +1,4 @@ +#Translations +Name[fr]=PCManFM-Qt +GenericName[fr]=Gestionnaire de fichiers +Comment[fr]=Gestionnaire de fichiers de l'environnement LXQt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop --- old/pcmanfm-qt-0.11.1/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/pcmanfm-qt-0.11.2/pcmanfm/translations/pcmanfm-qt_pt_BR.desktop 2016-12-21 18:44:38.000000000 +0100 @@ -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
