r21369 by craig -

scribus-commit scribus-commit at lists.scribus.net
Tue Jun 7 21:41:44 UTC 2016


Author: craig
Date: Tue Jun  7 21:41:44 2016
New Revision: 21369

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21369
Log:
#11575: Disable Ok button on file dialogs when nothing is selected for opening

Modified:
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/gtgettext.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.h
    trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.ui
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/contextmenu.cpp
    trunk/Scribus/scribus/ui/customfdialog.cpp
    trunk/Scribus/scribus/ui/customfdialog.h
    trunk/Scribus/scribus/ui/gtfiledialog.cpp
    trunk/Scribus/scribus/ui/gtfiledialog.h
    trunk/Scribus/scribus/ui/gtfiledialog.ui
    trunk/Scribus/scribus/ui/insertaframe.cpp
    trunk/Scribus/scribus/ui/newfile.cpp
    trunk/Scribus/scribus/ui/newfile.h
    trunk/Scribus/scribus/ui/paintmanager.cpp
    trunk/Scribus/scribus/ui/scfilewidget.cpp
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp	Tue Jun  7 21:41:44 2016
@@ -1819,7 +1819,7 @@
 	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 	QString wdir = dirs->get("pastefile", ".");
 	FPoint pastePoint = m_mouseCurrentPoint;
-	CustomFDialog dia(m_view, wdir, tr("Open"), allFormats, fdExistingFiles | fdShowImportOptions);
+	CustomFDialog dia(m_view, wdir, tr("Open"), allFormats, fdExistingFiles | fdShowImportOptions | fdDisableOk);
 	if (dia.exec() == QDialog::Accepted)
 		fileName = dia.selectedFile();
 	else

Modified: trunk/Scribus/scribus/gtgettext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/gtgettext.cpp
==============================================================================
--- trunk/Scribus/scribus/gtgettext.cpp	(original)
+++ trunk/Scribus/scribus/gtgettext.cpp	Tue Jun  7 21:41:44 2016
@@ -32,7 +32,6 @@
 #include "selection.h"
 #include "ui/gtdialogs.h"
 #include "gtwriter.h"
-//Added by qt3to4:
 #include <QPixmap>
 
 // Constructor

Modified: trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp	Tue Jun  7 21:41:44 2016
@@ -5,6 +5,7 @@
 for which a new license (GPL+exception) is in place.
 */
 #include <QDir>
+#include <QPushButton>
 #include "runscriptdialog.h"
 #include "prefsmanager.h"
 
@@ -28,9 +29,12 @@
 
 	if (!extEnable)
 		extChk->setVisible(false);
-
+	buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
+	connect(fileWidget, SIGNAL(currentChanged(const QString &)), this, SLOT(fileClicked(const QString &)));
 	connect(fileWidget, SIGNAL(accepted()), this, SLOT(accept()));
 	connect(fileWidget, SIGNAL(rejected()), this, SLOT(reject()));
+	connect(buttonBox, SIGNAL(accepted()), this, SLOT(okClicked()));
+	connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
 }
 
 RunScriptDialog::~RunScriptDialog()
@@ -55,3 +59,22 @@
 	m_lastScriptDir = fileWidget->directory().path();
 	QDialog::accept();
 }
+
+void RunScriptDialog::fileClicked(const QString& path)
+{
+	buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!path.isEmpty());
+}
+
+void RunScriptDialog::okClicked()
+{
+	QString selFile;
+	QStringList sel = fileWidget->selectedFiles();
+	if (sel.isEmpty())
+		return;
+	selFile = QDir::fromNativeSeparators(sel[0]);
+	QFileInfo fi(selFile);
+	if (fi.isDir())
+		fileWidget->gotoSelectedDirectory();
+	else
+		accept();
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.h	Tue Jun  7 21:41:44 2016
@@ -37,6 +37,8 @@
 
 	protected slots:
 		virtual void accept();
+		void fileClicked(const QString &path);
+		void okClicked();
 };
 
 #endif

Modified: trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.ui
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.ui	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.ui	Tue Jun  7 21:41:44 2016
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>RunScriptDialog</class>
- <widget class="QDialog" name="RunScriptDialog" >
-  <property name="geometry" >
+ <widget class="QDialog" name="RunScriptDialog">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,26 +10,26 @@
     <height>300</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Run Script</string>
   </property>
-  <layout class="QGridLayout" >
-   <item row="0" column="0" >
-    <widget class="ScFileWidget" native="1" name="fileWidget" />
+  <layout class="QGridLayout">
+   <item row="0" column="0">
+    <widget class="ScFileWidget" name="fileWidget" native="true"/>
    </item>
-   <item row="1" column="0" >
-    <widget class="QCheckBox" name="extChk" >
-     <property name="text" >
+   <item row="1" column="0">
+    <widget class="QCheckBox" name="extChk">
+     <property name="text">
       <string>Run as Extension Script</string>
      </property>
     </widget>
    </item>
-   <item row="2" column="0" >
-    <widget class="QDialogButtonBox" name="buttonBox" >
-     <property name="orientation" >
+   <item row="2" column="0">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="standardButtons" >
+     <property name="standardButtons">
       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
      </property>
     </widget>
@@ -44,38 +45,5 @@
   </customwidget>
  </customwidgets>
  <resources/>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>RunScriptDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>248</x>
-     <y>254</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>157</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>RunScriptDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>316</x>
-     <y>260</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>286</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Tue Jun  7 21:41:44 2016
@@ -3134,7 +3134,7 @@
 	allFormats += formats.join(";;");
 	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 	QString wdir = dirs->get("pastefile", ".");
-	CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdExistingFiles);
+	CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdExistingFiles | fdDisableOk);
 	QString fileName("");
 	if (dia.exec() == QDialog::Accepted)
 	{
@@ -3252,7 +3252,7 @@
 	else
 		docDir = docContext->get("docsopen", ".");
 	QString formats(FileLoader::getLoadFilterString());
-	QString fileName(CFileDialog( docDir, tr("Open"), formats));
+	QString fileName(CFileDialog( docDir, tr("Open"), formats, "", fdDisableOk));
 	if (fileName.isEmpty()) // User cancelled
 		return false;
 	QFileInfo fi(fileName);
@@ -3873,7 +3873,7 @@
 
 			QStringList fileNames;
 			fileNames.clear();
-			CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), docDir, tr("Open"), formatD, fdShowPreview | fdExistingFilesI);
+			CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), docDir, tr("Open"), formatD, fdShowPreview | fdExistingFilesI | fdDisableOk);
 			if (dia->exec() == QDialog::Accepted)
 				fileNames = dia->fileDialog->selectedFiles();
 			delete dia;

Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp	(original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp	Tue Jun  7 21:41:44 2016
@@ -34,8 +34,6 @@
 #include "undomanager.h"
 
 
-// #include "util.h" //just for tdebug
-
 ContextMenu::ContextMenu(Selection & sel, ScribusMainWindow *actionsParent, ScribusDoc* doc, QWidget * parent) :
 	QMenu(parent),
 	m_Sel(sel),
@@ -45,9 +43,7 @@
 {
 	if (m_Sel.count()>0)
 	{
-//		tDebug("process Selection start");
 		processSelection();
-//		tDebug("process Selection end");
 		createMenuItems_Selection();
 	}
 }

Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp	Tue Jun  7 21:41:44 2016
@@ -335,6 +335,8 @@
 	OKButton = new QPushButton( CommonStrings::tr_OK, this);
 	OKButton->setDefault( true );
 	hboxLayout1->addWidget( OKButton );
+	if (flags & fdDisableOk)
+		OKButton->setEnabled(false);
 	CancelB = new QPushButton( CommonStrings::tr_Cancel, this);
 	CancelB->setAutoDefault( false );
 	hboxLayout1->addWidget( CancelB );
@@ -492,7 +494,7 @@
 	}
 	fileDialog->setNameFilterDetailsVisible(false);
 	extZip = "gz";
-	connect(OKButton, SIGNAL(clicked()), this, SLOT(accept()));
+	connect(OKButton, SIGNAL(clicked()), this, SLOT(okClicked()));
 	connect(CancelB, SIGNAL(clicked()), this, SLOT(reject()));
 	connect(showPreview, SIGNAL(clicked()), this, SLOT(togglePreview()));
 	connect(fileDialog, SIGNAL(currentChanged(const QString &)), this, SLOT(fileClicked(const QString &)));
@@ -505,8 +507,22 @@
 
 void CustomFDialog::fileClicked(const QString &path)
 {
+	if (optionFlags & fdDisableOk)
+		OKButton->setEnabled(!path.isEmpty());
 	if (previewIsShown)
 		pw->GenPreview(path);
+}
+
+void CustomFDialog::okClicked()
+{
+	QString selFile=selectedFile();
+	if (selFile.isEmpty())
+		return;
+	QFileInfo fi(selFile);
+	if (fi.isDir())
+		fileDialog->gotoSelectedDirectory();
+	else
+		accept();
 }
 
 void CustomFDialog::togglePreview()

Modified: trunk/Scribus/scribus/ui/customfdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/customfdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.h	(original)
+++ trunk/Scribus/scribus/ui/customfdialog.h	Tue Jun  7 21:41:44 2016
@@ -77,7 +77,8 @@
 	fdDirectoriesOnly = 16, // Show only directories
 	fdHidePreviewCheckBox = 32, // Hide preview Checkbox
 	fdExistingFilesI = 64, // For multiple files
-	fdShowImportOptions = 128 // Show Vector Images Import Options
+	fdShowImportOptions = 128, // Show Vector Images Import Options
+	fdDisableOk = 256 // Disable Ok button, used for file open, import etc
 } fdFlags;
 
 /*! \brief A Scribus own file dialog.
@@ -131,6 +132,7 @@
 private slots:
 	//! \brief Go to the document home dir.
 	void fileClicked(const QString &path);
+	void okClicked();
 	void togglePreview();
 public slots:
 	//! \brief Switch the filename extensions by compress checkbox state.

Modified: trunk/Scribus/scribus/ui/gtfiledialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/gtfiledialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gtfiledialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/gtfiledialog.cpp	Tue Jun  7 21:41:44 2016
@@ -4,6 +4,7 @@
 a copyright and/or license notice that predates the release of Scribus 1.3.2
 for which a new license (GPL+exception) is in place.
 */
+#include <QPushButton>
 #include <QToolTip>
 #include <QTextCodec>
 #include "gtfiledialog.h"
@@ -45,9 +46,12 @@
 	}
 
 	loadSettings();
-
+	buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
+	connect(fileWidget, SIGNAL(currentChanged(const QString &)), this, SLOT(fileClicked(const QString &)));
 	connect(fileWidget, SIGNAL(accepted()), this, SLOT(accept()));
 	connect(fileWidget, SIGNAL(rejected()), this, SLOT(reject()));
+	connect(buttonBox, SIGNAL(accepted()), this, SLOT(okClicked()));
+	connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
 }
 
 QString gtFileDialog::selectedFile()
@@ -59,6 +63,25 @@
 {
 	saveSettings();
 	QDialog::accept();
+}
+
+void gtFileDialog::fileClicked(const QString& path)
+{
+	buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!path.isEmpty());
+}
+
+void gtFileDialog::okClicked()
+{
+	QString selFile;
+	QStringList sel = fileWidget->selectedFiles();
+	if (sel.isEmpty())
+		return;
+	selFile = QDir::fromNativeSeparators(sel[0]);
+	QFileInfo fi(selFile);
+	if (fi.isDir())
+		fileWidget->gotoSelectedDirectory();
+	else
+		accept();
 }
 
 void gtFileDialog::loadSettings(void)

Modified: trunk/Scribus/scribus/ui/gtfiledialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/gtfiledialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/gtfiledialog.h	(original)
+++ trunk/Scribus/scribus/ui/gtfiledialog.h	Tue Jun  7 21:41:44 2016
@@ -29,6 +29,8 @@
 
 public slots:
 	virtual void accept();
+	void fileClicked(const QString &path);
+	void okClicked();
 
 protected:
 	void loadSettings(void);

Modified: trunk/Scribus/scribus/ui/gtfiledialog.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/gtfiledialog.ui
==============================================================================
--- trunk/Scribus/scribus/ui/gtfiledialog.ui	(original)
+++ trunk/Scribus/scribus/ui/gtfiledialog.ui	Tue Jun  7 21:41:44 2016
@@ -86,38 +86,5 @@
   </customwidget>
  </customwidgets>
  <resources/>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>gtFileDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>248</x>
-     <y>254</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>157</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>gtFileDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>316</x>
-     <y>260</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>286</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>

Modified: trunk/Scribus/scribus/ui/insertaframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/insertaframe.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/insertaframe.cpp	(original)
+++ trunk/Scribus/scribus/ui/insertaframe.cpp	Tue Jun  7 21:41:44 2016
@@ -231,7 +231,7 @@
 		docDir = prefsManager->prefsFile->getContext("dirs")->get("images", ".");
 		
 	QString fileName("");
-	CustomFDialog dia(this, docDir, tr("Open"), formatD, fdShowPreview | fdExistingFiles);
+	CustomFDialog dia(this, docDir, tr("Open"), formatD, fdShowPreview | fdExistingFiles | fdDisableOk);
 	if (dia.exec() == QDialog::Accepted)
 		fileName = dia.selectedFile();
 	

Modified: trunk/Scribus/scribus/ui/newfile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/newfile.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.cpp	(original)
+++ trunk/Scribus/scribus/ui/newfile.cpp	Tue Jun  7 21:41:44 2016
@@ -170,10 +170,6 @@
 		connect(recentDocListBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(recentDocListBox_doubleClicked()));
 		connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(adjustTitles(int)));
 	}
-
-// 	setMinimumSize(minimumSizeHint());
-//  	setMaximumSize(minimumSizeHint());
-// 	resize(minimumSizeHint());
 }
 
 void NewDoc::createNewDocPage()
@@ -392,6 +388,7 @@
 	connect(keyCatcher, SIGNAL(homePressed()), this, SLOT(gotoHomeDirectory()));
 	connect(keyCatcher, SIGNAL(parentPressed()), this, SLOT(gotoParentDirectory()));
 	connect(keyCatcher, SIGNAL(enterSelectedPressed()), this, SLOT(gotoSelectedDirectory()));
+	connect(fileDialog, SIGNAL(currentChanged(const QString &)), this, SLOT(openFileDialogFileClicked(const QString &)));
 	connect(fileDialog, SIGNAL(filesSelected(const QStringList &)), this, SLOT(openFile()));
 	connect(fileDialog, SIGNAL(rejected()), this, SLOT(reject()));
 }
@@ -554,6 +551,12 @@
 			QStringList files = fileDialog->selectedFiles();
 			if (files.count() != 0)
 				m_selectedFile = QDir::fromNativeSeparators(files[0]);
+			QFileInfo fi(m_selectedFile);
+			if (fi.isDir())
+			{
+				fileDialog->setDirectory(fi.absoluteFilePath());
+				return;
+			}
 		}
 		else if (m_tabSelected == NewDoc::OpenRecentTab) // open recent doc
 		{
@@ -661,15 +664,16 @@
 void NewDoc::adjustTitles(int tab)
 {
 	if (tab == 0)
-		setWindowTitle( tr( "New Document" ) );
+		setWindowTitle(tr("New Document"));
 	else if (tab == 1)
-		setWindowTitle( tr("New from Template"));
+		setWindowTitle(tr("New from Template"));
 	else if (tab == 2)
-		setWindowTitle( tr("Open Existing Document"));
+		setWindowTitle(tr("Open Existing Document"));
 	else if (tab == 3)
- 		setWindowTitle( tr("Open Recent Document"));
+		setWindowTitle(tr("Open Recent Document"));
  	else
-		setWindowTitle( tr( "New Document" ) );
+		setWindowTitle(tr("New Document"));
+	OKButton->setEnabled(tab!=2);
 }
 
 void NewDoc::locationDropped(QString fileUrl)
@@ -698,7 +702,6 @@
 	if (s.count()>0)
 	{
 		QFileInfo fi(s.first());
-		qDebug()<<s.first()<<fi.absoluteFilePath();
 		if (fi.isDir())
 			fileDialog->setDirectory(fi.absoluteFilePath());
 	}
@@ -720,3 +723,8 @@
 	if (fi.exists())
 		fileDialog->setDirectory(dp);
 }
+
+void NewDoc::openFileDialogFileClicked(const QString& path)
+{
+	OKButton->setEnabled(!path.isEmpty());
+}

Modified: trunk/Scribus/scribus/ui/newfile.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/newfile.h
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.h	(original)
+++ trunk/Scribus/scribus/ui/newfile.h	Tue Jun  7 21:41:44 2016
@@ -65,7 +65,7 @@
 	} ActionSelected;
 
 	NewDoc( QWidget* parent, const QStringList& recentDocs, bool startUp = false, QString lang = "");
-	~NewDoc() {};
+	~NewDoc() {}
 	void createNewDocPage();
 	void createNewFromTempPage();
 	void createOpenDocPage();
@@ -150,6 +150,7 @@
 	void gotoSelectedDirectory();
 	void gotoDesktopDirectory();
 	void gotoHomeDirectory();
+	void openFileDialogFileClicked(const QString &path);
 
 protected:
 	QVBoxLayout* TabbedNewDocLayout;

Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp	(original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp	Tue Jun  7 21:41:44 2016
@@ -1029,7 +1029,7 @@
 			allFormats += formats;
 			PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 			QString wdir = dirs->get("gradients", ".");
-			CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdHidePreviewCheckBox | fdExistingFiles);
+			CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdHidePreviewCheckBox | fdExistingFiles | fdDisableOk);
 			if (dia.exec() == QDialog::Accepted)
 				fileName = dia.selectedFile();
 			else
@@ -1067,7 +1067,7 @@
 			QString ooexts(" *.acb *.aco *.ase *.skp *.soc *.gpl *.xml *.sbz");
 			ooexts += extra;
 			QString filter = tr("All Supported Formats (%1);;Documents (%2);;Other Files (%3);;All Files (*)").arg(docexts+" "+aiepsext+ooexts).arg(docexts).arg(aiepsext+ooexts);
-			CustomFDialog dia(this, wdir, tr("Import Colors"), filter, fdHidePreviewCheckBox);
+			CustomFDialog dia(this, wdir, tr("Import Colors"), filter, fdHidePreviewCheckBox | fdDisableOk);
 			if (dia.exec() == QDialog::Accepted)
 				fileName = dia.selectedFile();
 			else
@@ -1181,7 +1181,7 @@
 			allFormats += formats.join(";;");
 			PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
 			QString wdir = dirs->get("patterns", ".");
-			CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdHidePreviewCheckBox | fdExistingFiles);
+			CustomFDialog dia(this, wdir, tr("Open"), allFormats, fdHidePreviewCheckBox | fdExistingFiles | fdDisableOk);
 			if (dia.exec() == QDialog::Accepted)
 				fileName = dia.selectedFile();
 			else

Modified: trunk/Scribus/scribus/ui/scfilewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/scfilewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scfilewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/scfilewidget.cpp	Tue Jun  7 21:41:44 2016
@@ -97,10 +97,10 @@
 void ScFileWidget::gotoSelectedDirectory()
 {
 	QStringList s(selectedFiles());
-	if (s.count()>0)
+	if (!s.isEmpty())
 	{
 		QFileInfo fi(s.first());
-		qDebug()<<s.first()<<fi.absoluteFilePath();
+//		qDebug()<<s.first()<<fi.absoluteFilePath();
 		if (fi.isDir())
 			setDirectory(fi.absoluteFilePath());
 	}

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21369&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Tue Jun  7 21:41:44 2016
@@ -3286,7 +3286,7 @@
 		QString fileName = "";
 		PrefsContext* dirs = prefsManager->prefsFile->getContext("dirs");
 		QString wdir = dirs->get("story_load", prefsManager->documentDir());
-		CustomFDialog dia(this, wdir, tr("Open"), tr("Text Files (*.txt);;All Files (*)"), fdExistingFiles | fdShowCodecs);
+		CustomFDialog dia(this, wdir, tr("Open"), tr("Text Files (*.txt);;All Files (*)"), fdExistingFiles | fdShowCodecs | fdDisableOk);
 		if (dia.exec() != QDialog::Accepted)
 			return;
 		LoadEnc = dia.TxCodeM->currentText();




More information about the scribus-commit mailing list