[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/utils/gwenrename
From:       Spiros Georgaras <sngeorgaras () otenet ! gr>
Date:       2009-07-07 20:10:58
Message-ID: 1246997458.703286.10650.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 992853 by sngeorgaras:

updating gewnrename on 2009-07-07

 M  +8 -9      README  
 M  +39 -11    src/namepartbase.cpp  
 M  +1 -0      src/namepartbase.h  
 M  +31 -14    src/namepartbase.ui  


--- trunk/playground/utils/gwenrename/README #992852:992853
@@ -4,25 +4,24 @@
 and there is no other way to load files into it.
 
   How to use it:
-    GwenView: select file(s) - right click - "External Tools / Rename with GwenRename"
-    Konqueror: select file(s) - right click - "Actions / Rename with GwenRename"
+    GwenView: select file(s) - right click - "External Tools / Rename with GwenRename" (currently N/A)
+    Dolphin/Konqueror: select file(s) - right click - "Actions / Rename with GwenRename"
 
 Web site: http://members.hellug.gr/sng/gwenrename/
 kde-apps: http://www.kde-apps.org/content/show.php?content=11844
 
 
-Copyright (C) 2003-2008 by Spiros Georgaras <sng@hellug.gr>
-
-This program is free software; you can redistribute it and/or modify
+Copyright (C) 2003-2009 by Spiros Georgaras <sng@hellug.gr>
+ 
+This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
+
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, write to the
-Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
\ No newline at end of file
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
--- trunk/playground/utils/gwenrename/src/namepartbase.cpp #992852:992853
@@ -10,7 +10,6 @@
 //
 //
 #include "namepartbase.h"
-// #include "settings.h"
 
 #include <klocale.h>
 #include <QtGui/QDialog>
@@ -21,6 +20,8 @@
 	:QDialog()
 {
 	setupUi(this);
+	lblMatch->setStyleSheet("background-color: #A2C511; color: White;");
+	lblSample->setStyleSheet("background-color: #A2C511;");
 	setWindowTitle(windowTitle()+" - GwenRename");
 	chkReplace->setChecked(false);
 }
@@ -34,6 +35,8 @@
 	buttonCancel->setIcon(KIcon(ic->Icon(7)));
 	buttonHelp->setIcon(KIcon(ic->Icon(16)));
 	
+	lblMatch->setStyleSheet("background-color: #A2C511; color: White;");
+	lblSample->setStyleSheet("background-color: #A2C511;");
 	setWindowTitle(windowTitle()+" - GwenRename");
 	setMaximumSize(width(), height());
 	setMinimumSize(width(), height());
@@ -57,18 +60,15 @@
 }
 
 void namePart::startCH( int st ){
-// 	updateLabel(st, lengthInt->value());
 	updateLabel();
 }
 
 
 void namePart::lengthCH( int l ){
-// 	updateLabel(startInt->value(),l);
 	updateLabel();
 }
 
 void namePart::fileChanged( int id ){
-// 	updateLabel(startInt->value(),lengthInt->value());
 	updateLabel();
 }
 
@@ -84,7 +84,16 @@
 		lblSample->setText("");
 		return;
 	}
-	if(search->isEnabled()){
+	
+	if(origName->isChecked() && origName->isEnabled()){
+		// Use original name
+		lblSample->setText(nameList->currentText());
+		lblMatch->setText(nameList->currentText());
+		n1=nameList->currentText();
+		n="";
+		n2="";
+		return;
+	}else	if(search->isEnabled()){
 		start=nameList->currentText().indexOf(
 															 search->currentText());
 		if(start!=-1){
@@ -111,7 +120,7 @@
 	qWarning("namePart::updateLabel - 3");
 //qWarning("n2 = %s",n2.latin1());
 	lblMatch->setText(n);
-	if(replace->isEnabled() && !n.isEmpty())
+	if(chkReplace->isEnabled() && chkReplace->isChecked() && !n.isEmpty())
 		n=replace->currentText();
 	lblSample->setText(n1+"<b><font color=\"White\">"+n+"</font></b>"+n2);
 }
@@ -145,7 +154,7 @@
 	if(state){
 		startInt->setFocus();
 		buttonOk->setEnabled(true);
-	if(chkReplace->isChecked())
+	if( ( chkReplace->isChecked() && chkReplace->isEnabled() ) || !grpOutOptions->isEnabled())
 		chkFixed->setEnabled(true);
 	else
 		chkFixed->setEnabled(false);
@@ -161,7 +170,7 @@
 			buttonOk->setEnabled(false);
 		else
 			buttonOk->setEnabled(true);
-	if(chkReplace->isChecked())
+	if(chkReplace->isChecked() && chkReplace->isEnabled())
 		chkFixed->setEnabled(false);
 	else
 		chkFixed->setEnabled(true);
@@ -173,7 +182,10 @@
 // 	replace->setEnabled(state);
 	qWarning("sdfsdfsdfsfds");
 	if(state){
-		chkFixed->setEnabled(true);
+		if(chkSearchString->isChecked() && chkSearchString->isEnabled())
+			chkFixed->setEnabled(false);
+		else
+			chkFixed->setEnabled(true);
 		if(chkFixed->isChecked()) nameList->setEnabled(false);
 	}else{
 		chkFixed->setEnabled(false);
@@ -205,9 +217,25 @@
 
 
 void namePart::grpOutOptionsToggled(bool state){
-	if(state)
+	if(state){
 		lblSample->setStyleSheet("background-color: #A2C511; color: Green;");
-	else
+		if(origName->isChecked())
+			origNameToggled(true);
+	}else{
 		lblSample->setStyleSheet("background-color: #A2C511;");
+		origNameToggled(false);
+	}
 }
+
+void namePart::origNameToggled(bool state){
+	if(state){
+		grpMatch->setEnabled(false);
+		chkFixed->setEnabled(true);
+	}else{
+		grpMatch->setEnabled(true);
+		chkFixed->setEnabled(false);
+	}
+	updateLabel();
+}
+
 #include "namepartbase.moc"
\ No newline at end of file
--- trunk/playground/utils/gwenrename/src/namepartbase.h #992852:992853
@@ -78,6 +78,7 @@
 		void updateLabel();
 		void updateLabelTextChaned();
 		void grpOutOptionsToggled(bool state);
+		void origNameToggled(bool state);
 		
 //     void switchColors();
 //     void settingsChanged();
--- trunk/playground/utils/gwenrename/src/namepartbase.ui #992852:992853
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Name extraction</string>
+   <string>Original name</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_3">
    <item>
@@ -170,7 +170,7 @@
     </layout>
    </item>
    <item>
-    <widget class="QGroupBox" name="groupBox">
+    <widget class="QGroupBox" name="grpMatch">
      <property name="title">
       <string>Match to</string>
      </property>
@@ -312,7 +312,7 @@
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
-       <widget class="QRadioButton" name="radioButton">
+       <widget class="QRadioButton" name="origName">
         <property name="text">
          <string>Use original name</string>
         </property>
@@ -472,8 +472,8 @@
    <slot>buttonOkClicked()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>596</x>
-     <y>761</y>
+     <x>399</x>
+     <y>393</y>
     </hint>
     <hint type="destinationlabel">
      <x>20</x>
@@ -488,8 +488,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>670</x>
-     <y>761</y>
+     <x>473</x>
+     <y>393</y>
     </hint>
     <hint type="destinationlabel">
      <x>20</x>
@@ -520,8 +520,8 @@
    <slot>lengthCH(int)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>564</x>
-     <y>224</y>
+     <x>465</x>
+     <y>225</y>
     </hint>
     <hint type="destinationlabel">
      <x>20</x>
@@ -584,8 +584,8 @@
    <slot>setDisabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>613</x>
-     <y>106</y>
+     <x>472</x>
+     <y>117</y>
     </hint>
     <hint type="destinationlabel">
      <x>268</x>
@@ -601,7 +601,7 @@
    <hints>
     <hint type="sourcelabel">
      <x>35</x>
-     <y>752</y>
+     <y>393</y>
     </hint>
     <hint type="destinationlabel">
      <x>4</x>
@@ -653,7 +653,7 @@
     </hint>
     <hint type="destinationlabel">
      <x>119</x>
-     <y>652</y>
+     <y>402</y>
     </hint>
    </hints>
   </connection>
@@ -669,10 +669,26 @@
     </hint>
     <hint type="destinationlabel">
      <x>119</x>
-     <y>519</y>
+     <y>402</y>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>origName</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>namePartBase</receiver>
+   <slot>origNameToggled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>64</x>
+     <y>310</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>73</x>
+     <y>402</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>partOfFilenameToggled(bool)</slot>
@@ -681,5 +697,6 @@
   <slot>showHelp()</slot>
   <slot>updateLabelTextChaned()</slot>
   <slot>grpOutOptionsToggled(bool)</slot>
+  <slot>origNameToggled(bool)</slot>
  </slots>
 </ui>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic