-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileExplorer.hpp
More file actions
152 lines (104 loc) · 3.17 KB
/
FileExplorer.hpp
File metadata and controls
152 lines (104 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#ifndef WAYROUND_I2P_20241223_224139_496973
#define WAYROUND_I2P_20241223_224139_496973
#include <iostream>
#include <gtkmm.h>
#include <sigc++/sigc++.h>
#include "ProjectMenu.hpp"
#include "FileExplorerTables.hpp"
#include "forward_declarations.hpp"
#include "utils.hpp"
#include <wayround_i2p/ccutils/signal/signal_sigc_compat.hpp>
namespace wayround_i2p::ccedit
{
class FileExplorer
{
public:
static FileExplorer_shared create(
ProjectCtl_shared project_ctl
);
~FileExplorer();
protected:
FileExplorer(
ProjectCtl_shared project_ctl
);
public:
void show();
void destroy();
Gtk::Window &getWindowRef();
Gtk::Window *getWindowPtr();
int touchFileOrMkDirRelToProject(
std::filesystem::path subpath,
bool file
);
int touchFileOrMkDirRelToCurrent(
std::filesystem::path subpath,
bool file
);
int touchFileOrMkDir(
std::filesystem::path subpath,
bool file,
bool rel_to_current
);
int dirTreeNavigateTo(std::filesystem::path subpath);
int fileListNavigateTo(std::filesystem::path subpath);
int fileListRefresh();
private:
FileExplorer_shared own_ptr;
RunOnce destroyer;
ProjectCtl_shared project_ctl;
ProjectMenuGenerator wmg;
Gtk::ApplicationWindow win;
Gtk::Box main_box;
Gtk::Box path_box;
Gtk::Box fb1;
Gtk::Button reset_view_btn;
Gtk::Button go_root_btn;
Gtk::Button refresh_btn;
// Gtk::Separator sep1;
Gtk::Box fb2;
Gtk::Button filelauncher_dir_btn;
Gtk::Button find_file_btn;
// Gtk::Separator sep2;
Gtk::Box fb3;
Gtk::Button make_file_or_directory_btn;
// Gtk::Button rename_file_or_directory_btn;
// Gtk::Button remove_file_or_directory_btn;
// Gtk::Separator sep3;
Gtk::MenuButton show_windows_btn;
Gtk::Entry path_entry;
Gtk::Paned lists_box;
Gtk::ScrolledWindow dir_tree_sw;
Gtk::ListView dir_tree_view;
Gtk::ScrolledWindow file_list_sw;
Gtk::GridView file_list_view;
// main functions
void setup_actions();
void setup_main_menu();
void setup_hotkeys();
void setupDirTreeView();
void setupFileListView();
void updateTitle();
int navigateToRoot();
std::tuple<Glib::RefPtr<Gio::ListModel>, int>
dirTreeGenDirListStore(std::filesystem::path subpath);
// signal handlers
wayround_i2p::ccutils::signal::SlotSigCCompat<void()> on_project_rename_slot;
void on_project_rename();
void on_dir_tree_view_activate(guint);
void on_file_list_view_activate(guint);
void on_reset_view_btn();
void on_go_root_btn();
void on_refresh_btn();
void on_filelauncher_dir_btn();
void on_find_file_btn();
void on_make_file_or_directory_btn();
// void on_rename_file_or_directory_btn();
void on_destroy_sig();
bool on_signal_close_request();
// todo: is it really have to be as class member?
Glib::RefPtr<Gtk::FileDialog> select_file_dialog;
// working variables
std::filesystem::path opened_subdir;
};
} // namespace wayround_i2p::ccedit
#endif