allow actions without need to select item with square first
This commit is contained in:
@@ -49,6 +49,7 @@ add_self(ezremote_client)
|
||||
add_pkg(ezremote_client ${CMAKE_SOURCE_DIR}/data "RMTC00001" "ezRemote Client" "01.01" 32 0)
|
||||
|
||||
target_link_libraries(ezremote_client
|
||||
dbglogger
|
||||
c
|
||||
c++
|
||||
png
|
||||
|
||||
+58
-11
@@ -246,7 +246,13 @@ namespace Actions
|
||||
|
||||
void *DeleteSelectedLocalFilesThread(void *argp)
|
||||
{
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_local_files.begin(); it != multi_selected_local_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_local_files.size() > 0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
FS::RmRecursive(it->path);
|
||||
}
|
||||
@@ -271,7 +277,13 @@ namespace Actions
|
||||
{
|
||||
if (remoteclient->Ping())
|
||||
{
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_remote_files.begin(); it != multi_selected_remote_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_remote_files.size() > 0)
|
||||
std::copy(multi_selected_remote_files.begin(), multi_selected_remote_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_remote_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (it->isDir)
|
||||
remoteclient->Rmdir(it->path, true);
|
||||
@@ -417,7 +429,13 @@ namespace Actions
|
||||
void *UploadFilesThread(void *argp)
|
||||
{
|
||||
file_transfering = true;
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_local_files.begin(); it != multi_selected_local_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_local_files.size()>0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (it->isDir)
|
||||
{
|
||||
@@ -432,7 +450,6 @@ namespace Actions
|
||||
}
|
||||
activity_inprogess = false;
|
||||
file_transfering = false;
|
||||
multi_selected_local_files.clear();
|
||||
Windows::SetModalMode(false);
|
||||
selected_action = ACTION_REFRESH_REMOTE_FILES;
|
||||
return NULL;
|
||||
@@ -560,7 +577,13 @@ namespace Actions
|
||||
void *DownloadFilesThread(void *argp)
|
||||
{
|
||||
file_transfering = true;
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_remote_files.begin(); it != multi_selected_remote_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_remote_files.size()>0)
|
||||
std::copy(multi_selected_remote_files.begin(), multi_selected_remote_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_remote_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (it->isDir)
|
||||
{
|
||||
@@ -602,7 +625,13 @@ namespace Actions
|
||||
int skipped = 0;
|
||||
|
||||
WebDAV::WebDavClient *client = (WebDAV::WebDavClient *)remoteclient;
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_remote_files.begin(); it != multi_selected_remote_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_remote_files.size()>0)
|
||||
std::copy(multi_selected_remote_files.begin(), multi_selected_remote_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_remote_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (stop_activity)
|
||||
break;
|
||||
@@ -667,7 +696,13 @@ namespace Actions
|
||||
int skipped = 0;
|
||||
int ret;
|
||||
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_local_files.begin(); it != multi_selected_local_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_local_files.size()>0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (stop_activity)
|
||||
break;
|
||||
@@ -739,7 +774,13 @@ namespace Actions
|
||||
void *ExtractZipThread(void *argp)
|
||||
{
|
||||
FS::MkDirs(extract_zip_folder, true);
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_local_files.begin(); it != multi_selected_local_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_local_files.size()>0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (stop_activity)
|
||||
break;
|
||||
@@ -778,7 +819,13 @@ namespace Actions
|
||||
zipFile zf = zipOpen64(zip_file_path, APPEND_STATUS_CREATE);
|
||||
if (zf != NULL)
|
||||
{
|
||||
for (std::set<DirEntry>::iterator it = multi_selected_local_files.begin(); it != multi_selected_local_files.end(); ++it)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_local_files.size()>0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end(); ++it)
|
||||
{
|
||||
if (stop_activity)
|
||||
break;
|
||||
@@ -786,7 +833,7 @@ namespace Actions
|
||||
if (res <= 0)
|
||||
{
|
||||
sprintf(status_message, "%s", lang_strings[STR_ERROR_CREATE_ZIP]);
|
||||
sceKernelUsleep(2000000);
|
||||
sceKernelUsleep(1000000);
|
||||
}
|
||||
}
|
||||
zipClose(zf, NULL);
|
||||
@@ -1103,7 +1150,7 @@ namespace Actions
|
||||
if (!client->Ping())
|
||||
{
|
||||
client->Quit();
|
||||
sprintf(status_message, lang_strings[STR_REMOTE_TERM_CONN_MSG]);
|
||||
sprintf(status_message, "%s", lang_strings[STR_REMOTE_TERM_CONN_MSG]);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -39,7 +39,10 @@ enum ACTIONS
|
||||
ACTION_INSTALL_LOCAL_PKG,
|
||||
ACTION_INSTALL_URL_PKG,
|
||||
ACTION_EXTRACT_LOCAL_ZIP,
|
||||
ACTION_CREATE_LOCAL_ZIP
|
||||
ACTION_CREATE_LOCAL_ZIP,
|
||||
ACTION_LOCAL_CUT,
|
||||
ACTION_LOCAL_COPY,
|
||||
ACTION_LOCAL_PASTE
|
||||
};
|
||||
|
||||
enum OverWriteType
|
||||
|
||||
@@ -28,6 +28,7 @@ struct DirEntry
|
||||
bool isDir;
|
||||
bool isLink;
|
||||
DateTime modified;
|
||||
bool selectable;
|
||||
|
||||
friend bool operator<(DirEntry const &a, DirEntry const &b)
|
||||
{
|
||||
|
||||
@@ -180,6 +180,7 @@ namespace FS
|
||||
sprintf(entry.path, "%s", path.c_str());
|
||||
entry.file_size = 0;
|
||||
entry.isDir = true;
|
||||
entry.selectable = false;
|
||||
out.push_back(entry);
|
||||
|
||||
DIR *fd = opendir(path.c_str());
|
||||
@@ -209,6 +210,7 @@ namespace FS
|
||||
|
||||
snprintf(entry.directory, 512, "%s", path.c_str());
|
||||
snprintf(entry.name, 256, "%s", dirent->d_name);
|
||||
entry.selectable = true;
|
||||
|
||||
if (hasEndSlash(path.c_str()))
|
||||
{
|
||||
|
||||
@@ -1592,6 +1592,7 @@ std::vector<DirEntry> FtpClient::ListDir(const std::string &path)
|
||||
sprintf(entry.display_size, "%s", lang_strings[STR_FOLDER]);
|
||||
entry.file_size = 0;
|
||||
entry.isDir = true;
|
||||
entry.selectable = false;
|
||||
out.push_back(entry);
|
||||
|
||||
ftphandle *nData;
|
||||
@@ -1608,6 +1609,7 @@ std::vector<DirEntry> FtpClient::ListDir(const std::string &path)
|
||||
{
|
||||
DirEntry entry;
|
||||
memset(&entry, 0, sizeof(entry));
|
||||
entry.selectable = true;
|
||||
if (ParseDirEntry(buf, &entry) > 0)
|
||||
{
|
||||
sprintf(entry.directory, "%s", path.c_str());
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
#include <orbis/Pad.h>
|
||||
#include <orbis/AudioOut.h>
|
||||
#include <orbis/Net.h>
|
||||
// #include <dbglogger.h>
|
||||
#include <dbglogger.h>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "SDL2/SDL.h"
|
||||
@@ -251,8 +251,8 @@ static void terminate()
|
||||
|
||||
int main()
|
||||
{
|
||||
// dbglogger_init();
|
||||
// dbglogger_log("If you see this you've set up dbglogger correctly.");
|
||||
dbglogger_init();
|
||||
dbglogger_log("If you see this you've set up dbglogger correctly.");
|
||||
int rc;
|
||||
// No buffering
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
@@ -398,6 +398,7 @@ std::vector<DirEntry> SmbClient::ListDir(const std::string &path)
|
||||
sprintf(entry.display_size, "%s", lang_strings[STR_FOLDER]);
|
||||
entry.file_size = 0;
|
||||
entry.isDir = true;
|
||||
entry.selectable = false;
|
||||
out.push_back(entry);
|
||||
|
||||
struct smb2dir *dir;
|
||||
@@ -416,6 +417,7 @@ std::vector<DirEntry> SmbClient::ListDir(const std::string &path)
|
||||
DirEntry entry;
|
||||
memset(&entry, 0, sizeof(entry));
|
||||
|
||||
entry.selectable = true;
|
||||
snprintf(entry.directory, 511, "%s", path.c_str());
|
||||
snprintf(entry.name, 255, "%s", ent->name);
|
||||
entry.file_size = ent->st.smb2_size;
|
||||
|
||||
@@ -256,6 +256,7 @@ namespace WebDAV
|
||||
sprintf(entry.display_size, "%s", lang_strings[STR_FOLDER]);
|
||||
entry.file_size = 0;
|
||||
entry.isDir = true;
|
||||
entry.selectable = false;
|
||||
out.push_back(entry);
|
||||
|
||||
WebDAV::dict_items_t files = client->list(path);
|
||||
@@ -263,6 +264,7 @@ namespace WebDAV
|
||||
{
|
||||
DirEntry entry;
|
||||
memset(&entry, 0, sizeof(entry));
|
||||
entry.selectable = true;
|
||||
sprintf(entry.directory, "%s", path.c_str());
|
||||
sprintf(entry.name, "%s", WebDAV::get(files[i], "name").c_str());
|
||||
|
||||
|
||||
+71
-49
@@ -164,26 +164,33 @@ namespace Windows
|
||||
{
|
||||
std::string zipfolder;
|
||||
std::string zipname;
|
||||
if (strncmp(multi_selected_local_files.begin()->directory, "/data", 5) != 0)
|
||||
std::vector<DirEntry> files;
|
||||
if (multi_selected_local_files.size()>0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
if (strncmp(files.begin()->directory, "/data", 5) != 0 &&
|
||||
strncmp(files.begin()->directory, "/mnt/usb", 8) != 0)
|
||||
{
|
||||
zipfolder = "/data";
|
||||
}
|
||||
else
|
||||
{
|
||||
zipfolder = multi_selected_local_files.begin()->directory;
|
||||
zipfolder = files.begin()->directory;
|
||||
}
|
||||
|
||||
if (multi_selected_local_files.size() == 1)
|
||||
if (files.size() == 1)
|
||||
{
|
||||
zipname = multi_selected_local_files.begin()->name;
|
||||
zipname = files.begin()->name;
|
||||
}
|
||||
else if (strcmp(multi_selected_local_files.begin()->directory, "/") == 0)
|
||||
else if (strcmp(files.begin()->directory, "/") == 0)
|
||||
{
|
||||
zipname = "new_zip";
|
||||
}
|
||||
else
|
||||
{
|
||||
zipname = std::string(multi_selected_local_files.begin()->directory);
|
||||
zipname = std::string(files.begin()->directory);
|
||||
zipname = zipname.substr(zipname.find_last_of("/")+1);
|
||||
}
|
||||
|
||||
@@ -203,21 +210,28 @@ namespace Windows
|
||||
std::string getExtractFolder()
|
||||
{
|
||||
std::string zipfolder;
|
||||
if (strncmp(multi_selected_local_files.begin()->directory, "/data", 5) != 0)
|
||||
std::vector<DirEntry> files;
|
||||
|
||||
if (multi_selected_local_files.size() > 0)
|
||||
std::copy(multi_selected_local_files.begin(), multi_selected_local_files.end(), std::back_inserter(files));
|
||||
else
|
||||
files.push_back(selected_local_file);
|
||||
|
||||
if (strncmp(files.begin()->directory, "/data", 5) != 0 &&
|
||||
strncmp(files.begin()->directory, "/mnt/usb", 8) != 0)
|
||||
{
|
||||
zipfolder = "/data";
|
||||
}
|
||||
else if (multi_selected_local_files.size() > 1)
|
||||
else if (files.size() > 1)
|
||||
{
|
||||
zipfolder = "/data";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string filename = std::string(multi_selected_local_files.begin()->name);
|
||||
std::string filename = std::string(files.begin()->name);
|
||||
size_t dot_pos = filename.find_last_of(".");
|
||||
zipfolder = std::string(local_directory) + "/" + filename.substr(0, dot_pos);
|
||||
}
|
||||
|
||||
return zipfolder;
|
||||
}
|
||||
|
||||
@@ -616,6 +630,10 @@ namespace Windows
|
||||
selected_action = ACTION_CHANGE_REMOTE_DIRECTORY;
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemFocused())
|
||||
{
|
||||
selected_remote_file = item;
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
if (ImGui::CalcTextSize(item.name).x > 740)
|
||||
@@ -626,10 +644,6 @@ namespace Windows
|
||||
}
|
||||
}
|
||||
ImGui::PopID();
|
||||
if (ImGui::IsItemFocused())
|
||||
{
|
||||
selected_remote_file = item;
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows))
|
||||
{
|
||||
if (strcmp(remote_file_to_select, item.name) == 0)
|
||||
@@ -678,6 +692,19 @@ namespace Windows
|
||||
EndGroupPanel();
|
||||
}
|
||||
|
||||
int getSelectableFlag()
|
||||
{
|
||||
int flag = ImGuiSelectableFlags_Disabled;
|
||||
bool local_browser_selected = saved_selected_browser & LOCAL_BROWSER;
|
||||
bool remote_browser_selected = saved_selected_browser & REMOTE_BROWSER;
|
||||
if ((local_browser_selected && selected_local_file.selectable) ||
|
||||
(remote_browser_selected && selected_remote_file.selectable))
|
||||
{
|
||||
flag = ImGuiSelectableFlags_None;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
void ShowActionsDialog()
|
||||
{
|
||||
ImGuiIO &io = ImGui::GetIO();
|
||||
@@ -737,12 +764,9 @@ namespace Windows
|
||||
ImGui::PopID();
|
||||
ImGui::Separator();
|
||||
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if ((local_browser_selected && multi_selected_local_files.size() > 0) ||
|
||||
(remote_browser_selected && multi_selected_remote_files.size() > 0 && remoteclient != nullptr))
|
||||
flags = ImGuiSelectableFlags_None;
|
||||
|
||||
ImGui::PushID("Delete##settings");
|
||||
if (ImGui::Selectable(lang_strings[STR_DELETE], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_DELETE], false, getSelectableFlag() | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
confirm_state = CONFIRM_WAIT;
|
||||
sprintf(confirm_message, "%s", lang_strings[STR_DEL_CONFIRM_MSG]);
|
||||
@@ -754,11 +778,11 @@ namespace Windows
|
||||
ImGui::PopID();
|
||||
ImGui::Separator();
|
||||
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if ((local_browser_selected && multi_selected_local_files.size() == 1) ||
|
||||
(remote_browser_selected && multi_selected_remote_files.size() == 1 && remoteclient != nullptr))
|
||||
flags = ImGuiSelectableFlags_None;
|
||||
ImGui::PushID("Rename##settings");
|
||||
flags = getSelectableFlag();
|
||||
if ((local_browser_selected && multi_selected_local_files.size()>1) ||
|
||||
(remote_browser_selected && multi_selected_remote_files.size()>1))
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if (ImGui::Selectable(lang_strings[STR_RENAME], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
if (local_browser_selected)
|
||||
@@ -771,11 +795,8 @@ namespace Windows
|
||||
ImGui::PopID();
|
||||
ImGui::Separator();
|
||||
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if (local_browser_selected || (remote_browser_selected && remoteclient != nullptr))
|
||||
flags = ImGuiSelectableFlags_None;
|
||||
ImGui::PushID("New Folder##settings");
|
||||
if (ImGui::Selectable(lang_strings[STR_NEW_FOLDER], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_NEW_FOLDER], false, ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
if (local_browser_selected)
|
||||
selected_action = ACTION_NEW_LOCAL_FOLDER;
|
||||
@@ -787,12 +808,10 @@ namespace Windows
|
||||
ImGui::PopID();
|
||||
ImGui::Separator();
|
||||
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if (local_browser_selected)
|
||||
{
|
||||
(multi_selected_local_files.size() > 0) ? flags = ImGuiSelectableFlags_None : flags = ImGuiSelectableFlags_Disabled;
|
||||
ImGui::PushID("Extract##settings");
|
||||
if (ImGui::Selectable(lang_strings[STR_EXTRACT], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_EXTRACT], false, getSelectableFlag() | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
ResetImeCallbacks();
|
||||
sprintf(extract_zip_folder, "%s", getExtractFolder().c_str());
|
||||
@@ -810,7 +829,7 @@ namespace Windows
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::PushID("Compress##settings");
|
||||
if (ImGui::Selectable(lang_strings[STR_COMPRESS], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_COMPRESS], false, getSelectableFlag() | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
std::string zipname;
|
||||
std::string zipfolder;
|
||||
@@ -831,7 +850,7 @@ namespace Windows
|
||||
ImGui::Separator();
|
||||
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if (multi_selected_local_files.size() > 0 && remoteclient != nullptr)
|
||||
if (remoteclient != nullptr && selected_local_file.selectable)
|
||||
{
|
||||
flags = ImGuiSelectableFlags_None;
|
||||
}
|
||||
@@ -848,9 +867,8 @@ namespace Windows
|
||||
ImGui::PopID();
|
||||
ImGui::Separator();
|
||||
|
||||
(multi_selected_local_files.size() > 0) ? flags = ImGuiSelectableFlags_None : flags = ImGuiSelectableFlags_Disabled;
|
||||
ImGui::PushID("Install##local");
|
||||
if (ImGui::Selectable(lang_strings[STR_INSTALL], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_INSTALL], false, getSelectableFlag() | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
SetModalMode(false);
|
||||
selected_action = ACTION_INSTALL_LOCAL_PKG;
|
||||
@@ -862,12 +880,8 @@ namespace Windows
|
||||
|
||||
if (remote_browser_selected)
|
||||
{
|
||||
if (multi_selected_remote_files.size() > 0 && remoteclient != nullptr)
|
||||
{
|
||||
flags = ImGuiSelectableFlags_None;
|
||||
}
|
||||
ImGui::PushID("Download##settings");
|
||||
if (ImGui::Selectable(lang_strings[STR_DOWNLOAD], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_DOWNLOAD], false, getSelectableFlag() | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
SetModalMode(false);
|
||||
selected_action = ACTION_DOWNLOAD;
|
||||
@@ -884,7 +898,7 @@ namespace Windows
|
||||
{
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
}
|
||||
if (ImGui::Selectable(lang_strings[STR_INSTALL], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_INSTALL], false, getSelectableFlag() | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
SetModalMode(false);
|
||||
selected_action = ACTION_INSTALL_REMOTE_PKG;
|
||||
@@ -903,11 +917,8 @@ namespace Windows
|
||||
ImGui::PopID();
|
||||
ImGui::Separator();
|
||||
|
||||
flags = ImGuiSelectableFlags_Disabled;
|
||||
if (local_browser_selected || remote_browser_selected)
|
||||
flags = ImGuiSelectableFlags_None;
|
||||
ImGui::PushID("Properties##settings");
|
||||
if (ImGui::Selectable(lang_strings[STR_PROPERTIES], false, flags | ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
if (ImGui::Selectable(lang_strings[STR_PROPERTIES], false, ImGuiSelectableFlags_DontClosePopups, ImVec2(220, 0)))
|
||||
{
|
||||
if (local_browser_selected)
|
||||
selected_action = ACTION_SHOW_LOCAL_PROPERTIES;
|
||||
@@ -917,7 +928,6 @@ namespace Windows
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::PopID();
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::PushID("Cancel##settings");
|
||||
@@ -1323,7 +1333,10 @@ namespace Windows
|
||||
case ACTION_RENAME_LOCAL:
|
||||
if (gui_mode != GUI_MODE_IME)
|
||||
{
|
||||
sprintf(editor_text, "%s", multi_selected_local_files.begin()->name);
|
||||
if (multi_selected_local_files.size()>0)
|
||||
sprintf(editor_text, "%s", multi_selected_local_files.begin()->name);
|
||||
else
|
||||
sprintf(editor_text, "%s", selected_local_file.name);
|
||||
ime_single_field = editor_text;
|
||||
ResetImeCallbacks();
|
||||
ime_field_size = 128;
|
||||
@@ -1337,7 +1350,10 @@ namespace Windows
|
||||
case ACTION_RENAME_REMOTE:
|
||||
if (gui_mode != GUI_MODE_IME)
|
||||
{
|
||||
sprintf(editor_text, "%s", multi_selected_remote_files.begin()->name);
|
||||
if (multi_selected_remote_files.size()>0)
|
||||
sprintf(editor_text, "%s", multi_selected_remote_files.begin()->name);
|
||||
else
|
||||
sprintf(editor_text, "%s", selected_remote_file.name);
|
||||
ime_single_field = editor_text;
|
||||
ResetImeCallbacks();
|
||||
ime_field_size = 128;
|
||||
@@ -1521,11 +1537,17 @@ namespace Windows
|
||||
}
|
||||
else if (selected_action == ACTION_RENAME_LOCAL)
|
||||
{
|
||||
Actions::RenameLocalFolder(multi_selected_local_files.begin()->path, editor_text);
|
||||
if (multi_selected_local_files.size()>0)
|
||||
Actions::RenameLocalFolder(multi_selected_local_files.begin()->path, editor_text);
|
||||
else
|
||||
Actions::RenameLocalFolder(selected_local_file.path, editor_text);
|
||||
}
|
||||
else if (selected_action == ACTION_RENAME_REMOTE)
|
||||
{
|
||||
Actions::RenameRemoteFolder(multi_selected_remote_files.begin()->path, editor_text);
|
||||
if (multi_selected_remote_files.size()>0)
|
||||
Actions::RenameRemoteFolder(multi_selected_remote_files.begin()->path, editor_text);
|
||||
else
|
||||
Actions::RenameRemoteFolder(selected_remote_file.path, editor_text);
|
||||
}
|
||||
selected_action = ACTION_NONE;
|
||||
}
|
||||
|
||||
@@ -294,6 +294,10 @@ namespace ZipUtil
|
||||
fclose(f);
|
||||
unzCloseCurrentFile(zipfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
FS::MkDirs(ext_fname, true);
|
||||
}
|
||||
if ((zip_idx + 1) < num_files)
|
||||
{
|
||||
unzGoToNextFile(zipfile);
|
||||
|
||||
Reference in New Issue
Block a user