Adding upstream version 0.11.1~11-g537bfc2.

Alf Gaida 8 years ago
parent 5660b62a58
commit ca7fa5be55

2
.gitignore vendored

@ -1,2 +0,0 @@
build
*.kdev4

@ -18,6 +18,8 @@ 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(PkgConfig REQUIRED)
pkg_check_modules(LIB_XCB REQUIRED xcb)

@ -1,107 +0,0 @@
#=============================================================================
# The lxqt_translate_desktop() function was copied from the the
# LXQt LxQtTranste.cmake
#
# Original Author: Alexander Sokolov <sokoloff.a@gmail.com>
#
# funtion lxqt_translate_desktop(_RESULT
# SOURCES <sources>
# [TRANSLATION_DIR] translation_directory
# )
# Output:
# _RESULT The generated .desktop (.desktop) files
#
# Input:
#
# SOURCES List of input desktop files (.destktop.in) to be translated
# (merged), relative to the CMakeList.txt.
#
# TRANSLATION_DIR Optional path to the directory with the .ts files,
# relative to the CMakeList.txt. Defaults to
# "translations".
#
#=============================================================================
function(lxqt_translate_desktop _RESULT)
# Parse arguments ***************************************
set(oneValueArgs TRANSLATION_DIR)
set(multiValueArgs SOURCES)
cmake_parse_arguments(_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# check for unknown arguments
set(_UNPARSED_ARGS ${_ARGS_UNPARSED_ARGUMENTS})
if (NOT ${_UNPARSED_ARGS} STREQUAL "")
MESSAGE(FATAL_ERROR
"Unknown arguments '${_UNPARSED_ARGS}'.\n"
"See lxqt_translate_desktop() documenation for more information.\n"
)
endif()
if (NOT DEFINED _ARGS_SOURCES)
set(${_RESULT} "" PARENT_SCOPE)
return()
else()
set(_sources ${_ARGS_SOURCES})
endif()
if (NOT DEFINED _ARGS_TRANSLATION_DIR)
set(_translationDir "translations")
else()
set(_translationDir ${_ARGS_TRANSLATION_DIR})
endif()
get_filename_component (_translationDir ${_translationDir} ABSOLUTE)
foreach (_inFile ${_sources})
get_filename_component(_inFile ${_inFile} ABSOLUTE)
get_filename_component(_fileName ${_inFile} NAME_WE)
#Extract the real extension ............
get_filename_component(_fileExt ${_inFile} EXT)
string(REPLACE ".in" "" _fileExt ${_fileExt})
#.......................................
set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}${_fileExt}")
file(GLOB _translations
${_translationDir}/${_fileName}_*${_fileExt}
${_translationDir}/local/${_fileName}_*${_fileExt}
)
set(_pattern "'\\[.*]\\s*='")
if (_translations)
add_custom_command(OUTPUT ${_outFile}
COMMAND grep -a -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
COMMAND grep -a -h ${_pattern} ${_translations} >> ${_outFile}
COMMENT "Generating ${_fileName}${_fileExt}"
)
else()
add_custom_command(OUTPUT ${_outFile}
COMMAND grep -a -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
COMMENT "Generating ${_fileName}${_fileExt}"
)
endif()
set(__result ${__result} ${_outFile})
# TX file ***********************************************
set(_txFile "${CMAKE_BINARY_DIR}/tx/${_fileName}${_fileExt}.tx.sh")
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_inFile ${_inFile})
string(REPLACE "." "" _fileType ${_fileExt})
file(WRITE ${_txFile}
"[ -f ${_inFile} ] || exit 0\n"
"echo '[lxde-qt.${_fileName}_${_fileType}]'\n"
"echo 'type = DESKTOP'\n"
"echo 'source_lang = en'\n"
"echo 'source_file = ${_tx_inFile}'\n"
"echo 'file_filter = ${_tx_translationDir}/${_fileName}_<lang>${_fileExt}'\n"
"echo ''\n"
)
endforeach()
set(${_RESULT} ${__result} PARENT_SCOPE)
endfunction(lxqt_translate_desktop)

@ -1,131 +0,0 @@
#=============================================================================
# Copyright 2014 Luís Pereira <luis.artur.pereira@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
#
# funtion lxqt_translate_ts(qmFiles
# [USE_QT5 [Yes | No]]
# [UPDATE_TRANSLATIONS [Yes | No]]
# SOURCES <sources>
# [TEMPLATE] translation_template
# [TRANSLATION_DIR] translation_directory
# [INSTALL_DIR] install_directory
# )
# Output:
# qmFiles The generated compiled translations (.qm) files
#
# Input:
# USE_QT5 Optional flag to choose between Qt4 and Qt5. Defaults to Qt5
#
# UPDATE_TRANSLATIONS Optional flag. Setting it to Yes, extracts and
# compiles the translations. Setting it No, only
# compiles them.
#
# TEMPLATE Optional translations files base name. Defaults to
# ${PROJECT_NAME}. An .ts extensions is added.
#
# TRANSLATION_DIR Optional path to the directory with the .ts files,
# relative to the CMakeList.txt. Defaults to
# "translations".
#
# INSTALL_DIR Optional destination of the file compiled files (qmFiles).
# If not present no installation is performed
# CMake v2.8.3 needed to use the CMakeParseArguments module
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
# We use our patched version to round a annoying bug.
include(Qt5PatchedLinguistToolsMacros)
function(lxqt_translate_ts qmFiles)
set(oneValueArgs USE_QT5 UPDATE_TRANSLATIONS TEMPLATE TRANSLATION_DIR INSTALL_DIR)
set(multiValueArgs SOURCES)
cmake_parse_arguments(TR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT DEFINED TR_UPDATE_TRANSLATIONS)
set(TR_UPDATE_TRANSLATIONS "No")
endif()
if (NOT DEFINED TR_USE_QT5)
set(TR_USE_QT5 "Yes")
endif()
if(NOT DEFINED TR_TEMPLATE)
set(TR_TEMPLATE "${PROJECT_NAME}")
endif()
if (NOT DEFINED TR_TRANSLATION_DIR)
set(TR_TRANSLATION_DIR "translations")
endif()
file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
set(templateFile "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}.ts")
if(TR_USE_QT5)
# Qt5
if (TR_UPDATE_TRANSLATIONS)
qt5_patched_create_translation(QMS
${TR_SOURCES}
${templateFile}
OPTIONS -locations absolute
)
qt5_patched_create_translation(QM
${TR_SOURCES}
${tsFiles}
OPTIONS -locations absolute
)
else()
qt5_patched_add_translation(QM ${tsFiles})
endif()
else()
# Qt4
if(TR_UPDATE_TRANSLATIONS)
qt4_create_translation(QMS
${TR_SOURCES}
${templateFile}
OPTIONS -locations absolute
)
qt4_create_translation(QM
${TR_SOURCES}
${tsFiles}
OPTIONS -locations absolute
)
else()
qt4_add_translation(QM ${tsFiles})
endif()
endif()
if(TR_UPDATE_TRANSLATIONS)
add_custom_target("update_${TR_TEMPLATE}_ts" ALL DEPENDS ${QMS})
endif()
if(DEFINED TR_INSTALL_DIR)
install(FILES ${QM} DESTINATION ${TR_INSTALL_DIR})
endif()
set(${qmFiles} ${QM} PARENT_SCOPE)
endfunction()

@ -1,112 +0,0 @@
#=============================================================================
# Copyright 2005-2011 Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Kitware, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
include(CMakeParseArguments)
function(QT5_PATCHED_CREATE_TRANSLATION _qm_files)
set(options)
set(oneValueArgs)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_LUPDATE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(_lupdate_files ${_LUPDATE_UNPARSED_ARGUMENTS})
set(_lupdate_options ${_LUPDATE_OPTIONS})
set(_my_sources)
set(_my_tsfiles)
foreach(_file ${_lupdate_files})
get_filename_component(_ext ${_file} EXT)
get_filename_component(_abs_FILE ${_file} ABSOLUTE)
if(_ext MATCHES "ts")
list(APPEND _my_tsfiles ${_abs_FILE})
else()
list(APPEND _my_sources ${_abs_FILE})
endif()
endforeach()
foreach(_ts_file ${_my_tsfiles})
if(_my_sources)
# make a list file to call lupdate on, so we don't make our commands too
# long for some systems
# get_filename_component(_ts_name ${_ts_file} NAME_WE)
get_filename_component(_name ${_ts_file} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _ts_name ${_name})
set(_ts_lst_file "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lst_file")
set(_lst_file_srcs)
foreach(_lst_file_src ${_my_sources})
set(_lst_file_srcs "${_lst_file_src}\n${_lst_file_srcs}")
endforeach()
get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
foreach(_pro_include ${_inc_DIRS})
get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
set(_lst_file_srcs "-I${_pro_include}\n${_lst_file_srcs}")
endforeach()
file(WRITE ${_ts_lst_file} "${_lst_file_srcs}")
endif()
add_custom_command(OUTPUT ${_ts_file}
COMMAND ${Qt5_LUPDATE_EXECUTABLE}
ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file}
DEPENDS ${_my_sources} ${_ts_lst_file} VERBATIM)
endforeach()
qt5_patched_add_translation(${_qm_files} ${_my_tsfiles})
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
endfunction()
function(QT5_PATCHED_ADD_TRANSLATION _qm_files)
foreach(_current_FILE ${ARGN})
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
# get_filename_component(qm ${_abs_FILE} NAME_WE)
get_filename_component(_name ${_abs_FILE} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" qm ${_name})
get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
if(output_location)
file(MAKE_DIRECTORY "${output_location}")
set(qm "${output_location}/${qm}.qm")
else()
set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
endif()
add_custom_command(OUTPUT ${qm}
COMMAND ${Qt5_LRELEASE_EXECUTABLE}
ARGS ${_abs_FILE} -qm ${qm}
DEPENDS ${_abs_FILE} VERBATIM
)
list(APPEND ${_qm_files} ${qm})
endforeach()
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
endfunction()

@ -38,6 +38,11 @@ qt5_wrap_ui(pcmanfm_UIS_H ${pcmanfm_UIS})
lxqt_translate_ts(QM_FILES
UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
SOURCES ${pcmanfm_SRCS} ${pcmanfm_UIS}
INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations"
PULL_TRANSLATIONS ${PULL_TRANSLATIONS}
CLEAN_TRANSLATIONS ${CLEAN_TRANSLATIONS}
TRANSLATIONS_REPO ${TRANSLATIONS_REPO}
TRANSLATIONS_REFSPEC ${TRANSLATIONS_REFSPEC}
)
# translate desktop entry files for pcmanfm-qt and desktop preferences
@ -79,7 +84,5 @@ install(TARGETS pcmanfm-qt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${DESKTOP_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
)
install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_DATADIR}/pcmanfm-qt/translations")
# prevent the generated files from being deleted during make clean
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)

@ -70,13 +70,13 @@ Application::Application(int& argc, char** argv):
settings_(),
profileName_("default"),
daemonMode_(false),
desktopWindows_(),
enableDesktopManager_(false),
desktopWindows_(),
preferencesDialog_(),
editBookmarksialog_(),
volumeMonitor_(NULL),
userDirsWatcher_(NULL),
lxqtRunning_(false),
editBookmarksialog_() {
lxqtRunning_(false) {
argc_ = argc;
argv_ = argv;

@ -27,10 +27,10 @@
namespace PCManFM {
AutoRunDialog::AutoRunDialog(GVolume* volume, GMount* mount, QWidget* parent, Qt::WindowFlags f):
QDialog(parent, f),
cancellable(g_cancellable_new()),
applications(NULL),
mount_(G_MOUNT(g_object_ref(mount))),
QDialog(parent, f) {
mount_(G_MOUNT(g_object_ref(mount))) {
setAttribute(Qt::WA_DeleteOnClose);
ui.setupUi(this);

@ -113,6 +113,25 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Icons</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Icon size:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="iconSize"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">

@ -33,6 +33,8 @@
namespace PCManFM {
static int iconSizes[] = {96, 72, 64, 48, 36, 32, 24, 20};
DesktopPreferencesDialog::DesktopPreferencesDialog(QWidget* parent, Qt::WindowFlags f):
QDialog(parent, f),
editDesktopFolderEnabled(false),
@ -78,6 +80,13 @@ 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) {
int size = iconSizes[i];
ui.iconSize->addItem(QString("%1 x %1").arg(size), size);
if(settings.desktopIconSize() == size)
ui.iconSize->setCurrentIndex(i);
}
ui.font->setFont(settings.desktopFont());
ui.backgroundColor->setColor(settings.desktopBgColor());
@ -132,6 +141,7 @@ void DesktopPreferencesDialog::applySettings()
settings.setWallpaper(ui.imageFile->text());
int mode = ui.wallpaperMode->itemData(ui.wallpaperMode->currentIndex()).toInt();
settings.setWallpaperMode(mode);
settings.setDesktopIconSize(ui.iconSize->itemData(ui.iconSize->currentIndex()).toInt());
settings.setDesktopFont(ui.font->font());
settings.setDesktopBgColor(ui.backgroundColor->color());
settings.setDesktopFgColor(ui.textColor->color());

@ -59,13 +59,13 @@ namespace PCManFM {
DesktopWindow::DesktopWindow(int screenNum):
View(Fm::FolderView::IconMode),
screenNum_(screenNum),
folder_(NULL),
model_(NULL),
proxyModel_(NULL),
model_(NULL),
folder_(NULL),
wallpaperMode_(WallpaperNone),
fileLauncher_(NULL),
showWmMenu_(false),
wallpaperMode_(WallpaperNone),
screenNum_(screenNum),
relayoutTimer_(NULL) {
QDesktopWidget* desktopWidget = QApplication::desktop();
@ -96,12 +96,14 @@ DesktopWindow::DesktopWindow(int screenNum):
proxyModel_ = new Fm::ProxyFolderModel();
proxyModel_->setSourceModel(model_);
proxyModel_->setShowThumbnails(settings.showThumbnails());
proxyModel_->sort(Fm::FolderModel::ColumnFileMTime);
proxyModel_->sort(settings.desktopSortColumn(), settings.desktopSortOrder());
proxyModel_->setFolderFirst(settings.desktopSortFolderFirst());
setModel(proxyModel_);
connect(proxyModel_, &Fm::ProxyFolderModel::rowsInserted, this, &DesktopWindow::onRowsInserted);
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(listView_, &QListView::indexesMoved, this, &DesktopWindow::onIndexesMoved);
}
@ -343,7 +345,7 @@ void DesktopWindow::updateFromSettings(Settings& settings) {
setWallpaperFile(settings.wallpaper());
setWallpaperMode(settings.wallpaperMode());
setFont(settings.desktopFont());
setIconSize(Fm::FolderView::IconMode, QSize(settings.bigIconSize(), settings.bigIconSize()));
setIconSize(Fm::FolderView::IconMode, QSize(settings.desktopIconSize(), settings.desktopIconSize()));
setMargins(settings.desktopCellMargins());
// setIconSize and setMargins may trigger relayout of items by QListView, so we need to do the layout again.
queueRelayout();
@ -426,6 +428,13 @@ void DesktopWindow::onLayoutChanged() {
queueRelayout();
}
void DesktopWindow::onModelSortFilterChanged() {
Settings& settings = static_cast<Application*>(qApp)->settings();
settings.setDesktopSortColumn(static_cast<Fm::FolderModel::ColumnId>(proxyModel_->sortColumn()));
settings.setDesktopSortOrder(proxyModel_->sortOrder());
settings.setSesktopSortFolderFirst(proxyModel_->folderFirst());
}
void DesktopWindow::onIndexesMoved(const QModelIndexList& indexes) {
// remember the custom position for the items
Q_FOREACH(const QModelIndex& index, indexes) {

@ -98,6 +98,7 @@ protected Q_SLOTS:
void onRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
void onRowsInserted(const QModelIndex& parent, int start, int end);
void onLayoutChanged();
void onModelSortFilterChanged();
void onIndexesMoved(const QModelIndexList& indexes);
void relayoutItems();

@ -718,7 +718,7 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Close &amp;left tabs</string>
<string>Close &amp;previous tabs</string>
</property>
</action>
<action name="actionCloseRight">
@ -727,7 +727,7 @@
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Close &amp;right tabs</string>
<string>Close &amp;next tabs</string>
</property>
</action>
<action name="actionCloseOther">

@ -173,7 +173,7 @@ MainWindow::MainWindow(FmPath* path):
addActions(ui.menubar->actions());
// Show or hide the menu bar
QMenu *menu = new QMenu();
QMenu *menu = new QMenu(ui.toolBar);
menu->addMenu(ui.menu_File);
menu->addMenu(ui.menu_Editw);
menu->addMenu(ui.menu_View);
@ -259,6 +259,9 @@ MainWindow::MainWindow(FmPath* path):
if(settings.windowMaximized())
setWindowState(windowState() | Qt::WindowMaximized);
}
if(QApplication::layoutDirection() == Qt::RightToLeft)
setRTLIcons(true);
}
MainWindow::~MainWindow() {
@ -585,7 +588,7 @@ void MainWindow::onTabBarCloseRequested(int index) {
void MainWindow::onResetFocus() {
if(TabPage* page = currentPage()) {
currentPage()->folderView()->childView()->setFocus();
page->folderView()->childView()->setFocus();
}
}
@ -976,15 +979,34 @@ void MainWindow::on_actionPreferences_triggered() {
app->preferences(QString());
}
/*
void MainWindow::changeEvent(QEvent* event) {
// change some icons according to layout direction
void MainWindow::setRTLIcons(bool isRTL) {
QIcon nxtIcn = QIcon::fromTheme("go-next");
QIcon prevIcn = QIcon::fromTheme("go-previous");
if(isRTL) {
ui.actionGoBack->setIcon(nxtIcn);
ui.actionCloseLeft->setIcon(nxtIcn);
ui.actionGoForward->setIcon(prevIcn);
ui.actionCloseRight->setIcon(prevIcn);
}
else {
ui.actionGoBack->setIcon(prevIcn);
ui.actionCloseLeft->setIcon(prevIcn);
ui.actionGoForward->setIcon(nxtIcn);
ui.actionCloseRight->setIcon(nxtIcn);
}
}
void MainWindow::changeEvent(QEvent *event) {
switch(event->type()) {
case QEvent::StyleChange:
case QEvent::LayoutDirectionChange:
setRTLIcons(QApplication::layoutDirection() == Qt::RightToLeft);
break;
default:
break;
}
QWidget::changeEvent(event);
}
*/
void MainWindow::onBackForwardContextMenu(QPoint pos) {
// show a popup menu for browsing history here.

@ -156,7 +156,7 @@ protected Q_SLOTS:
void toggleMenuBar(bool checked);
protected:
// void changeEvent( QEvent * event);
void changeEvent(QEvent *event);
void closeTab(int index);
virtual void resizeEvent(QResizeEvent *event);
virtual void closeEvent(QCloseEvent *event);
@ -167,6 +167,7 @@ private:
void updateUIForCurrentPage();
void updateViewMenuForCurrentPage();
void updateStatusBarForCurrentPage();
void setRTLIcons(bool isRTL);
private:
Ui::MainWindow ui;

@ -245,33 +245,54 @@
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string>Used by Icon View</string>
</property>
<property name="text">
<string>Size of big icons:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="bigIconSize"/>
<widget class="QComboBox" name="bigIconSize">
<property name="toolTip">
<string>Used by Icon View</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="toolTip">
<string>Used by Compact View and Detailed List View</string>
</property>
<property name="text">
<string>Size of small icons:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="smallIconSize"/>
<widget class="QComboBox" name="smallIconSize">
<property name="toolTip">
<string>Used by Compact View and Detailed List View</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_8">
<property name="toolTip">
<string>Used by Thumbnail View</string>
</property>
<property name="text">
<string>Size of thumbnails:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="thumbnailIconSize"/>
<widget class="QComboBox" name="thumbnailIconSize">
<property name="toolTip">
<string>Used by Thumbnail View</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_9">
@ -440,6 +461,10 @@ A space is also reserved for 3 lines of text.</string>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="alwaysShowTabs">
<property name="toolTip">
<string>When unchecked, the tab bar will be shown
only if there are more than one tab.</string>
</property>
<property name="text">
<string>Always show the tab bar</string>
</property>
@ -644,6 +669,9 @@ above the folder-view and not above the left pane.</string>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="showThumbnails">
<property name="toolTip">
<string>Needs ffmpegthumbnailer</string>
</property>
<property name="text">
<string>Show thumbnails of files</string>
</property>

@ -187,7 +187,7 @@ void PreferencesDialog::initBehaviorPage(Settings& settings) {
ui.bookmarkOpenMethod->setCurrentIndex(settings.bookmarkOpenMethod());
ui.viewMode->addItem(tr("Icon View"), (int)Fm::FolderView::IconMode);
ui.viewMode->addItem(tr("Compact Icon View"), (int)Fm::FolderView::CompactMode);
ui.viewMode->addItem(tr("Compact View"), (int)Fm::FolderView::CompactMode);
ui.viewMode->addItem(tr("Thumbnail View"), (int)Fm::FolderView::ThumbnailMode);
ui.viewMode->addItem(tr("Detailed List View"), (int)Fm::FolderView::DetailedListMode);
const Fm::FolderView::ViewMode modes[] = {

@ -65,10 +65,12 @@ Settings::Settings():
desktopBgColor_(),
desktopFgColor_(),
desktopShadowColor_(),
desktopIconSize_(48),
showWmMenu_(false),
desktopShowHidden_(false),
desktopSortOrder_(Qt::AscendingOrder),
desktopSortColumn_(Fm::FolderModel::ColumnFileName),
desktopSortColumn_(Fm::FolderModel::ColumnFileMTime),
desktopSortFolderFirst_(true),
alwaysShowTabs_(true),
showTabClose_(true),
rememberWindowSize_(true),
@ -163,7 +165,7 @@ bool Settings::loadFile(QString filePath) {
if(fallbackIconThemeName_.isEmpty()) {
// FIXME: we should choose one from installed icon themes or get
// the value from XSETTINGS instead of hard code a fallback value.
fallbackIconThemeName_ = "elementary"; // fallback icon theme name
fallbackIconThemeName_ = "oxygen"; // fallback icon theme name
}
suCommand_ = settings.value("SuCommand", "lxqt-sudo %s").toString();
setTerminal(settings.value("Terminal", "xterm").toString());
@ -200,11 +202,13 @@ bool Settings::loadFile(QString filePath) {
desktopFont_.fromString(settings.value("Font").toString());
else
desktopFont_ = QApplication::font();
desktopIconSize_ = settings.value("DesktopIconSize", 48).toInt();
showWmMenu_ = settings.value("ShowWmMenu", false).toBool();
desktopShowHidden_ = settings.value("ShowHidden", false).toBool();
desktopSortOrder_ = sortOrderFromString(settings.value("SortOrder").toString());
desktopSortColumn_ = sortColumnFromString(settings.value("SortColumn").toString());
desktopSortFolderFirst_ = settings.value("SortFolderFirst", true).toBool();
desktopCellMargins_ = (settings.value("DesktopCellMargins", QSize(3, 1)).toSize()
.expandedTo(QSize(0, 0))).boundedTo(QSize(48, 48));
@ -310,10 +314,12 @@ bool Settings::saveFile(QString filePath) {
settings.setValue("FgColor", desktopFgColor_.name());
settings.setValue("ShadowColor", desktopShadowColor_.name());
settings.setValue("Font", desktopFont_.toString());
settings.setValue("DesktopIconSize", desktopIconSize_);
settings.setValue("ShowWmMenu", showWmMenu_);
settings.setValue("ShowHidden", desktopShowHidden_);
settings.setValue("SortOrder", sortOrderToString(desktopSortOrder_));
settings.setValue("SortColumn", sortColumnToString(desktopSortColumn_));
settings.setValue("SortFolderFirst", desktopSortFolderFirst_);
settings.setValue("DesktopCellMargins", desktopCellMargins_);
settings.endGroup();

@ -185,6 +185,14 @@ public:
desktopFont_ = font;
}
int desktopIconSize() const {
return desktopIconSize_;
}
void setDesktopIconSize(int desktopIconSize) {
desktopIconSize_ = desktopIconSize;
}
bool showWmMenu() const {
return showWmMenu_;
}
@ -217,6 +225,14 @@ public:
desktopSortColumn_ = desktopSortColumn;
}
bool desktopSortFolderFirst() const {
return desktopSortFolderFirst_;
}
void setSesktopSortFolderFirst(bool desktopFolderFirst) {
desktopSortFolderFirst_ = desktopFolderFirst;
}
bool alwaysShowTabs() const {
return alwaysShowTabs_;
}
@ -649,11 +665,13 @@ private:
QColor desktopFgColor_;
QColor desktopShadowColor_;
QFont desktopFont_;
int desktopIconSize_;
bool showWmMenu_;
bool desktopShowHidden_;
Qt::SortOrder desktopSortOrder_;
Fm::FolderModel::ColumnId desktopSortColumn_;
bool desktopSortFolderFirst_;
bool alwaysShowTabs_;
bool showTabClose_;

@ -69,8 +69,8 @@ void ProxyFilter::setVirtHidden(FmFolder* folder) {
TabPage::TabPage(FmPath* path, QWidget* parent):
QWidget(parent),
folder_(NULL),
folderModel_(NULL),
folder_(NULL),
overrideCursor_(false) {
Settings& settings = static_cast<Application*>(qApp)->settings();
@ -434,7 +434,7 @@ void TabPage::onSelChanged(int numSel) {
else {
goffset sum;
GList* l;
msg = tr("%1 item(s) selected", NULL, numSel).arg(numSel);
msg = tr("%n item(s) selected", nullptr, numSel).arg(numSel);
/* don't count if too many files are selected, that isn't lightweight */
if(numSel < 1000) {
sum = 0;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save