Removed «Open in External Application», added button «Open File in Folder» and enlargened the width; refs #145

master
Marc Wäckerlin 13 years ago
parent 9bfd8c4e48
commit 1c04103904
  1. 57
      src/qbrowserlib/qbrowserlib_de.ts
  2. 57
      src/qbrowserlib/qbrowserlib_en.ts
  3. 57
      src/qbrowserlib/qbrowserlib_fr.ts
  4. 57
      src/qbrowserlib/qbrowserlib_it.ts
  5. 35
      src/qbrowserlib/saveorrun.hxx
  6. 32
      src/qbrowserlib/saveorrun.ui

@ -70,65 +70,70 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="52"/>
<location filename="saveorrun.ui" line="109"/>
<location filename="saveorrun.ui" line="65"/>
<location filename="saveorrun.ui" line="129"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="59"/>
<source>Save</source>
<location filename="saveorrun.ui" line="72"/>
<source>Save As File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="66"/>
<location filename="saveorrun.ui" line="79"/>
<source>remember save path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="77"/>
<location filename="saveorrun.ui" line="89"/>
<source>Open File in Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="97"/>
<source>Open in External Application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="83"/>
<location filename="saveorrun.ui" line="103"/>
<source>remember tool for this type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="116"/>
<location filename="saveorrun.ui" line="136"/>
<source>Run</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="124"/>
<location filename="saveorrun.ui" line="144"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="144"/>
<location filename="saveorrun.ui" line="164"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="157"/>
<location filename="saveorrun.ui" line="192"/>
<location filename="saveorrun.ui" line="227"/>
<location filename="saveorrun.ui" line="177"/>
<location filename="saveorrun.ui" line="212"/>
<location filename="saveorrun.ui" line="247"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="179"/>
<location filename="saveorrun.ui" line="199"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="214"/>
<location filename="saveorrun.ui" line="234"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="260"/>
<location filename="saveorrun.ui" line="280"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
@ -578,12 +583,14 @@ p, li { white-space: pre-wrap; }
<context>
<name>qbrowserlib::SaveOrRun</name>
<message>
<location filename="saveorrun.hxx" line="131"/>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="156"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="132"/>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="157"/>
<source>File already exists:
%1
@ -592,12 +599,12 @@ Overwrite?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="169"/>
<source>No Program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="170"/>
<source>Not an executable Program:
%1
@ -606,23 +613,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="157"/>
<location filename="saveorrun.hxx" line="182"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="170"/>
<location filename="saveorrun.hxx" line="195"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="182"/>
<location filename="saveorrun.hxx" line="207"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="184"/>
<location filename="saveorrun.hxx" line="209"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
@ -631,7 +638,7 @@ Specify full path to executable program</source>
<context>
<name>qbrowserlib::SaveOrRunDialog</name>
<message>
<location filename="saveorrun.hxx" line="236"/>
<location filename="saveorrun.hxx" line="261"/>
<source>Unknown File Type</source>
<translation type="unfinished"></translation>
</message>

@ -70,65 +70,70 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="52"/>
<location filename="saveorrun.ui" line="109"/>
<location filename="saveorrun.ui" line="65"/>
<location filename="saveorrun.ui" line="129"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="59"/>
<source>Save</source>
<location filename="saveorrun.ui" line="72"/>
<source>Save As File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="66"/>
<location filename="saveorrun.ui" line="79"/>
<source>remember save path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="77"/>
<location filename="saveorrun.ui" line="89"/>
<source>Open File in Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="97"/>
<source>Open in External Application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="83"/>
<location filename="saveorrun.ui" line="103"/>
<source>remember tool for this type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="116"/>
<location filename="saveorrun.ui" line="136"/>
<source>Run</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="124"/>
<location filename="saveorrun.ui" line="144"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="144"/>
<location filename="saveorrun.ui" line="164"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="157"/>
<location filename="saveorrun.ui" line="192"/>
<location filename="saveorrun.ui" line="227"/>
<location filename="saveorrun.ui" line="177"/>
<location filename="saveorrun.ui" line="212"/>
<location filename="saveorrun.ui" line="247"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="179"/>
<location filename="saveorrun.ui" line="199"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="214"/>
<location filename="saveorrun.ui" line="234"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="260"/>
<location filename="saveorrun.ui" line="280"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
@ -578,12 +583,14 @@ p, li { white-space: pre-wrap; }
<context>
<name>qbrowserlib::SaveOrRun</name>
<message>
<location filename="saveorrun.hxx" line="131"/>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="156"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="132"/>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="157"/>
<source>File already exists:
%1
@ -592,12 +599,12 @@ Overwrite?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="169"/>
<source>No Program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="170"/>
<source>Not an executable Program:
%1
@ -606,23 +613,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="157"/>
<location filename="saveorrun.hxx" line="182"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="170"/>
<location filename="saveorrun.hxx" line="195"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="182"/>
<location filename="saveorrun.hxx" line="207"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="184"/>
<location filename="saveorrun.hxx" line="209"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
@ -631,7 +638,7 @@ Specify full path to executable program</source>
<context>
<name>qbrowserlib::SaveOrRunDialog</name>
<message>
<location filename="saveorrun.hxx" line="236"/>
<location filename="saveorrun.hxx" line="261"/>
<source>Unknown File Type</source>
<translation type="unfinished"></translation>
</message>

@ -70,65 +70,70 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="52"/>
<location filename="saveorrun.ui" line="109"/>
<location filename="saveorrun.ui" line="65"/>
<location filename="saveorrun.ui" line="129"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="59"/>
<source>Save</source>
<location filename="saveorrun.ui" line="72"/>
<source>Save As File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="66"/>
<location filename="saveorrun.ui" line="79"/>
<source>remember save path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="77"/>
<location filename="saveorrun.ui" line="89"/>
<source>Open File in Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="97"/>
<source>Open in External Application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="83"/>
<location filename="saveorrun.ui" line="103"/>
<source>remember tool for this type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="116"/>
<location filename="saveorrun.ui" line="136"/>
<source>Run</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="124"/>
<location filename="saveorrun.ui" line="144"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="144"/>
<location filename="saveorrun.ui" line="164"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="157"/>
<location filename="saveorrun.ui" line="192"/>
<location filename="saveorrun.ui" line="227"/>
<location filename="saveorrun.ui" line="177"/>
<location filename="saveorrun.ui" line="212"/>
<location filename="saveorrun.ui" line="247"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="179"/>
<location filename="saveorrun.ui" line="199"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="214"/>
<location filename="saveorrun.ui" line="234"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="260"/>
<location filename="saveorrun.ui" line="280"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
@ -578,12 +583,14 @@ p, li { white-space: pre-wrap; }
<context>
<name>qbrowserlib::SaveOrRun</name>
<message>
<location filename="saveorrun.hxx" line="131"/>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="156"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="132"/>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="157"/>
<source>File already exists:
%1
@ -592,12 +599,12 @@ Overwrite?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="169"/>
<source>No Program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="170"/>
<source>Not an executable Program:
%1
@ -606,23 +613,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="157"/>
<location filename="saveorrun.hxx" line="182"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="170"/>
<location filename="saveorrun.hxx" line="195"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="182"/>
<location filename="saveorrun.hxx" line="207"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="184"/>
<location filename="saveorrun.hxx" line="209"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
@ -631,7 +638,7 @@ Specify full path to executable program</source>
<context>
<name>qbrowserlib::SaveOrRunDialog</name>
<message>
<location filename="saveorrun.hxx" line="236"/>
<location filename="saveorrun.hxx" line="261"/>
<source>Unknown File Type</source>
<translation type="unfinished"></translation>
</message>

@ -70,65 +70,70 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="52"/>
<location filename="saveorrun.ui" line="109"/>
<location filename="saveorrun.ui" line="65"/>
<location filename="saveorrun.ui" line="129"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="59"/>
<source>Save</source>
<location filename="saveorrun.ui" line="72"/>
<source>Save As File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="66"/>
<location filename="saveorrun.ui" line="79"/>
<source>remember save path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="77"/>
<location filename="saveorrun.ui" line="89"/>
<source>Open File in Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="97"/>
<source>Open in External Application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="83"/>
<location filename="saveorrun.ui" line="103"/>
<source>remember tool for this type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="116"/>
<location filename="saveorrun.ui" line="136"/>
<source>Run</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="124"/>
<location filename="saveorrun.ui" line="144"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="144"/>
<location filename="saveorrun.ui" line="164"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="157"/>
<location filename="saveorrun.ui" line="192"/>
<location filename="saveorrun.ui" line="227"/>
<location filename="saveorrun.ui" line="177"/>
<location filename="saveorrun.ui" line="212"/>
<location filename="saveorrun.ui" line="247"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="179"/>
<location filename="saveorrun.ui" line="199"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="214"/>
<location filename="saveorrun.ui" line="234"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="260"/>
<location filename="saveorrun.ui" line="280"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
@ -578,12 +583,14 @@ p, li { white-space: pre-wrap; }
<context>
<name>qbrowserlib::SaveOrRun</name>
<message>
<location filename="saveorrun.hxx" line="131"/>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="156"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="132"/>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="157"/>
<source>File already exists:
%1
@ -592,12 +599,12 @@ Overwrite?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="144"/>
<location filename="saveorrun.hxx" line="169"/>
<source>No Program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="145"/>
<location filename="saveorrun.hxx" line="170"/>
<source>Not an executable Program:
%1
@ -606,23 +613,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="157"/>
<location filename="saveorrun.hxx" line="182"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="170"/>
<location filename="saveorrun.hxx" line="195"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="182"/>
<location filename="saveorrun.hxx" line="207"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="184"/>
<location filename="saveorrun.hxx" line="209"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
@ -631,7 +638,7 @@ Specify full path to executable program</source>
<context>
<name>qbrowserlib::SaveOrRunDialog</name>
<message>
<location filename="saveorrun.hxx" line="236"/>
<location filename="saveorrun.hxx" line="261"/>
<source>Unknown File Type</source>
<translation type="unfinished"></translation>
</message>

@ -19,6 +19,7 @@
#include <QtGui/QFileSystemModel>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QMessageBox>
#include <QtGui/QDesktopServices>
#include <memory>
#include <cassert>
@ -46,8 +47,9 @@ namespace qbrowserlib {
QString obj(remoteFilename());
_rememberPath->setVisible(false);
_rememberTool->setVisible(false);
_program->setText(QCoreApplication::applicationDirPath()
+QDir::separator());
// _program->setText(QDesktopServices::storageLocation
// (QDesktopServices::ApplicationsLocation));
delete _openInExternalApplication; _openInExternalApplication = 0;
_object->setText(obj);
_type->setText(type);
_source->setText(src);
@ -103,7 +105,8 @@ namespace qbrowserlib {
QString program() {
TRC;
return _program->text();
return QString();
// return _program->text();
}
public Q_SLOTS:
@ -117,6 +120,16 @@ namespace qbrowserlib {
accept();
}
void open() {
TRC;
QFile file(filename());
file.open(QIODevice::WriteOnly);
file.write(_reply->readAll());
file.close();
QDesktopServices::openUrl(QUrl::fromLocalFile(file.fileName()));
accept();
}
void run() {
TRC; LOG<<program()<<filename();
_executor->run(_reply, filename(), program()+" %1");
@ -137,6 +150,18 @@ namespace qbrowserlib {
save();
}
void on__openFolder_clicked(bool=true) {
TRC;
if (QFileInfo(filename()).exists()
&& QMessageBox::question(this, tr("File Exists"),
tr("File already exists:\n\n"
"%1\n\n"
"Overwrite?").arg(filename()),
QMessageBox::Yes|QMessageBox::No)
== QMessageBox::No) return;
open();
}
void on__openFileIn_clicked(bool=true) {
TRC;
if (!QFile::exists(program())
@ -168,9 +193,9 @@ namespace qbrowserlib {
TRC;
QString openFile
(QFileDialog::getOpenFileName(this, tr("Open File With ..."),
_program->text()));
program()));
if (!openFile.size()) return;
_program->setText(openFile);
// _program->setText(openFile);
on__openFileIn_clicked();
}

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>610</width>
<height>154</height>
<width>719</width>
<height>169</height>
</rect>
</property>
<property name="windowTitle">
@ -38,7 +38,20 @@
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLineEdit" name="_filename"/>
<widget class="QLineEdit" name="_filename">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="_browseSaveAs">
@ -53,10 +66,10 @@
</property>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<item row="0" column="2">
<widget class="QCommandLinkButton" name="_saveFileAs">
<property name="text">
<string>Save</string>
<string>Save As File</string>
</property>
</widget>
</item>
@ -70,9 +83,16 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCommandLinkButton" name="_openFolder">
<property name="text">
<string>Open File in Folder</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<widget class="QWidget" name="_openInExternalApplication">
<attribute name="title">
<string>Open in External Application</string>
</attribute>

Loading…
Cancel
Save