[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r3015: Two bugs fixed. 1. Bad behaviour on 0.2.1.x series. A file w (in vidalia/branches/exit-country/src/vidalia: config res)



Author: cviecco
Date: 2008-08-27 13:55:20 -0400 (Wed, 27 Aug 2008)
New Revision: 3015

Modified:
   vidalia/branches/exit-country/src/vidalia/config/nodepolicypage.cpp
   vidalia/branches/exit-country/src/vidalia/res/vidalia.qrc
Log:

Two bugs fixed.
1. Bad behaviour on 0.2.1.x series. A file was removed from the vidalia.qrc during merge. Correct behaviour now resotred (correct resolution on Tor 0.2.1x serires)
2. Was not saving the avoid country option. Now it is (nodepolycipage.cpp)


Modified: vidalia/branches/exit-country/src/vidalia/config/nodepolicypage.cpp
===================================================================
--- vidalia/branches/exit-country/src/vidalia/config/nodepolicypage.cpp	2008-08-27 15:31:17 UTC (rev 3014)
+++ vidalia/branches/exit-country/src/vidalia/config/nodepolicypage.cpp	2008-08-27 17:55:20 UTC (rev 3015)
@@ -212,11 +212,16 @@
 
   QList<int> saved_excluded_index;
   QStringList saved_excluded=_settings->getExcludeNodeCountry();
+  QListWidget saved_excluded_items;
 
    //clear the boxes!
   ui.cmboExitNodesbyCountry->clear();
   ui.listWidgetExcludedCountries->clear();
 
+   //and enable multiple selections?
+  //ui.listWidgetInvalidCountries->setSelectionMode(QAbstractItemView::MultiSelection);
+  ui.listWidgetExcludedCountries->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
   foreach (QString country, by_country_exit_nodes2.keys()) {
     /*Get the count of exit nodes for this country*/
     count=QString("%1").arg(by_country_exit_nodes2.value(country).count(),0,10);
@@ -250,25 +255,38 @@
     
     countryListItem=ui.listWidgetExcludedCountries->item(itemcount);
     countryListItem->setIcon(country_flag);
+    //now check if
+    foreach(QString excludedCountry, saved_excluded){
+       if(country.toAscii()==excludedCountry){
+         saved_excluded_index.append(itemcount);
+         ui.listWidgetExcludedCountries->setCurrentItem(countryListItem); 
+       }
+    }
+
     itemcount++;
   }
   
   
   //and enable multiple selections?
   //ui.listWidgetInvalidCountries->setSelectionMode(QAbstractItemView::MultiSelection);
-  ui.listWidgetExcludedCountries->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  //ui.listWidgetExcludedCountries->setSelectionMode(QAbstractItemView::ExtendedSelection);
  
   //Now load settings for country
   ui.cmboExitNodesbyCountry->setCurrentIndex(saved_index);
 
   //now apply changes if something was saved!
-  if(0!=saved_index){
+  if(0!=saved_index || saved_excluded_index.size()!=0){
      vInfo("Network out: applying save!\n");
      //apply a save!
      QString err;
      //save(err);
-     ui.cmboExitNodesbyCountry->setCurrentIndex(saved_index);
-     copyExitCountryToText();
+     if(0!=saved_index){
+       ui.cmboExitNodesbyCountry->setCurrentIndex(saved_index);
+       copyExitCountryToText();
+     }
+     if(saved_excluded_index.size()!=0){
+       copyExcludedCountryToText();
+     }
      applyTorSettings();
   }
 

Modified: vidalia/branches/exit-country/src/vidalia/res/vidalia.qrc
===================================================================
--- vidalia/branches/exit-country/src/vidalia/res/vidalia.qrc	2008-08-27 15:31:17 UTC (rev 3014)
+++ vidalia/branches/exit-country/src/vidalia/res/vidalia.qrc	2008-08-27 17:55:20 UTC (rev 3015)
@@ -285,5 +285,6 @@
     </qresource>
     <qresource prefix="/geoip">
         <file>cacert_root.crt</file>
+        <file>country_loc.csv</file>
     </qresource>
 </RCC>