mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
integrate ZUpdater & refactor device management and UI components
- Integrated ZUpdater to handle auto updating - Updated DeviceManagerWidget to improve device selection logic and ensure current device is set correctly when devices are added or removed. - Enhanced FileExplorerWidget to reset the view when sidebar items are clicked. - Changed ZIconWidget to inherit from QAbstractButton for better button behavior and removed unnecessary mouse event handling. - Updated iDescriptor to include device version parsing and improved device version retrieval logic. - Refactored iFuseDiskUnmountButton and iFuseDiskUnmountButton to use ZIconWidget for a consistent UI. - Improved iFuseWidget to handle device selection more robustly and update UI accordingly. - Added SponsorAppCard and SponsorWidget to promote sponsorship within the app. - Updated ToolboxWidget to streamline device selection and toolbox functionality. - General code cleanup and comments for better maintainability.
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#define DEFAULT_DEVDISKIMGPATH "./devdiskimages"
|
||||
|
||||
SettingsManager *SettingsManager::sharedInstance()
|
||||
{
|
||||
static SettingsManager instance;
|
||||
@@ -46,13 +44,13 @@ QString SettingsManager::devdiskimgpath() const
|
||||
QString SettingsManager::downloadPath() const
|
||||
{
|
||||
return m_settings
|
||||
->value("downloadPath", SettingsManager::docsPath() + "/devdiskimages")
|
||||
->value("downloadPath", SettingsManager::homePath() + "/devdiskimages")
|
||||
.toString();
|
||||
}
|
||||
|
||||
QString SettingsManager::docsPath()
|
||||
QString SettingsManager::homePath()
|
||||
{
|
||||
return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) +
|
||||
return QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +
|
||||
"/.idescriptor";
|
||||
}
|
||||
|
||||
@@ -154,6 +152,7 @@ void SettingsManager::doIfEnabled(Setting setting, std::function<void()> action)
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "enabled" << switchToNewDevice();
|
||||
if (shouldExecute && action) {
|
||||
action();
|
||||
}
|
||||
@@ -161,12 +160,12 @@ void SettingsManager::doIfEnabled(Setting setting, std::function<void()> action)
|
||||
|
||||
void SettingsManager::resetToDefaults()
|
||||
{
|
||||
setDownloadPath(DEFAULT_DEVDISKIMGPATH);
|
||||
setDownloadPath(SettingsManager::homePath() + "/devdiskimages");
|
||||
setAutoCheckUpdates(true);
|
||||
setAutoRaiseWindow(true);
|
||||
setSwitchToNewDevice(true);
|
||||
#ifndef __APPLE__
|
||||
setUnmountiFuseOnExit(true);
|
||||
setUnmountiFuseOnExit(false);
|
||||
#endif
|
||||
setTheme("System Default");
|
||||
setConnectionTimeout(30);
|
||||
|
||||
Reference in New Issue
Block a user