Commit 4b0e2294 authored by Ercan Ersoy's avatar Ercan Ersoy

Some updates

Update FDOSTUI revision 30 to revision 31. Add feature is opening
selected. Thanks Mark Olesen.
again item on directories and files listbox.
the commit message for your changes. Lines starting
parent b3268af2
......@@ -101,6 +101,10 @@ public:
set_signal_selected(
signal_selected_t i_signal);
void
set_emit_selected_signal_always(
bool const i_emit_always);
void
set_selected(
size_t const i_slot,
......@@ -111,6 +115,7 @@ public:
protected:
bool m_emit_selected_always;
bool m_multiline;
size_t m_line;
struct array m_array;
......@@ -151,6 +156,16 @@ public:
};
inline void
listbox::set_emit_selected_signal_always(
bool const i_emit_always)
{
m_emit_selected_always= i_emit_always;
return;
}
inline size_t
listbox::get_count() const
{
......
......@@ -43,6 +43,7 @@ listbox::listbox(
unsigned int const i_len_x,
unsigned int const i_len_y) :
widget(i_pos_x, i_pos_y, i_len_x, i_len_y),
m_emit_selected_always(false),
m_multiline(false),
m_line(0),
m_array(),
......@@ -230,7 +231,7 @@ listbox::select(
set_damage(DAMAGE_VALUE);
wm_draw_widget(this);
if (l_value != (*l_item).m_selected)
if ((l_value != (*l_item).m_selected) || m_emit_selected_always)
{
emit_selected();
}
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -88,6 +88,9 @@ void directory_view(menuitem *, void *)
closedir(directory);
// Set selected item variable
selected_item = 0;
// Clear the drivers listbox
drivers->remove_all();
......@@ -150,6 +153,25 @@ void upper_directory_control(void)
}
}
// Select directory or file function
void select_directory_or_file(listbox const *, void *)
{
if(selected_item == directories_and_files->get_selected_first()) // If selected item is clicked
{
// Open item
item_open(NULL, NULL);
// Refresh directory
directory_view(NULL, NULL);
// Exit function
return;
}
// Set selected item
selected_item = directories_and_files->get_selected_first();
}
// Change current drive function
void change_current_drive(listbox const *, void *)
{
......@@ -737,6 +759,10 @@ int main(void)
// Set menu of drivers
drivers->set_signal_selected(change_current_drive);
// Set menu of directories and files
directories_and_files->set_signal_selected(select_directory_or_file);
directories_and_files->set_emit_selected_signal_always(true);
// Set menu of file manager
file_manager_menus->set_menu(menus_of_file_manager);
......
......@@ -21,6 +21,8 @@
// Current directory string pointer variable
char *current_directory = (char *)malloc(MAX_PATH_LENGTH + 1);
// Selected directory or file
int selected_item = 0;
// Show hidden file variable
bool show_hidden_file = false;
// Clipboard item name string pointer variable
......@@ -66,6 +68,8 @@ void copy_file(char *, char *);
void directory_view(menuitem *, void *);
// Upper directory control function
void upper_directory_control(void);
// Select directory or file function
void select_directory_or_file(listbox const *, void *);
// Change current directory function
void change_current_directory(char *, unsigned char);
// Change current drive function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment