1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-22 06:43:45 +02:00

kinyin: resize open/save dialog to 320x240

This commit is contained in:
kyak 2011-02-26 00:40:14 +03:00
parent 463c20c164
commit e50bd7fc78

View File

@ -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);