|
From: <tiz...@us...> - 2012-09-14 19:25:10
|
Revision: 338
http://sepiola.svn.sourceforge.net/sepiola/?rev=338&view=rev
Author: tizianomueller
Date: 2012-09-14 19:25:00 +0000 (Fri, 14 Sep 2012)
Log Message:
-----------
Add interface for setting the bandwidth limit
thanks to Steve Ludovicy for the initial patch
Modified Paths:
--------------
trunk/src/gui/settings_form.cc
trunk/src/gui/settings_form.hh
trunk/src/gui/settings_form.ui
Modified: trunk/src/gui/settings_form.cc
===================================================================
--- trunk/src/gui/settings_form.cc 2012-09-14 19:22:17 UTC (rev 337)
+++ trunk/src/gui/settings_form.cc 2012-09-14 19:25:00 UTC (rev 338)
@@ -76,6 +76,7 @@
this->checkBoxShowHiddenFiles->setChecked( settings->getShowHiddenFilesAndFolders() );
this->checkBoxKeepDeletedFiles->setChecked( !settings->getDeleteExtraneousItems() );
this->checkBoxVerboseLogging->setChecked( settings->getLogDebugMessages() );
+ this->spinBoxBandwidthLimit->setValue( settings->getBandwidthLimit() );
this->comboBoxLanguage->clear();
for ( auto language: settings->getAvailableLanguages() )
@@ -97,6 +98,7 @@
settings->saveShowHiddenFilesAndFolders( this->checkBoxShowHiddenFiles->isChecked() );
settings->saveDeleteExtraneousItems( !this->checkBoxKeepDeletedFiles->isChecked() );
settings->saveLogDebugMessages( this->checkBoxVerboseLogging->isChecked() );
+ settings->saveBandwidthLimit( this->spinBoxBandwidthLimit->value() );
QMessageBox::information( this, tr( "Settings saved" ), tr( "Settings have been saved." ) );
emit updateOverviewFormLastBackupsInfo();
@@ -168,6 +170,11 @@
formChanged = (i != Settings::getInstance()->getNOfLastBackups());
}
+void SettingsForm::on_spinBoxBandwidthLimit_valueChanged( int i )
+{
+ formChanged = (i != Settings::getInstance()->getBandwidthLimit());
+}
+
void SettingsForm::on_btnDefaultPrefix_clicked()
{
this->lineEditBackupPrefix->setText( Settings::getInstance()->getLocalHostName() );
Modified: trunk/src/gui/settings_form.hh
===================================================================
--- trunk/src/gui/settings_form.hh 2012-09-14 19:22:17 UTC (rev 337)
+++ trunk/src/gui/settings_form.hh 2012-09-14 19:25:00 UTC (rev 338)
@@ -70,6 +70,7 @@
void on_checkBoxShowHiddenFiles_stateChanged( int state );
void on_checkBoxKeepDeletedFiles_stateChanged( int state );
void on_checkBoxVerboseLogging_stateChanged( int state );
+ void on_spinBoxBandwidthLimit_valueChanged( int i );
};
#endif
Modified: trunk/src/gui/settings_form.ui
===================================================================
--- trunk/src/gui/settings_form.ui 2012-09-14 19:22:17 UTC (rev 337)
+++ trunk/src/gui/settings_form.ui 2012-09-14 19:25:00 UTC (rev 338)
@@ -472,6 +472,52 @@
</widget>
</item>
<item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Limit upload bandwidth to</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBoxBandwidthLimit">
+ <property name="maximum">
+ <number>1000000</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Kilobytes/Second</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|