summaryrefslogtreecommitdiff
path: root/patch/opensource/options-with-pass.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch/opensource/options-with-pass.patch')
-rw-r--r--patch/opensource/options-with-pass.patch336
1 files changed, 336 insertions, 0 deletions
diff --git a/patch/opensource/options-with-pass.patch b/patch/opensource/options-with-pass.patch
new file mode 100644
index 0000000..c53cefd
--- /dev/null
+++ b/patch/opensource/options-with-pass.patch
@@ -0,0 +1,336 @@
+diff -U 3 -H -d -r -N -- sources/EventDispatcher.cpp sources-with-pass/EventDispatcher.cpp
+--- sources/EventDispatcher.cpp 2012-02-20 11:16:29.402151959 +0100
++++ sources-with-pass/EventDispatcher.cpp 2012-02-21 19:16:06.540690161 +0100
+@@ -52,6 +52,8 @@
+ KeysList.append(qMakePair(QString("Last_version_used"),QVariant("na")));
+ KeysList.append(qMakePair(QString("ActionOnManualOpen"),QVariant(1)));
+ KeysList.append(qMakePair(QString("GroupWindowWhen"),QVariant(0)));
++ KeysList.append(qMakePair(QString("checkBoxPass"),QVariant(true)));
++ KeysList.append(qMakePair(QString("Password"),QVariant("admin")));
+ options->addOptionGroup("Ultracopier",KeysList);
+ if(options->getOptionValue("Ultracopier","Last_version_used")!=QVariant("na") && options->getOptionValue("Ultracopier","Last_version_used")!=QVariant(ULTRACOPIER_VERSION))
+ {
+diff -U 3 -H -d -r -N -- sources/OptionDialog.cpp sources-with-pass/OptionDialog.cpp
+--- sources/OptionDialog.cpp 2012-02-21 19:22:24.990694347 +0100
++++ sources-with-pass/OptionDialog.cpp 2012-02-21 19:24:59.290696056 +0100
+@@ -222,6 +222,8 @@
+ newOptionValue("Themes", "Ultracopier_current_theme", options->getOptionValue("Themes","Ultracopier_current_theme"));
+ newOptionValue("Ultracopier", "ActionOnManualOpen", options->getOptionValue("Ultracopier","ActionOnManualOpen"));
+ newOptionValue("Ultracopier", "GroupWindowWhen", options->getOptionValue("Ultracopier","GroupWindowWhen"));
++ newOptionValue("Ultracopier", "checkBoxPass", options->getOptionValue("Ultracopier","checkBoxPass"));
++ newOptionValue("Ultracopier", "Password", options->getOptionValue("Ultracopier","Password"));
+ newOptionValue("Language", "Language", options->getOptionValue("Language","Language"));
+ newOptionValue("Language", "Language_autodetect", options->getOptionValue("Language","Language_autodetect"));
+ newOptionValue("SessionLoader", "LoadAtSessionStarting", options->getOptionValue("SessionLoader","LoadAtSessionStarting"));
+@@ -361,6 +363,14 @@
+ {
+ ui->GroupWindowWhen->setCurrentIndex(value.toInt());
+ }
++ if(name=="checkBoxPass")
++ {
++ ui->checkBoxPass->setChecked(value.toBool());
++ }
++ if(name=="Password")
++ {
++ ui->Password->setText(value.toString());
++ }
+ }
+ }
+
+@@ -706,3 +716,21 @@
+ options->setOptionValue("Ultracopier","ActionOnManualOpen",index);
+ }
+ }
++
++void OptionDialog::on_checkBoxPass_toggled(bool checked)
++{
++ if(index!=-1 && plugins->allPluginHaveBeenLoaded())
++ {
++ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start");
++ options->setOptionValue("Ultracopier","checkBoxPass",checked);
++ }
++}
++
++void OptionDialog::on_Password_editingFinished()
++{
++ if(index!=-1 && plugins->allPluginHaveBeenLoaded())
++ {
++ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start");
++ options->setOptionValue("Ultracopier","Password",ui->Password->text());
++ }
++}
+diff -U 3 -H -d -r -N -- sources/OptionDialog.h sources-with-pass/OptionDialog.h
+--- sources/OptionDialog.h 2012-02-21 19:22:33.220694431 +0100
++++ sources-with-pass/OptionDialog.h 2012-02-21 19:25:05.490696125 +0100
+@@ -57,7 +57,8 @@
+ void on_checkBoxLog_folder_clicked();
+ void on_checkBoxLog_sync_clicked();
+ void on_ActionOnManualOpen_currentIndexChanged(int index);
+-
++ void on_checkBoxPass_toggled(bool checked);
++ void on_Password_editingFinished();
+ private:
+ Ui::OptionDialog *ui;
+ struct pluginStore
+diff -U 3 -H -d -r -N -- sources/OptionDialog.ui sources-with-pass/OptionDialog.ui
+--- sources/OptionDialog.ui 2012-02-10 19:52:43.711122987 +0100
++++ sources-with-pass/OptionDialog.ui 2012-02-21 19:16:55.130690698 +0100
+@@ -6,7 +6,7 @@
+ <rect>
+ <x>0</x>
+ <y>0</y>
+- <width>638</width>
++ <width>717</width>
+ <height>455</height>
+ </rect>
+ </property>
+@@ -80,6 +80,9 @@
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <item>
+ <layout class="QFormLayout" name="formLayout_2">
++ <property name="fieldGrowthPolicy">
++ <enum>QFormLayout::ExpandingFieldsGrow</enum>
++ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelLanguage">
+ <property name="text">
+@@ -158,6 +161,13 @@
+ </item>
+ </widget>
+ </item>
++ <item row="5" column="0">
++ <widget class="QLabel" name="label_9">
++ <property name="text">
++ <string>Group window when:</string>
++ </property>
++ </widget>
++ </item>
+ <item row="5" column="1">
+ <widget class="QComboBox" name="GroupWindowWhen">
+ <item>
+@@ -192,10 +202,20 @@
+ </item>
+ </widget>
+ </item>
+- <item row="5" column="0">
+- <widget class="QLabel" name="label_9">
++ <item row="6" column="0">
++ <widget class="QCheckBox" name="checkBoxPass">
+ <property name="text">
+- <string>Group window when:</string>
++ <string>Protect options with a pass:</string>
++ </property>
++ </widget>
++ </item>
++ <item row="6" column="1">
++ <widget class="QLineEdit" name="Password">
++ <property name="enabled">
++ <bool>false</bool>
++ </property>
++ <property name="echoMode">
++ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+@@ -770,12 +790,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>313</x>
+- <y>13</y>
++ <x>301</x>
++ <y>5</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>533</x>
+- <y>44</y>
++ <x>237</x>
++ <y>9</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -786,12 +806,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>583</x>
+- <y>20</y>
++ <x>301</x>
++ <y>5</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>584</x>
+- <y>40</y>
++ <x>300</x>
++ <y>9</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -802,12 +822,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>345</x>
+- <y>21</y>
++ <x>301</x>
++ <y>5</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>582</x>
+- <y>105</y>
++ <x>301</x>
++ <y>14</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -818,12 +838,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>348</x>
+- <y>25</y>
++ <x>301</x>
++ <y>5</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>557</x>
+- <y>156</y>
++ <x>301</x>
++ <y>19</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -834,12 +854,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>537</x>
+- <y>105</y>
++ <x>301</x>
++ <y>14</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>533</x>
+- <y>131</y>
++ <x>301</x>
++ <y>16</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -850,12 +870,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>501</x>
+- <y>156</y>
++ <x>301</x>
++ <y>19</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>501</x>
+- <y>182</y>
++ <x>301</x>
++ <y>22</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -866,12 +886,12 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>269</x>
+- <y>15</y>
++ <x>301</x>
++ <y>5</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>456</x>
+- <y>207</y>
++ <x>301</x>
++ <y>25</y>
+ </hint>
+ </hints>
+ </connection>
+@@ -882,12 +902,28 @@
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+- <x>334</x>
+- <y>12</y>
++ <x>301</x>
++ <y>5</y>
+ </hint>
+ <hint type="destinationlabel">
+- <x>304</x>
+- <y>69</y>
++ <x>301</x>
++ <y>11</y>
++ </hint>
++ </hints>
++ </connection>
++ <connection>
++ <sender>checkBoxPass</sender>
++ <signal>toggled(bool)</signal>
++ <receiver>Password</receiver>
++ <slot>setEnabled(bool)</slot>
++ <hints>
++ <hint type="sourcelabel">
++ <x>412</x>
++ <y>169</y>
++ </hint>
++ <hint type="destinationlabel">
++ <x>482</x>
++ <y>172</y>
+ </hint>
+ </hints>
+ </connection>
+diff -U 3 -H -d -r -N -- sources/SystrayIcon.cpp sources-with-pass/SystrayIcon.cpp
+--- sources/SystrayIcon.cpp 2012-02-05 14:25:43.462930072 +0100
++++ sources-with-pass/SystrayIcon.cpp 2012-02-21 19:35:36.630703097 +0100
+@@ -5,6 +5,7 @@
+ \date 2010 */
+
+ #include <QMessageBox>
++#include <QInputDialog>
+
+ #include "SystrayIcon.h"
+
+@@ -33,7 +34,7 @@
+ //connect the action
+ connect(actionMenuQuit, SIGNAL(triggered()), this, SIGNAL(quit()));
+ connect(actionMenuAbout, SIGNAL(triggered()), this, SIGNAL(showHelp()));
+- connect(actionOptions, SIGNAL(triggered()), this, SIGNAL(showOptions()));
++ connect(actionOptions, SIGNAL(triggered()), this, SLOT(askPassIfNeeded()));
+ connect(sysTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(CatchAction(QSystemTrayIcon::ActivationReason)));
+ connect(plugins, SIGNAL(pluginListingIsfinish()), this, SLOT(reloadEngineList()));
+ //display the icon
+@@ -375,3 +376,17 @@
+ }
+ }
+ }
++
++void SystrayIcon::askPassIfNeeded()
++{
++ if(!options->getOptionValue("Ultracopier","checkBoxPass").toBool())
++ {
++ emit showOptions();
++ return;
++ }
++ QString pass=QInputDialog::getText(NULL,tr("Options password"),tr("Give the option for the password"),QLineEdit::Password);
++ if(pass==options->getOptionValue("Ultracopier","Password").toString())
++ emit showOptions();
++ else
++ QMessageBox::warning(NULL,tr("Error"),tr("Wrong password!"));
++}
+diff -U 3 -H -d -r -N -- sources/SystrayIcon.h sources-with-pass/SystrayIcon.h
+--- sources/SystrayIcon.h 2011-12-12 08:53:27.000000000 +0100
++++ sources-with-pass/SystrayIcon.h 2012-02-21 19:27:11.780697518 +0100
+@@ -78,6 +78,8 @@
+ /// \brief to retranslate the ui
+ void retranslateTheUI();
+ void reloadEngineList();
++ /// \brief ask the pass if needed
++ void askPassIfNeeded();
+ signals:
+ /// \brief Quit ultracopier
+ void quit();