Skip to content

Commit

Permalink
Support for UTF-8 characters inside the config-files.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Oct 3, 2022
1 parent f61861a commit d8e058e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
28 changes: 15 additions & 13 deletions bin/gtk-youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ my %CONFIG = (
# $appname $version - configuration file
use utf8;
EOD

# Save hash config to file
Expand Down Expand Up @@ -343,16 +345,16 @@ sub gcarray ($) {
my %objects = (

# Windows
'__MAIN__' => \my $mainw,
'users_list_window' => \my $users_list_window,
'help_window' => \my $help_window,
'prefernces_window' => \my $prefernces_window,
'errors_window' => \my $errors_window,
'login_to_youtube' => \my $login_to_youtube,
'details_window' => \my $details_window,
'aboutdialog1' => \my $about_window,
'feeds_window' => \my $feeds_window,
'warnings_window' => \my $warnings_window,
'__MAIN__' => \my $mainw,
'users_list_window' => \my $users_list_window,
'help_window' => \my $help_window,
'preferences_window' => \my $preferences_window,
'errors_window' => \my $errors_window,
'login_to_youtube' => \my $login_to_youtube,
'details_window' => \my $details_window,
'aboutdialog1' => \my $about_window,
'feeds_window' => \my $feeds_window,
'warnings_window' => \my $warnings_window,

# Others
'treeview1' => \my $users_treeview,
Expand Down Expand Up @@ -1662,7 +1664,7 @@ $feeds_window->add_accel_group($accel);
$accel = Gtk3::AccelGroup->new;
$accel->connect(0xff1b, ['lock-mask'], ['visible'], \&hide_preferences_window);
$accel->connect(ord('s'), ['control-mask'], ['visible'], \&save_configuration);
$prefernces_window->add_accel_group($accel);
$preferences_window->add_accel_group($accel);

$accel = Gtk3::AccelGroup->new;
$accel->connect(0xff1b, ['lock-mask'], ['visible'], \&hide_help_window);
Expand Down Expand Up @@ -1863,12 +1865,12 @@ sub show_preferences_window {
$config_view->set_buffer($config_view_buffer);
state $font = Pango::FontDescription::from_string('Monospace 8');
$config_view->modify_font($font);
$prefernces_window->show;
$preferences_window->show;
return 1;
}

sub hide_preferences_window {
$prefernces_window->hide;
$preferences_window->hide;
return 1;
}

Expand Down
2 changes: 2 additions & 0 deletions bin/youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ STDIN_HELP
# $appname $version - configuration file
use utf8;
EOD

sub dump_configuration {
Expand Down
4 changes: 2 additions & 2 deletions share/gtk3-youtube-viewer.glade
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0
<!-- Generated with glade 3.40.0
Copyright (C) Copyright © 2010-2022 Trizen
Expand Down Expand Up @@ -3250,7 +3250,7 @@ and others... https://github.com/trizen/youtube-viewer/graphs/contributors</prop
<action-widget response="0">button4</action-widget>
</action-widgets>
</object>
<object class="GtkWindow" id="prefernces_window">
<object class="GtkWindow" id="preferences_window">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Preferences</property>
<property name="window-position">center-on-parent</property>
Expand Down
2 changes: 1 addition & 1 deletion utils/auto_perltidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
alias perltidy='perltidy -utf8 -l=127 -f -kbl=1 -bbb -bbc -bbs -b -ple -bt=2 -pt=2 -sbt=2 -bvt=0 -sbvt=1 -cti=1 -bar -lp -anl';
which perltidy;
cd ..;
for i in $(git status | grep '^[[:cntrl:]]*modified:' | egrep 'bin/|\.(pm|t)$' | perl -nE 'say +(split)[-1]'); do echo $i; perltidy -b $i; done
for i in $(git status | grep '^[[:cntrl:]]*modified:' | grep -E 'bin/|\.(pm|t)$' | perl -nE 'say +(split)[-1]'); do echo $i; perltidy -b $i; done
2 changes: 1 addition & 1 deletion utils/bak_cleaner.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

for i in $(git status | grep \.bak$ | perl -nE 'say +(split)[-1]'); do echo $i; rm $i; done
for i in $(git status | grep '\.bak$' | perl -nE 'say +(split)[-1]'); do echo $i; rm $i; done

0 comments on commit d8e058e

Please sign in to comment.