Merge pull request #369 from andreasb242/audio-folder-setting

Add audio folder to settings
presentation
andreasb242 7 years ago committed by GitHub
commit 2dec77095f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      src/control/settings/Settings.cpp
  2. 8
      src/control/settings/Settings.h
  3. 9
      src/gui/dialog/SettingsDialog.cpp
  4. 56
      ui/pixmaps/object-play.svg
  5. 18
      ui/pixmaps/object-select.svg
  6. 78
      ui/settings.glade

@ -344,6 +344,10 @@ void Settings::parseItem(xmlDocPtr doc, xmlNodePtr cur)
{
this->sizeUnit = (const char*) value;
}
else if (xmlStrcmp(name, (const xmlChar*) "audioFolder") == 0)
{
this->audioFolder = (const char*) value;
}
else if (xmlStrcmp(name, (const xmlChar*) "autosaveEnabled") == 0)
{
this->autosaveEnabled = xmlStrcmp(value, (const xmlChar*) "true") ? false : true;
@ -735,6 +739,8 @@ void Settings::save()
WRITE_STRING_PROP(sizeUnit);
WRITE_STRING_PROP(audioFolder);
xmlNodePtr xmlFont;
xmlFont = xmlNewChild(root, NULL, (const xmlChar*) "property", NULL);
xmlSetProp(xmlFont, (const xmlChar*) "name", (const xmlChar*) "font");
@ -1095,6 +1101,27 @@ void Settings::setPageTemplate(string pageTemplate)
save();
}
string Settings::getAudioFolder()
{
XOJ_CHECK_TYPE(Settings);
return this->audioFolder;
}
void Settings::setAudioFolder(string audioFolder)
{
XOJ_CHECK_TYPE(Settings);
if (this->audioFolder == audioFolder)
{
return;
}
this->audioFolder = audioFolder;
save();
}
string Settings::getSizeUnit()
{
XOJ_CHECK_TYPE(Settings);

@ -265,6 +265,9 @@ public:
string getPageTemplate();
void setPageTemplate(string pageTemplate);
string getAudioFolder();
void setAudioFolder(string audioFolder);
/**
* Get name, e.g. "cm"
*/
@ -503,6 +506,11 @@ private:
*/
string sizeUnit;
/**
* Audio folder for audio recording
*/
string audioFolder;
/**
* "Transaction" running, do not save until the end is reached
*/

@ -156,6 +156,8 @@ void SettingsDialog::load()
string txt = settings->getDefaultSaveName();
gtk_entry_set_text(GTK_ENTRY(txtDefaultSaveName), txt.c_str());
gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(get("fcAudioPath")), settings->getAudioFolder().c_str());
GtkWidget* spAutosaveTimeout = get("spAutosaveTimeout");
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spAutosaveTimeout), settings->getAutosaveTimeout());
@ -325,9 +327,10 @@ void SettingsDialog::save()
updateHideString(settings->getPresentationHideElements(), hidePresentationMenubar,
hidePresentationSidebar));
GtkWidget* txtDefaultSaveName = get("txtDefaultSaveName");
const char* txt = gtk_entry_get_text(GTK_ENTRY(txtDefaultSaveName));
settings->setDefaultSaveName(txt);
settings->setDefaultSaveName(gtk_entry_get_text(GTK_ENTRY(get("txtDefaultSaveName"))));
char* uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(get("fcAudioPath")));
settings->setAudioFolder(uri);
g_free(uri);
GtkWidget* spAutosaveTimeout = get("spAutosaveTimeout");
int autosaveTimeout = gtk_spin_button_get_value(GTK_SPIN_BUTTON(spAutosaveTimeout));

@ -56,7 +56,7 @@
y2="43.877998"
gradientUnits="userSpaceOnUse"
x2="18.037001"
gradientTransform="matrix(0.39361236,0,0,0.33555353,-8.5232687,-0.07301647)"
gradientTransform="matrix(0.61021244,0,0,0.51936283,-21.290976,-16.216856)"
y1="14.511"
x1="18.037001">
<stop
@ -73,7 +73,7 @@
y2="46.874001"
gradientUnits="userSpaceOnUse"
x2="13.759"
gradientTransform="matrix(0.32746028,0,0,0.30564924,-6.5282927,0.56558402)"
gradientTransform="matrix(0.50765768,0,0,0.47307759,-18.198189,-15.228443)"
y1="14.66"
x1="34.403999">
<stop
@ -85,6 +85,40 @@
style="stop-color:#fff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient2395-3-3"
y2="43.877998"
gradientUnits="userSpaceOnUse"
x2="18.037001"
gradientTransform="matrix(0.61021244,0,0,0.51936283,-21.273636,-8.4108414)"
y1="14.511"
x1="18.037001">
<stop
id="stop2266-6-6"
style="stop-color:#d7e866"
offset="0" />
<stop
id="stop2268-7-7"
style="stop-color:#8cab2a"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient2392-5-5"
y2="46.874001"
gradientUnits="userSpaceOnUse"
x2="13.759"
gradientTransform="matrix(0.50765768,0,0,0.47307759,-18.180849,-7.4224284)"
y1="14.66"
x1="34.403999">
<stop
id="stop4224-3-3"
style="stop-color:#fff"
offset="0" />
<stop
id="stop4226-5-5"
style="stop-color:#fff;stop-opacity:0"
offset="1" />
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
@ -99,9 +133,9 @@
inkscape:window-height="1176"
id="namedview10"
showgrid="false"
inkscape:zoom="17.029949"
inkscape:cx="-11.540479"
inkscape:cy="19.836343"
inkscape:zoom="8.689598"
inkscape:cx="-25.721503"
inkscape:cy="12.605803"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
@ -119,22 +153,22 @@ Created by potrace 1.11, written by Peter Selinger 2001-2013
</rdf:RDF>
</metadata>
<path
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.95999992;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 5.6268567,5.618964 c 2.322406,2.300538 4.220023,4.1918474 4.220023,4.2029074 0,0.01108 -0.936621,0.106922 -2.078674,0.2175176 -1.145535,0.106921 -2.116976,0.20646 -2.155277,0.21752 -0.07312,0.02581 -0.0035,0.191712 1.155981,2.883048 0.678963,1.570558 1.236064,2.879358 1.243027,2.908853 0.007,0.05531 -1.577287,0.822148 -1.61907,0.781593 -0.01393,-0.01108 -0.553616,-1.330921 -1.204726,-2.927286 -0.651109,-1.596368 -1.190798,-2.908855 -1.204726,-2.912543 -0.01044,-0.0037 -0.703337,0.670991 -1.5424668,1.5042 -0.835648,0.82952 -1.532022,1.518944 -1.549431,1.522631 -0.01393,0.0074 -0.02785,-2.942035 -0.02785,-6.555061 l 0,-6.569807 0.271585,0.269133 c 0.149721,0.151158 2.1726858,2.156755 4.4916088,4.457294 z"
id="path8"
style="line-height:normal;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-transform:none;block-progression:tb;overflow:visible;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.62420827;stroke-opacity:1;enable-background:accumulate"
d="m 0.69426686,0.37716024 a 0.3578125,0.3578125 0 0 0 -0.3578125,0.3578125 0.3578125,0.3578125 0 0 0 0.00156,0.03125 0.39961847,0.39961847 0 0 0 0,0.00156 0.39961847,0.39961847 0 0 0 -0.00156,0.010937 0.39961847,0.39961847 0 0 0 0,0.035938 0.39961847,0.39961847 0 0 0 0,0.014062 0.39961847,0.39961847 0 0 0 0,0.0125 0.39961847,0.39961847 0 0 0 0,0.0625 l 0,13.12187426 a 0.39961847,0.39961847 0 0 0 0.67499984,0.289063 l 2.8953123,-2.721875 2.3359378,5.393748 a 0.39961847,0.39961847 0 0 0 0.5375005,0.198439 l 1.746874,-0.798439 a 0.39961847,0.39961847 0 0 0 0.2,-0.523436 l -2.4343745,-5.320312 4.0703117,-0.35 a 0.39961847,0.39961847 0 0 0 0.2375,-0.6984376 L 1.0739542,0.61622274 a 0.39961847,0.39961847 0 0 0 -0.0625,-0.0625 0.39961847,0.39961847 0 0 0 -0.026562,-0.028125 0.3578125,0.3578125 0 0 0 -0.00156,0 0.3578125,0.3578125 0 0 0 -0.28906537,-0.1484376 z"
id="path4"
inkscape:connector-curvature="0" />
<g
transform="matrix(0.85814372,0,0,0.9130466,4.8084293,-0.81421252)"
transform="matrix(0.55353833,0,0,0.58990746,9.2700106,4.0807403)"
id="layer1">
<path
inkscape:connector-curvature="0"
id="path3375"
style="fill:url(#linearGradient2395-3);fill-rule:evenodd;stroke:#548820;stroke-linecap:round;stroke-linejoin:round"
style="fill:url(#linearGradient2395-3-3);fill-rule:evenodd;stroke:#548820;stroke-linecap:round;stroke-linejoin:round"
d="m 1.5,14.5 0,-13 13,6.5 -13,6.5 z" />
<path
inkscape:connector-curvature="0"
id="path2294"
style="opacity:0.41000001;fill:none;stroke:url(#linearGradient2392-5);stroke-linecap:round"
style="opacity:0.41000001;fill:none;stroke:url(#linearGradient2392-5-5);stroke-linecap:round"
d="M 2.5,12.878 2.5,3.1 12.341,8 2.5,12.878 Z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

@ -13,7 +13,7 @@
viewBox="0 0 17.6 17.6"
preserveAspectRatio="xMidYMid meet"
id="svg2"
inkscape:version="0.48.4 r9939"
inkscape:version="0.91 r13725"
sodipodi:docname="object-select.svg">
<defs
id="defs12" />
@ -26,13 +26,13 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="1000"
inkscape:window-width="1920"
inkscape:window-height="1176"
id="namedview10"
showgrid="false"
inkscape:zoom="16.68772"
inkscape:cx="-8.8740851"
inkscape:cy="9.1658497"
inkscape:zoom="11.313709"
inkscape:cx="4.109418"
inkscape:cy="10.757146"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
@ -50,8 +50,8 @@ Created by potrace 1.11, written by Peter Selinger 2001-2013
</rdf:RDF>
</metadata>
<path
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 10.026834,5.6726307 c 2.322406,2.3005385 4.220023,4.1918468 4.220023,4.2029074 0,0.011079 -0.936621,0.106921 -2.078674,0.2175169 -1.145535,0.106922 -2.116976,0.20646 -2.155277,0.21752 -0.07312,0.02581 -0.0035,0.191712 1.155981,2.883048 0.678963,1.570559 1.236064,2.879359 1.243027,2.908853 0.007,0.05531 -1.577287,0.822149 -1.61907,0.781594 -0.01393,-0.01108 -0.553616,-1.330921 -1.204726,-2.927287 -0.651109,-1.596368 -1.1907984,-2.908854 -1.2047259,-2.912542 -0.010444,-0.0037 -0.7033373,0.67099 -1.5424673,1.5042 -0.8356484,0.829519 -1.5320219,1.518944 -1.5494312,1.52263 -0.013928,0.0074 -0.027854,-2.942035 -0.027854,-6.5550602 l 0,-6.56980735 0.2715854,0.26913345 c 0.1497204,0.1511574 2.1726855,2.156755 4.491609,4.4572938 z"
id="path8"
style="line-height:normal;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-transform:none;block-progression:tb;overflow:visible;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.62420827;stroke-opacity:1;enable-background:accumulate"
d="m 3.959366,0.37715855 a 0.3578125,0.3578125 0 0 0 -0.3578125,0.35781251 0.3578125,0.3578125 0 0 0 0.00156,0.03125 0.39961847,0.39961847 0 0 0 0,0.001563 0.39961847,0.39961847 0 0 0 -0.00156,0.0109375 0.39961847,0.39961847 0 0 0 0,0.0359375 0.39961847,0.39961847 0 0 0 0,0.0140625 0.39961847,0.39961847 0 0 0 0,0.0125 0.39961847,0.39961847 0 0 0 0,0.0625 l 0,13.12187444 a 0.39961847,0.39961847 0 0 0 0.675,0.289063 l 2.8953125,-2.721875 2.3359378,5.393749 a 0.39961847,0.39961847 0 0 0 0.5375002,0.198438 l 1.746874,-0.798438 a 0.39961847,0.39961847 0 0 0 0.2,-0.523437 l -2.4343742,-5.320312 4.0703122,-0.35 a 0.39961847,0.39961847 0 0 0 0.2375,-0.6984374 L 4.3390535,0.61622106 a 0.39961847,0.39961847 0 0 0 -0.0625,-0.0625 0.39961847,0.39961847 0 0 0 -0.026562,-0.028125 0.3578125,0.3578125 0 0 0 -0.00156,0 A 0.3578125,0.3578125 0 0 0 3.959366,0.37715855 Z"
id="path4"
inkscape:connector-curvature="0" />
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -1593,9 +1593,6 @@ Here you can disable your touchscreen.&lt;/i&gt;</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
@ -1619,6 +1616,81 @@ Here you can disable your touchscreen.&lt;/i&gt;</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box22">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="label45">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;i&gt;If audio recording is running the time possitions are stored to the written Text and can be replayed.
The Audio track is recorded to a separate folder, and liked to there.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">10</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="label46">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Audio Folder</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="fcAudioPath">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="action">select-folder</property>
<property name="title" translatable="yes">Select Folder</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">7</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label44">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Audio Recording</property>
</object>
<packing>
<property name="position">7</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>

Loading…
Cancel
Save