Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added option "stop_timer_on_fs".

If this is set to 1, a running timer is stopped when you exit fullscreen
mode.
  • Loading branch information...
commit 7cd6a19001df36f4e7f43695560bbf5cc1464d41 1 parent 3665864
@vain authored
Showing with 44 additions and 9 deletions.
  1. +16 −9 README
  2. +7 −0 man1/pdfpres.1
  3. +4 −0 pdfpres.c
  4. +16 −0 prefs.c
  5. +1 −0  prefs.h
View
25 README
@@ -130,6 +130,7 @@ CONFIGURATION
<font_timer v="Sans 35"/>
<q_exits_fullscreen v="0"/>
<timer_is_clock v="0"/>
+ <stop_timer_on_fs v="0"/>
</config>
For now, you're supposed to directly edit this file except for
@@ -176,8 +177,14 @@ CONFIGURATION
current real time. This can be done by setting this
option to 1.
+ stop_timer_on_fs
+ By default (0), a running timer keeps running if you
+ exit fullscreen mode. On some setups, however, it may be
+ required for the timer to stop when fullscreen mode is
+ being left. To do so, set this option to 1.
+
OLD FORMAT FOR SLIDE NOTES
- If you already used an old version of pdfpres that didn't save
+ If you already used an old version of pdfpres that didn't save
the notes in XML, you can use the converter script to transform
those notes into XML:
@@ -185,9 +192,9 @@ OLD FORMAT FOR SLIDE NOTES
The resulting file notes.xml can be read in pdfpres.
- Be aware that this script expects a file encoded with UTF-8.
- Use the editor of your choice or recode to transform any non-
- UTF-8 files (you may adjust the input encoding) before you run
+ Be aware that this script expects a file encoded with UTF-8.
+ Use the editor of your choice or recode to transform any non-
+ UTF-8 files (you may adjust the input encoding) before you run
the converter:
$ recode LATIN1..UTF8 < notes.txt > notes-utf8.txt
@@ -197,7 +204,7 @@ FILES
Local per user configuration.
DEPENDENCIES AND BUILDING
- If you need to manually compile pdfpres, the following
+ If you need to manually compile pdfpres, the following
libraries and tools must be installed:
· make
@@ -209,7 +216,7 @@ DEPENDENCIES AND BUILDING
· poppler and poppler-glib (http://poppler.freedesktop.org/),
minimum tested version: 0.12.4.
- · libxml2 (http://www.xmlsoft.org/), minimum tested version:
+ · libxml2 (http://www.xmlsoft.org/), minimum tested version:
2.7.6.
Once those are installed, you can build pdfpres as follows:
@@ -219,15 +226,15 @@ DEPENDENCIES AND BUILDING
BUGS
Currently, no bugs are known. If you find one, we invite you to
- report it at the GitHub Issue tracker
+ report it at the GitHub Issue tracker
(http://github.com/vain/pdfpres/issues).
LICENSE
- pdfpres is released as “GPL3+”. See the accompanying LICENSE
+ pdfpres is released as “GPL3+”. See the accompanying LICENSE
file.
AUTHORS
- pdfpres was initially written by Peter Hofmann. Since then,
+ pdfpres was initially written by Peter Hofmann. Since then,
several people contributed code. Git tells you all the names:
$ git shortlog -sn
View
7 man1/pdfpres.1
@@ -132,6 +132,7 @@ like this:
<font_timer v="Sans 35"/>
<q_exits_fullscreen v="0"/>
<timer_is_clock v="0"/>
+ <stop_timer_on_fs v="0"/>
</config>
.fi
.ft
@@ -179,6 +180,12 @@ you're currently editing slide notes).
By default (\fI0\fP), a timer is shown. You can start it or stop it.
However, it's sometimes more useful to see the current real time. This
can be done by setting this option to \fI1\fP.
+.TP
+.B stop_timer_on_fs
+By default (\fI0\fP), a running timer keeps running if you exit
+fullscreen mode. On some setups, however, it may be required for the
+timer to stop when fullscreen mode is being left. To do so, set this
+option to \fI1\fP.
.SH "OLD FORMAT FOR SLIDE NOTES"
If you already used an old version of \fBpdfpres\fP that didn't save the
notes in XML, you can use the converter script to transform those notes
View
4 pdfpres.c
@@ -1244,6 +1244,10 @@ static gboolean onKeyPressed(GtkWidget *widget, GdkEventKey *ev,
if (prefs.q_exits_fullscreen && isFullScreen)
{
toggleFullScreen();
+ if (prefs.stop_timer_on_fs)
+ {
+ toggleTimer();
+ }
}
else
{
View
16 prefs.c
@@ -49,6 +49,7 @@ void loadPreferences(void)
prefs.font_timer = g_strdup("Sans 35");
prefs.q_exits_fullscreen = 0;
prefs.timer_is_clock = 0;
+ prefs.stop_timer_on_fs = 0;
/* We're using g_strdup() here so we can use g_free() all the time.
*/
@@ -188,6 +189,17 @@ void loadPreferences(void)
prefs.timer_is_clock = (tmp_i == 1 ? TRUE : FALSE);
xmlFree(tmp);
}
+
+ if (cur_node->type == XML_ELEMENT_NODE
+ && !xmlStrcmp(cur_node->name, BAD_CAST "stop_timer_on_fs")
+ && (tmp = xmlGetProp(cur_node, BAD_CAST "v")) != NULL)
+ {
+ /* When in fullscreen, does Q/Esc quit the program (0) or
+ * does it exit fullscreen mode (1)? */
+ tmp_i = atoi((char *)tmp);
+ prefs.stop_timer_on_fs = (tmp_i == 1 ? TRUE : FALSE);
+ xmlFree(tmp);
+ }
}
xmlFreeDoc(doc);
@@ -372,6 +384,10 @@ void savePreferences(void)
prefs.q_exits_fullscreen))
return;
+ if (!writeElementBoolean(writer, "stop_timer_on_fs",
+ prefs.stop_timer_on_fs))
+ return;
+
if (!writeElementBoolean(writer, "timer_is_clock", prefs.timer_is_clock))
return;
View
1  prefs.h
@@ -38,6 +38,7 @@ struct _prefs
char *font_timer;
gboolean q_exits_fullscreen;
gboolean timer_is_clock;
+ gboolean stop_timer_on_fs;
};
extern struct _prefs prefs;
Please sign in to comment.
Something went wrong with that request. Please try again.