From e50bd7fc78210c038488d1d495b4a3a063f7061d Mon Sep 17 00:00:00 2001 From: kyak Date: Sat, 26 Feb 2011 00:40:14 +0300 Subject: [PATCH] kinyin: resize open/save dialog to 320x240 --- kinyin/patches/002-open-save.patch | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 kinyin/patches/002-open-save.patch diff --git a/kinyin/patches/002-open-save.patch b/kinyin/patches/002-open-save.patch new file mode 100644 index 0000000..2653fe4 --- /dev/null +++ b/kinyin/patches/002-open-save.patch @@ -0,0 +1,38 @@ +--- kinyin-0.43.orig/qt4/edwidget.cc 2009-07-21 10:55:43.000000000 +0400 ++++ kinyin-0.43/qt4/edwidget.cc 2011-02-26 00:31:56.000000000 +0300 +@@ -177,7 +177,16 @@ + } + void EdWidget::open() { + #ifndef QT_NO_FILEDIALOG +- QString fname = QFileDialog::getOpenFileName( this); ++ QFileDialog dlg; ++ QStringList fnames; ++ QString fname; ++ dlg.resize(320,240); ++ dlg.setFileMode(QFileDialog::ExistingFile); ++ if (dlg.exec()) { ++ fnames = dlg.selectedFiles(); ++ fname = fnames[0]; ++ } ++ //QString fname = QFileDialog::getOpenFileName( this); + QFile file( fname ); + if ( file.open( QFile::ReadOnly ) ) { + QTextStream tstream( &file ); +@@ -189,7 +198,16 @@ + } + void EdWidget::save() { + #ifndef QT_NO_FILEDIALOG +- QString fname = QFileDialog::getSaveFileName( this ); ++ QFileDialog dlg; ++ QStringList fnames; ++ QString fname; ++ dlg.resize(320,240); ++ dlg.setFileMode(QFileDialog::AnyFile); ++ if (dlg.exec()) { ++ fnames = dlg.selectedFiles(); ++ fname = fnames[0]; ++ } ++ //QString fname = QFileDialog::getSaveFileName( this ); + QFile file( fname ); + if ( file.open( QFile::WriteOnly ) ) { + QTextStream tstream(&file);