-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save current document settings as default settings #9643
Conversation
@@ -305,6 +328,48 @@ dbg:guard(ReaderMenu, 'setUpdateItemTable', | |||
end | |||
end) | |||
|
|||
function ReaderMenu:saveDocumentSettingsAsDefault() | |||
if self.ui.rolling then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a way to pull those from the doc's configurable instance automatically? (with a "blacklist" like the reset option does, if necessary).
(This would mean less maintenance burden in case they ever change, and would handle the kopt/cre swap automagically).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll think of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This big listing of saveSetting does not really have place in a ReaderMenu.
I would put it in a new module that you would just use here - with resetDocumentSettings() which also has quite nothing to do with FilemanagerUtil :)
require("apps/filemanager/filemanagerutil").resetDocumentSettings(current_file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This big listing of saveSetting does not really have place in a ReaderMenu.
It is rather short now, maybe keep it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you prefer.
Still, resetDocumentSettings() which is only used in ReaderMenu may probably be moved where the new saveDocumentSettingsAsDefault() is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resetDocumentSettings()
is near purgeSettings()
, they have similar structures and goals.
I agree that ReaderMenu should be just a frame but cannot find better place for these "doc settings" functions.
Just for reference: CRE {
b_page_margin = 5,
block_rendering_mode = 3,
cjk_width_scaling = 100,
embedded_css = 1,
embedded_fonts = 1,
font_base_weight = 0,
font_gamma = 26,
font_hinting = 0,
font_kerning = 3,
font_size = 23,
h_page_margins = {
30,
30,
},
line_spacing = 130,
nightmode_images = 1,
render_dpi = 96,
rotation_mode = 0,
smooth_scaling = 0,
status_line = 1,
sync_t_b_page_margins = 0,
t_page_margin = 10,
view_mode = 0,
visible_pages = 1,
word_expansion = 0,
word_spacing = {
75,
50,
},
}
{
auto_straighten = 0,
contrast = 1,
defect_size = 1,
detect_indent = 1,
doc_language = "eng",
font_fine_tune = 0.050000000000000003,
font_size = 1,
forced_ocr = 0,
full_screen = 1,
hw_dithering = 0,
justification = 3,
line_spacing = 1.2,
max_columns = 3,
page_gap_height = 8,
page_margin = 0.10000000000000001,
page_opt = 0,
page_scroll = 0,
quality = 1,
rotation_mode = 0,
sw_dithering = 0,
text_wrap = 0,
trim_page = 1,
word_spacing = -0.20000000000000001,
writing_direction = 0,
zoom_direction = 7,
zoom_factor = 1.5,
zoom_mode_genus = 4,
zoom_mode_type = 1,
zoom_overlap_h = 36,
zoom_overlap_v = 36,
zoom_range_number = 2,
}
|
One of the most frequent questions asked by the new users is why my current settings are not applied to all books.
After they understand why, they must go through all the settings once more. This will help.
This change is