save as dialog cleanups, #refs 145; rearrangements for debug; refs #153
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="52"/>
|
||||
<location filename="saveorrun.ui" line="99"/>
|
||||
<location filename="saveorrun.ui" line="109"/>
|
||||
<source>browse ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -36,13 +36,13 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="106"/>
|
||||
<source>Run</source>
|
||||
<location filename="saveorrun.ui" line="83"/>
|
||||
<source>remember tool for this type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="113"/>
|
||||
<source>remember tool for this type</source>
|
||||
<location filename="saveorrun.ui" line="116"/>
|
||||
<source>Run</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -523,12 +523,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="130"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +537,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="143"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,26 +551,34 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="156"/>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="169"/>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="181"/>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="52"/>
|
||||
<location filename="saveorrun.ui" line="99"/>
|
||||
<location filename="saveorrun.ui" line="109"/>
|
||||
<source>browse ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -36,13 +36,13 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="106"/>
|
||||
<source>Run</source>
|
||||
<location filename="saveorrun.ui" line="83"/>
|
||||
<source>remember tool for this type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="113"/>
|
||||
<source>remember tool for this type</source>
|
||||
<location filename="saveorrun.ui" line="116"/>
|
||||
<source>Run</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -523,12 +523,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="130"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +537,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="143"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,26 +551,34 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="156"/>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="169"/>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="181"/>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="52"/>
|
||||
<location filename="saveorrun.ui" line="99"/>
|
||||
<location filename="saveorrun.ui" line="109"/>
|
||||
<source>browse ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -36,13 +36,13 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="106"/>
|
||||
<source>Run</source>
|
||||
<location filename="saveorrun.ui" line="83"/>
|
||||
<source>remember tool for this type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="113"/>
|
||||
<source>remember tool for this type</source>
|
||||
<location filename="saveorrun.ui" line="116"/>
|
||||
<source>Run</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -523,12 +523,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="130"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +537,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="143"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,26 +551,34 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="156"/>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="169"/>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="181"/>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="52"/>
|
||||
<location filename="saveorrun.ui" line="99"/>
|
||||
<location filename="saveorrun.ui" line="109"/>
|
||||
<source>browse ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -36,13 +36,13 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="106"/>
|
||||
<source>Run</source>
|
||||
<location filename="saveorrun.ui" line="83"/>
|
||||
<source>remember tool for this type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.ui" line="113"/>
|
||||
<source>remember tool for this type</source>
|
||||
<location filename="saveorrun.ui" line="116"/>
|
||||
<source>Run</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -523,12 +523,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="130"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +537,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="143"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,26 +551,34 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="156"/>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="169"/>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="181"/>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
@@ -47,6 +47,8 @@ namespace qbrowserlib {
|
||||
LOG;
|
||||
setupUi(this);
|
||||
QString obj(remoteFilename());
|
||||
_rememberPath->setVisible(false);
|
||||
_rememberTool->setVisible(false);
|
||||
_program->setText(QCoreApplication::applicationDirPath()
|
||||
+QDir::separator());
|
||||
_object->setText(obj);
|
||||
@@ -232,6 +234,7 @@ namespace qbrowserlib {
|
||||
bool kiosk=false, QWidget* p=0):
|
||||
QDialog(p), _sor(new SaveOrRun(reply, executor, type, src)) {
|
||||
LOG;
|
||||
setWindowTitle(tr("Unknown File Type"));
|
||||
QVBoxLayout* l(new QVBoxLayout(this));
|
||||
l->addWidget(_sor);
|
||||
l->addWidget(_buttons = new QDialogButtonBox(QDialogButtonBox::Cancel));
|
||||
|
@@ -77,6 +77,16 @@
|
||||
<string>Open in External Application</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_rememberTool">
|
||||
<property name="text">
|
||||
<string>remember tool for this type</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="_program">
|
||||
<property name="enabled">
|
||||
@@ -107,16 +117,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="_rememberTool">
|
||||
<property name="text">
|
||||
<string>remember tool for this type</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
@@ -279,12 +279,12 @@
|
||||
<slot>click()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>371</x>
|
||||
<y>113</y>
|
||||
<x>320</x>
|
||||
<y>78</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>94</x>
|
||||
<y>126</y>
|
||||
<x>430</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@@ -295,12 +295,12 @@
|
||||
<slot>click()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>371</x>
|
||||
<y>207</y>
|
||||
<x>320</x>
|
||||
<y>78</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>94</x>
|
||||
<y>220</y>
|
||||
<x>430</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
|
@@ -22,350 +22,357 @@
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
class Settings: public QDialog, protected Ui::Settings {
|
||||
namespace qbrowserlib {
|
||||
|
||||
Q_OBJECT;
|
||||
class Settings: public QDialog, protected Ui::Settings {
|
||||
|
||||
public:
|
||||
Q_OBJECT;
|
||||
|
||||
typedef QMap<QString, QVariant> MimeTypes;
|
||||
typedef QMap<QString, QVariant> SearchEngines;
|
||||
public:
|
||||
|
||||
Q_SIGNALS:
|
||||
typedef QMap<QString, QVariant> MimeTypes;
|
||||
typedef QMap<QString, QVariant> SearchEngines;
|
||||
|
||||
void newSettings();
|
||||
Q_SIGNALS:
|
||||
|
||||
public:
|
||||
void newSettings();
|
||||
|
||||
Settings(MimeTypes mimetypes, QWidget* p=0,
|
||||
QSettings* settings=0, bool autoWrite=true):
|
||||
QDialog(p), _settings(settings),
|
||||
_autoWrite(autoWrite), _mimetypes(mimetypes) {
|
||||
public:
|
||||
|
||||
Settings(MimeTypes mimetypes, QWidget* p=0,
|
||||
QSettings* settings=0, bool autoWrite=true):
|
||||
QDialog(p), _settings(settings),
|
||||
_autoWrite(autoWrite), _mimetypes(mimetypes) {
|
||||
|
||||
setupUi(this);
|
||||
setupUi(this);
|
||||
|
||||
// Web Attributes
|
||||
_attributes[QWebSettings::AutoLoadImages] =
|
||||
_settingAutoLoadImages;
|
||||
_attributes[QWebSettings::DnsPrefetchEnabled] =
|
||||
_settingDnsPrefetchEnabled;
|
||||
_attributes[QWebSettings::JavascriptEnabled] =
|
||||
_settingJavascriptEnabled;
|
||||
_attributes[QWebSettings::JavaEnabled] =
|
||||
_settingJavaEnabled;
|
||||
_attributes[QWebSettings::PluginsEnabled] =
|
||||
_settingPluginsEnabled;
|
||||
_attributes[QWebSettings::PrivateBrowsingEnabled] =
|
||||
_settingPrivateBrowsingEnabled;
|
||||
_attributes[QWebSettings::JavascriptCanOpenWindows] =
|
||||
_settingJavascriptCanOpenWindows;
|
||||
_attributes[QWebSettings::JavascriptCanAccessClipboard] =
|
||||
_settingJavascriptCanAccessClipboard;
|
||||
_attributes[QWebSettings::DeveloperExtrasEnabled] =
|
||||
_settingDeveloperExtrasEnabled;
|
||||
_attributes[QWebSettings::SpatialNavigationEnabled] =
|
||||
_settingSpatialNavigationEnabled;
|
||||
_attributes[QWebSettings::LinksIncludedInFocusChain] =
|
||||
_settingLinksIncludedInFocusChain;
|
||||
_attributes[QWebSettings::ZoomTextOnly] =
|
||||
_settingZoomTextOnly;
|
||||
_attributes[QWebSettings::PrintElementBackgrounds] =
|
||||
_settingPrintElementBackgrounds;
|
||||
_attributes[QWebSettings::OfflineStorageDatabaseEnabled] =
|
||||
_settingOfflineStorageDatabaseEnabled;
|
||||
_attributes[QWebSettings::OfflineWebApplicationCacheEnabled] =
|
||||
_settingOfflineWebApplicationCacheEnabled;
|
||||
_attributes[QWebSettings::LocalStorageEnabled] =
|
||||
_settingLocalStorageEnabled;
|
||||
_attributes[QWebSettings::LocalContentCanAccessRemoteUrls] =
|
||||
_settingLocalContentCanAccessRemoteUrls;
|
||||
_attributes[QWebSettings::LocalContentCanAccessFileUrls] =
|
||||
_settingLocalContentCanAccessFileUrls;
|
||||
// not in qt 4.7.0 (mac)
|
||||
// _attributes[QWebSettings::XSSAuditingEnabled] =
|
||||
// _settingXSSAuditingEnabled;
|
||||
_attributes[QWebSettings::AcceleratedCompositingEnabled] =
|
||||
_settingAcceleratedCompositingEnabled;
|
||||
_attributes[QWebSettings::TiledBackingStoreEnabled] =
|
||||
_settingTiledBackingStoreEnabled;
|
||||
_attributes[QWebSettings::FrameFlatteningEnabled] =
|
||||
_settingFrameFlatteningEnabled;
|
||||
// not in qt 4.7.0 (mac)
|
||||
// _attributes[QWebSettings::SiteSpecificQuirksEnabled] =
|
||||
// _settingSiteSpecificQuirksEnabled;
|
||||
// Web Attributes
|
||||
_attributes[QWebSettings::AutoLoadImages] =
|
||||
_settingAutoLoadImages;
|
||||
_attributes[QWebSettings::DnsPrefetchEnabled] =
|
||||
_settingDnsPrefetchEnabled;
|
||||
_attributes[QWebSettings::JavascriptEnabled] =
|
||||
_settingJavascriptEnabled;
|
||||
_attributes[QWebSettings::JavaEnabled] =
|
||||
_settingJavaEnabled;
|
||||
_attributes[QWebSettings::PluginsEnabled] =
|
||||
_settingPluginsEnabled;
|
||||
_attributes[QWebSettings::PrivateBrowsingEnabled] =
|
||||
_settingPrivateBrowsingEnabled;
|
||||
_attributes[QWebSettings::JavascriptCanOpenWindows] =
|
||||
_settingJavascriptCanOpenWindows;
|
||||
_attributes[QWebSettings::JavascriptCanAccessClipboard] =
|
||||
_settingJavascriptCanAccessClipboard;
|
||||
_attributes[QWebSettings::DeveloperExtrasEnabled] =
|
||||
_settingDeveloperExtrasEnabled;
|
||||
_attributes[QWebSettings::SpatialNavigationEnabled] =
|
||||
_settingSpatialNavigationEnabled;
|
||||
_attributes[QWebSettings::LinksIncludedInFocusChain] =
|
||||
_settingLinksIncludedInFocusChain;
|
||||
_attributes[QWebSettings::ZoomTextOnly] =
|
||||
_settingZoomTextOnly;
|
||||
_attributes[QWebSettings::PrintElementBackgrounds] =
|
||||
_settingPrintElementBackgrounds;
|
||||
_attributes[QWebSettings::OfflineStorageDatabaseEnabled] =
|
||||
_settingOfflineStorageDatabaseEnabled;
|
||||
_attributes[QWebSettings::OfflineWebApplicationCacheEnabled] =
|
||||
_settingOfflineWebApplicationCacheEnabled;
|
||||
_attributes[QWebSettings::LocalStorageEnabled] =
|
||||
_settingLocalStorageEnabled;
|
||||
_attributes[QWebSettings::LocalContentCanAccessRemoteUrls] =
|
||||
_settingLocalContentCanAccessRemoteUrls;
|
||||
_attributes[QWebSettings::LocalContentCanAccessFileUrls] =
|
||||
_settingLocalContentCanAccessFileUrls;
|
||||
// not in qt 4.7.0 (mac)
|
||||
// _attributes[QWebSettings::XSSAuditingEnabled] =
|
||||
// _settingXSSAuditingEnabled;
|
||||
_attributes[QWebSettings::AcceleratedCompositingEnabled] =
|
||||
_settingAcceleratedCompositingEnabled;
|
||||
_attributes[QWebSettings::TiledBackingStoreEnabled] =
|
||||
_settingTiledBackingStoreEnabled;
|
||||
_attributes[QWebSettings::FrameFlatteningEnabled] =
|
||||
_settingFrameFlatteningEnabled;
|
||||
// not in qt 4.7.0 (mac)
|
||||
// _attributes[QWebSettings::SiteSpecificQuirksEnabled] =
|
||||
// _settingSiteSpecificQuirksEnabled;
|
||||
|
||||
// CheckBoxes
|
||||
_checkboxes["SaveWindowState"] =
|
||||
std::make_pair(_saveWindowState, _saveWindowState->isChecked());
|
||||
_checkboxes["CloseApps"] =
|
||||
std::make_pair(_closeApps, _closeApps->isChecked());
|
||||
// CheckBoxes
|
||||
_checkboxes["SaveWindowState"] =
|
||||
std::make_pair(_saveWindowState, _saveWindowState->isChecked());
|
||||
_checkboxes["CloseApps"] =
|
||||
std::make_pair(_closeApps, _closeApps->isChecked());
|
||||
|
||||
load(!_mimetypes.size());
|
||||
on__buttons_rejected();
|
||||
}
|
||||
|
||||
void setSettings(QSettings* settings) {
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
QSettings* operator()() {
|
||||
return _settings;
|
||||
}
|
||||
|
||||
void setAttribute(QWebSettings::WebAttribute attr, bool state) {
|
||||
//LOG;
|
||||
QWebSettings::globalSettings()->setAttribute(attr, state);
|
||||
_attributes[attr]->setChecked(state);
|
||||
}
|
||||
|
||||
bool flag(const QString& name) {
|
||||
assert(_checkboxes.find(name)!=_checkboxes.end());
|
||||
return _checkboxes[name].second;
|
||||
}
|
||||
|
||||
const QString& text(const QString& name) {
|
||||
assert(_lineedits.find(name)!=_lineedits.end());
|
||||
return _lineedits[name].second;
|
||||
}
|
||||
|
||||
const MimeTypes& mimetypes() const {
|
||||
return _mimetypes;
|
||||
}
|
||||
|
||||
QStringList mimetype(QString mimetype, QString filename) const {
|
||||
Settings::MimeTypes::const_iterator
|
||||
it(_mimetypes.find(mimetype.split(';')[0]));
|
||||
if (it!=_mimetypes.end()) return it.value().toStringList();
|
||||
for (it=_mimetypes.begin(); it!=_mimetypes.end(); ++it)
|
||||
if (filename.endsWith("."+it.value().toStringList().at(0)))
|
||||
return it.value().toStringList();
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QString& replaceSearchEngine(QString& url) {
|
||||
LOG;
|
||||
int len(url.indexOf(QRegExp("[ :]")));
|
||||
if (len<=0) return url;
|
||||
QString scheme(url.left(len));
|
||||
LOG<<"scheme:"<<scheme;
|
||||
if (!_searchEngines.contains(scheme)) return url;
|
||||
QString query(url.right(url.size()-len-1));
|
||||
LOG<<"query:"<<query;
|
||||
url = QString(_searchEngines[scheme].toString())
|
||||
.arg(query).arg(QLocale::system().name().left(2));
|
||||
return url;
|
||||
}
|
||||
|
||||
const SearchEngines& searchEngines() const {
|
||||
return _searchEngines;
|
||||
}
|
||||
|
||||
bool save() {
|
||||
LOG;
|
||||
if (!_settings || !_settings->isWritable()) return false;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
_settings->setValue
|
||||
(QString("QWebSettings/%1").arg(it->first),
|
||||
QWebSettings::globalSettings()->testAttribute(it->first));
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it)
|
||||
_settings->setValue
|
||||
(QString("Flags/%1").arg(it->first), it->second.second);
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it)
|
||||
_settings->setValue
|
||||
(QString("Texts/%1").arg(it->first), it->second.second);
|
||||
// MimeTypes
|
||||
_settings->setValue("QWebSettings/MimeTypes", _mimetypes);
|
||||
// Search Engines
|
||||
_settings->setValue("QWebSettings/SearchEngines", _searchEngines);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool load(bool overwriteMimeTypes=true) {
|
||||
LOG;
|
||||
if (!_settings) return false;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it) {
|
||||
QVariant val
|
||||
(_settings->value
|
||||
(QString("QWebSettings/%1").arg(it->first),
|
||||
QWebSettings::globalSettings()->testAttribute(it->first)));
|
||||
if (val.isValid() && val.canConvert(QVariant::Bool))
|
||||
setAttribute(it->first, val.toBool());
|
||||
load(!_mimetypes.size());
|
||||
on__buttons_rejected();
|
||||
}
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it) {
|
||||
QVariant val
|
||||
(_settings->value
|
||||
(QString("Flags/%1").arg(it->first), it->second.second));
|
||||
if (val.isValid() && val.canConvert(QVariant::Bool)) {
|
||||
it->second.first->setChecked(val.toBool());
|
||||
it->second.second = val.toBool();
|
||||
|
||||
static bool DEBUG;
|
||||
|
||||
void setSettings(QSettings* settings) {
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
QSettings* operator()() {
|
||||
return _settings;
|
||||
}
|
||||
|
||||
void setAttribute(QWebSettings::WebAttribute attr, bool state) {
|
||||
//LOG;
|
||||
QWebSettings::globalSettings()->setAttribute(attr, state);
|
||||
_attributes[attr]->setChecked(state);
|
||||
}
|
||||
|
||||
bool flag(const QString& name) {
|
||||
assert(_checkboxes.find(name)!=_checkboxes.end());
|
||||
return _checkboxes[name].second;
|
||||
}
|
||||
|
||||
const QString& text(const QString& name) {
|
||||
assert(_lineedits.find(name)!=_lineedits.end());
|
||||
return _lineedits[name].second;
|
||||
}
|
||||
|
||||
const MimeTypes& mimetypes() const {
|
||||
return _mimetypes;
|
||||
}
|
||||
|
||||
QStringList mimetype(QString mimetype, QString filename) const {
|
||||
Settings::MimeTypes::const_iterator
|
||||
it(_mimetypes.find(mimetype.split(';')[0]));
|
||||
if (it!=_mimetypes.end()) return it.value().toStringList();
|
||||
for (it=_mimetypes.begin(); it!=_mimetypes.end(); ++it)
|
||||
if (filename.endsWith("."+it.value().toStringList().at(0)))
|
||||
return it.value().toStringList();
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QString& replaceSearchEngine(QString& url) {
|
||||
LOG;
|
||||
int len(url.indexOf(QRegExp("[ :]")));
|
||||
if (len<=0) return url;
|
||||
QString scheme(url.left(len));
|
||||
LOG<<"scheme:"<<scheme;
|
||||
if (!_searchEngines.contains(scheme)) return url;
|
||||
QString query(url.right(url.size()-len-1));
|
||||
LOG<<"query:"<<query;
|
||||
url = QString(_searchEngines[scheme].toString())
|
||||
.arg(query).arg(QLocale::system().name().left(2));
|
||||
return url;
|
||||
}
|
||||
|
||||
const SearchEngines& searchEngines() const {
|
||||
return _searchEngines;
|
||||
}
|
||||
|
||||
bool save() {
|
||||
LOG;
|
||||
if (!_settings || !_settings->isWritable()) return false;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
_settings->setValue
|
||||
(QString("QWebSettings/%1").arg(it->first),
|
||||
QWebSettings::globalSettings()->testAttribute(it->first));
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it)
|
||||
_settings->setValue
|
||||
(QString("Flags/%1").arg(it->first), it->second.second);
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it)
|
||||
_settings->setValue
|
||||
(QString("Texts/%1").arg(it->first), it->second.second);
|
||||
// MimeTypes
|
||||
_settings->setValue("QWebSettings/MimeTypes", _mimetypes);
|
||||
// Search Engines
|
||||
_settings->setValue("QWebSettings/SearchEngines", _searchEngines);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool load(bool overwriteMimeTypes=true) {
|
||||
LOG;
|
||||
if (!_settings) return false;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it) {
|
||||
QVariant val
|
||||
(_settings->value
|
||||
(QString("QWebSettings/%1").arg(it->first),
|
||||
QWebSettings::globalSettings()->testAttribute(it->first)));
|
||||
if (val.isValid() && val.canConvert(QVariant::Bool))
|
||||
setAttribute(it->first, val.toBool());
|
||||
}
|
||||
}
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it) {
|
||||
QVariant val
|
||||
(_settings->value
|
||||
(QString("Texts/%1").arg(it->first), it->second.second));
|
||||
if (val.isValid() && val.canConvert(QVariant::String)) {
|
||||
it->second.first->setText(val.toString());
|
||||
it->second.second = val.toString();
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it) {
|
||||
QVariant val
|
||||
(_settings->value
|
||||
(QString("Flags/%1").arg(it->first), it->second.second));
|
||||
if (val.isValid() && val.canConvert(QVariant::Bool)) {
|
||||
it->second.first->setChecked(val.toBool());
|
||||
it->second.second = val.toBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
// MimeTypes
|
||||
if (overwriteMimeTypes) {
|
||||
QVariant val(_settings->value("QWebSettings/MimeTypes"));
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it) {
|
||||
QVariant val
|
||||
(_settings->value
|
||||
(QString("Texts/%1").arg(it->first), it->second.second));
|
||||
if (val.isValid() && val.canConvert(QVariant::String)) {
|
||||
it->second.first->setText(val.toString());
|
||||
it->second.second = val.toString();
|
||||
}
|
||||
}
|
||||
// MimeTypes
|
||||
if (overwriteMimeTypes) {
|
||||
QVariant val(_settings->value("QWebSettings/MimeTypes"));
|
||||
if (val.isValid() && val.canConvert(QVariant::Map))
|
||||
_mimetypes = val.toMap();
|
||||
}
|
||||
// SearchEngines
|
||||
QVariant val(_settings->value("QWebSettings/SearchEngines"));
|
||||
if (val.isValid() && val.canConvert(QVariant::Map))
|
||||
_mimetypes = val.toMap();
|
||||
_searchEngines = val.toMap();
|
||||
newSettings();
|
||||
return true;
|
||||
}
|
||||
// SearchEngines
|
||||
QVariant val(_settings->value("QWebSettings/SearchEngines"));
|
||||
if (val.isValid() && val.canConvert(QVariant::Map))
|
||||
_searchEngines = val.toMap();
|
||||
newSettings();
|
||||
return true;
|
||||
}
|
||||
|
||||
private Q_SLOTS:
|
||||
private Q_SLOTS:
|
||||
|
||||
void on__buttons_accepted() {
|
||||
LOG;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
QWebSettings::globalSettings()
|
||||
->setAttribute(it->first, it->second->isChecked());
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it)
|
||||
it->second.second = it->second.first->isChecked();
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it)
|
||||
it->second.second = it->second.first->text();
|
||||
// MimeTypes
|
||||
_mimetypes.clear();
|
||||
for (int row(_mimeTypeTable->rowCount()); row--;)
|
||||
_mimetypes[_mimeTypeTable->item(row, 0)->text()] =
|
||||
QStringList()
|
||||
<<_mimeTypeTable->item(row, 1)->text()
|
||||
<<_mimeTypeTable->item(row, 2)->text();
|
||||
// SearchEngines
|
||||
_searchEngines.clear();
|
||||
for (int row(_searchEngineTable->rowCount()); row--;)
|
||||
_searchEngines[_searchEngineTable->item(row, 0)->text()] =
|
||||
_searchEngineTable->item(row, 1)->text();
|
||||
// Save
|
||||
if (_autoWrite) save();
|
||||
newSettings();
|
||||
}
|
||||
|
||||
void on__buttons_rejected() {
|
||||
LOG;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
it->second->setChecked
|
||||
(QWebSettings::globalSettings()->testAttribute(it->first));
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it)
|
||||
it->second.first->setChecked(it->second.second);
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it)
|
||||
it->second.first->setText(it->second.second);
|
||||
// MimeTypes
|
||||
_mimeTypeTable->setRowCount(_mimetypes.size());
|
||||
_mimeTypeTable->verticalHeader()->show();
|
||||
_mimeTypeTable->horizontalHeader()->show();
|
||||
_mimeTypeTable->horizontalHeader()->setStretchLastSection(true);
|
||||
int row(0);
|
||||
for (MimeTypes::iterator it(_mimetypes.begin());
|
||||
it!=_mimetypes.end(); ++it, ++row) {
|
||||
LOG<<"MimeType:"<<it.key()<<it.value().toStringList();
|
||||
_mimeTypeTable->setItem
|
||||
(row, 0, new QTableWidgetItem(it.key()));
|
||||
_mimeTypeTable->setItem
|
||||
(row, 1, new QTableWidgetItem(it.value().toStringList().at(0)));
|
||||
_mimeTypeTable->setItem
|
||||
(row, 2, new QTableWidgetItem(it.value().toStringList().at(1)));
|
||||
void on__buttons_accepted() {
|
||||
LOG;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
QWebSettings::globalSettings()
|
||||
->setAttribute(it->first, it->second->isChecked());
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it)
|
||||
it->second.second = it->second.first->isChecked();
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it)
|
||||
it->second.second = it->second.first->text();
|
||||
// MimeTypes
|
||||
_mimetypes.clear();
|
||||
for (int row(_mimeTypeTable->rowCount()); row--;)
|
||||
_mimetypes[_mimeTypeTable->item(row, 0)->text()] =
|
||||
QStringList()
|
||||
<<_mimeTypeTable->item(row, 1)->text()
|
||||
<<_mimeTypeTable->item(row, 2)->text();
|
||||
// SearchEngines
|
||||
_searchEngines.clear();
|
||||
for (int row(_searchEngineTable->rowCount()); row--;)
|
||||
_searchEngines[_searchEngineTable->item(row, 0)->text()] =
|
||||
_searchEngineTable->item(row, 1)->text();
|
||||
// Save
|
||||
if (_autoWrite) save();
|
||||
newSettings();
|
||||
}
|
||||
// SearchEngines
|
||||
_searchEngineTable->setRowCount(_searchEngines.size());
|
||||
_searchEngineTable->verticalHeader()->show();
|
||||
_searchEngineTable->horizontalHeader()->show();
|
||||
_searchEngineTable->horizontalHeader()->setStretchLastSection(true);
|
||||
row = 0;
|
||||
for (MimeTypes::iterator it(_searchEngines.begin());
|
||||
it!=_searchEngines.end(); ++it, ++row) {
|
||||
LOG<<"SearchEngine:"<<it.key()<<it.value().toString();
|
||||
_searchEngineTable->setItem
|
||||
(row, 0, new QTableWidgetItem(it.key()));
|
||||
_searchEngineTable->setItem
|
||||
(row, 1, new QTableWidgetItem(it.value().toString()));
|
||||
|
||||
void on__buttons_rejected() {
|
||||
LOG;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
it->second->setChecked
|
||||
(QWebSettings::globalSettings()->testAttribute(it->first));
|
||||
// CheckBoxes
|
||||
for (CheckBoxes::iterator it(_checkboxes.begin());
|
||||
it!=_checkboxes.end(); ++it)
|
||||
it->second.first->setChecked(it->second.second);
|
||||
// LineEdits
|
||||
for (LineEdits::iterator it(_lineedits.begin());
|
||||
it!=_lineedits.end(); ++it)
|
||||
it->second.first->setText(it->second.second);
|
||||
// MimeTypes
|
||||
_mimeTypeTable->setRowCount(_mimetypes.size());
|
||||
_mimeTypeTable->verticalHeader()->show();
|
||||
_mimeTypeTable->horizontalHeader()->show();
|
||||
_mimeTypeTable->horizontalHeader()->setStretchLastSection(true);
|
||||
int row(0);
|
||||
for (MimeTypes::iterator it(_mimetypes.begin());
|
||||
it!=_mimetypes.end(); ++it, ++row) {
|
||||
LOG<<"MimeType:"<<it.key()<<it.value().toStringList();
|
||||
_mimeTypeTable->setItem
|
||||
(row, 0, new QTableWidgetItem(it.key()));
|
||||
_mimeTypeTable->setItem
|
||||
(row, 1, new QTableWidgetItem(it.value().toStringList().at(0)));
|
||||
_mimeTypeTable->setItem
|
||||
(row, 2, new QTableWidgetItem(it.value().toStringList().at(1)));
|
||||
}
|
||||
// SearchEngines
|
||||
_searchEngineTable->setRowCount(_searchEngines.size());
|
||||
_searchEngineTable->verticalHeader()->show();
|
||||
_searchEngineTable->horizontalHeader()->show();
|
||||
_searchEngineTable->horizontalHeader()->setStretchLastSection(true);
|
||||
row = 0;
|
||||
for (MimeTypes::iterator it(_searchEngines.begin());
|
||||
it!=_searchEngines.end(); ++it, ++row) {
|
||||
LOG<<"SearchEngine:"<<it.key()<<it.value().toString();
|
||||
_searchEngineTable->setItem
|
||||
(row, 0, new QTableWidgetItem(it.key()));
|
||||
_searchEngineTable->setItem
|
||||
(row, 1, new QTableWidgetItem(it.value().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void on__addMimeType_pressed() {
|
||||
_mimeTypeTable->setRowCount(_mimeTypeTable->rowCount()+1);
|
||||
_mimeTypeTable->setItem(_mimeTypeTable->rowCount()-1, 0,
|
||||
new QTableWidgetItem);
|
||||
_mimeTypeTable->setItem(_mimeTypeTable->rowCount()-1, 1,
|
||||
new QTableWidgetItem);
|
||||
_mimeTypeTable->setItem(_mimeTypeTable->rowCount()-1, 2,
|
||||
new QTableWidgetItem);
|
||||
}
|
||||
void on__addMimeType_pressed() {
|
||||
_mimeTypeTable->setRowCount(_mimeTypeTable->rowCount()+1);
|
||||
_mimeTypeTable->setItem(_mimeTypeTable->rowCount()-1, 0,
|
||||
new QTableWidgetItem);
|
||||
_mimeTypeTable->setItem(_mimeTypeTable->rowCount()-1, 1,
|
||||
new QTableWidgetItem);
|
||||
_mimeTypeTable->setItem(_mimeTypeTable->rowCount()-1, 2,
|
||||
new QTableWidgetItem);
|
||||
}
|
||||
|
||||
void on__removeMimeType_pressed() {
|
||||
QList<QTableWidgetSelectionRange> ranges
|
||||
(_mimeTypeTable->selectedRanges());
|
||||
if (ranges.isEmpty()) return;
|
||||
for (int begin(ranges.at(0).topRow()), count(ranges.at(0).rowCount());
|
||||
count; --count)
|
||||
_mimeTypeTable->removeRow(begin);
|
||||
}
|
||||
void on__removeMimeType_pressed() {
|
||||
QList<QTableWidgetSelectionRange> ranges
|
||||
(_mimeTypeTable->selectedRanges());
|
||||
if (ranges.isEmpty()) return;
|
||||
for (int begin(ranges.at(0).topRow()), count(ranges.at(0).rowCount());
|
||||
count; --count)
|
||||
_mimeTypeTable->removeRow(begin);
|
||||
}
|
||||
|
||||
void on__addSearchEngine_pressed() {
|
||||
_searchEngineTable->setRowCount(_searchEngineTable->rowCount()+1);
|
||||
_searchEngineTable->setItem(_searchEngineTable->rowCount()-1, 0,
|
||||
new QTableWidgetItem);
|
||||
_searchEngineTable->setItem(_searchEngineTable->rowCount()-1, 1,
|
||||
new QTableWidgetItem);
|
||||
_searchEngineTable->setItem(_searchEngineTable->rowCount()-1, 2,
|
||||
new QTableWidgetItem);
|
||||
}
|
||||
void on__addSearchEngine_pressed() {
|
||||
_searchEngineTable->setRowCount(_searchEngineTable->rowCount()+1);
|
||||
_searchEngineTable->setItem(_searchEngineTable->rowCount()-1, 0,
|
||||
new QTableWidgetItem);
|
||||
_searchEngineTable->setItem(_searchEngineTable->rowCount()-1, 1,
|
||||
new QTableWidgetItem);
|
||||
_searchEngineTable->setItem(_searchEngineTable->rowCount()-1, 2,
|
||||
new QTableWidgetItem);
|
||||
}
|
||||
|
||||
void on__removeSearchEngine_pressed() {
|
||||
QList<QTableWidgetSelectionRange> ranges
|
||||
(_searchEngineTable->selectedRanges());
|
||||
if (ranges.isEmpty()) return;
|
||||
for (int begin(ranges.at(0).topRow()), count(ranges.at(0).rowCount());
|
||||
count; --count)
|
||||
_searchEngineTable->removeRow(begin);
|
||||
}
|
||||
void on__removeSearchEngine_pressed() {
|
||||
QList<QTableWidgetSelectionRange> ranges
|
||||
(_searchEngineTable->selectedRanges());
|
||||
if (ranges.isEmpty()) return;
|
||||
for (int begin(ranges.at(0).topRow()), count(ranges.at(0).rowCount());
|
||||
count; --count)
|
||||
_searchEngineTable->removeRow(begin);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
typedef std::map<QWebSettings::WebAttribute, QCheckBox*> Attributes ;
|
||||
Attributes _attributes;
|
||||
typedef std::map<QString, std::pair<QCheckBox*, bool> > CheckBoxes;
|
||||
CheckBoxes _checkboxes;
|
||||
typedef std::map<QString, std::pair<QLineEdit*, QString> > LineEdits;
|
||||
LineEdits _lineedits;
|
||||
QSettings* _settings;
|
||||
bool _autoWrite;
|
||||
MimeTypes _mimetypes;
|
||||
SearchEngines _searchEngines;
|
||||
typedef std::map<QWebSettings::WebAttribute, QCheckBox*> Attributes ;
|
||||
Attributes _attributes;
|
||||
typedef std::map<QString, std::pair<QCheckBox*, bool> > CheckBoxes;
|
||||
CheckBoxes _checkboxes;
|
||||
typedef std::map<QString, std::pair<QLineEdit*, QString> > LineEdits;
|
||||
LineEdits _lineedits;
|
||||
QSettings* _settings;
|
||||
bool _autoWrite;
|
||||
MimeTypes _mimetypes;
|
||||
SearchEngines _searchEngines;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user