Skip to content

Commit

Permalink
Added support for Big, Temporary and empty file finder in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Oct 1, 2020
1 parent d3bea0d commit d7529cb
Show file tree
Hide file tree
Showing 6 changed files with 678 additions and 40 deletions.
4 changes: 4 additions & 0 deletions czkawka_core/src/big_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ impl BigFile {
self.debug_print();
}

pub fn get_big_files(&self) -> &BTreeMap<u64, Vec<FileEntry>> {
&self.big_files
}

pub fn get_text_messages(&self) -> &Messages {
&self.text_messages
}
Expand Down
4 changes: 4 additions & 0 deletions czkawka_core/src/empty_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ impl EmptyFiles {
self.debug_print();
}

pub fn get_empty_files(&self) -> &Vec<FileEntry> {
&self.empty_files
}

pub fn get_text_messages(&self) -> &Messages {
&self.text_messages
}
Expand Down
5 changes: 4 additions & 1 deletion czkawka_core/src/temporary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ impl Temporary {
self.debug_print();
}

pub fn get_temporary_files(&self) -> &Vec<FileEntry> {
&self.temporary_files
}
pub fn get_text_messages(&self) -> &Messages {
&self.text_messages
}
Expand Down Expand Up @@ -189,7 +192,7 @@ impl Temporary {
let mut is_temporary_file: bool = false;

// Temporary files which needs to have dot in name(not sure if exists without dot)
let temporary_with_dot = ["#", "thumbs.db", ".bak", "~"];
let temporary_with_dot = ["#", "thumbs.db", ".bak", "~", ".tmp", ".temp", ".ds_store", ".crdownload", ".part", ".cache", ".dmp", ".download"];

if file_name_lowercase.contains('.') {
for temp in temporary_with_dot.iter() {
Expand Down
127 changes: 125 additions & 2 deletions czkawka_gui/czkawka.glade
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ Author: Rafał Mikrut
</object>
<object class="GtkWindow" id="main_window">
<property name="can_focus">False</property>
<property name="default_width">800</property>
<property name="default_height">600</property>
<property name="default_width">1000</property>
<property name="default_height">700</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
Expand Down Expand Up @@ -836,6 +836,129 @@ Author: Rafał Mikrut
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="notebook_big_file_finder">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Number of showed files</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry_big_files_number">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">15</property>
<property name="text" translatable="yes">50</property>
<property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window_big_files_finder">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Big Files</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window_empty_files_finder">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Empty Files</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window_temporary_files_finder">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Temporary Files</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
Expand Down
Loading

0 comments on commit d7529cb

Please sign in to comment.