[Kst] branches/work/kst/portto4/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Mon Feb 1 21:21:39 CET 2010
SVN commit 1083715 by netterfield:
Finish up UI changes for revised font specifications
BUG: 221749
Change \_ to _ in data mode line display.
Demo of setting print mode from the command line (syntax will likely change)
CCBUG: 216746
M +1 -2 devel-docs/Kst2Specs/Bugs
M +8 -0 devel-docs/Kst2Specs/FixedBugs
M +26 -0 devel-docs/Kst2Specs/Wishlist
M +7 -1 src/libkst/namedobject.cpp
M +2 -1 src/libkst/namedobject.h
M +9 -7 src/libkstapp/applicationsettings.cpp
M +7 -1 src/libkstapp/commandlineparser.cpp
M +4 -2 src/libkstapp/commandlineparser.h
M +0 -1 src/libkstapp/defaultlabelpropertiestab.cpp
M +17 -1 src/libkstapp/defaultlabelpropertiestab.ui
M +15 -16 src/libkstapp/generaltab.ui
M +9 -3 src/libkstapp/mainwindow.cpp
M +1 -1 src/libkstapp/mainwindow.h
M +2 -2 src/libkstapp/plotrenderitem.cpp
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Bugs #1083714:1083715
@@ -10,6 +10,7 @@
Curves are rendered slightly above where they should be. Take a plot
that it is of very boring data (like always exactly zero) and it'll be
drawn one pixel above the axis tick mark for zero.
+ (Ticks and curves use different rounding)
--------------------
@@ -40,5 +41,3 @@
------------------
Cleanup layout totally sucks!
-
-
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/FixedBugs #1083714:1083715
@@ -1182,3 +1182,11 @@
INDEX is near the edge of the plot, the plot will get narrower so that
the axis number can fit in the window. I don't think that plots should
change size at all when data is live.
+--------------------
+
+2. When in data mode, the status bar shows the backslashes used to
+escape characters in curve names. I think that maybe (but maybe not)
+the status bar should render the names (with subscripts and
+superscripts, for example). The status bar should certainly not show
+escaping backslashes.
+
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Wishlist #1083714:1083715
@@ -75,3 +75,29 @@
the axis labels are large, they often overwrite each other (so you can't
tell any of the numbers apart).
+--------------------
+
+1. When the x axis set to to interpret as standard C time, the time is
+displayed correctly on the axis labels, but just displays as the raw
+value in the status bar (on the lower left of the window). This is both
+in "normal mode" and in "data mode".
+
+--------------------
+
+3. Data mode no longer easily finds the point nearest the cursor.
+In kst 1.x, you could easily get datamode to locate points on a spike or
+other outlier on a dense curve, but now it actually seems to pick the
+point at the current x value, even if the cursor is significantly closer
+to a different point.
+
+--------------------
+
+4. When displaying an axis as time, "offset mode" turns on (good), but
+only displays offsets in seconds (bad). When a day's worth of data is
+on the screen, the unit shouldn't be seconds, or even minutes.
+
+--------------------
+
+5. When displaying an axis as time and offset mode is on, the offset
+steps should be natural for the type of units. 100 seconds is not
+natural (120 would be, or better, 2 minutes; see the bug above).
\ No newline at end of file
--- branches/work/kst/portto4/kst/src/libkst/namedobject.cpp #1083714:1083715
@@ -41,12 +41,18 @@
}
-// new Name system
QString NamedObject::Name() const {
return descriptiveName()+" ("+shortName()+")";
}
+QString NamedObject::CleanedName() const {
+ QString clean_name = Name();
+ clean_name.replace("\\_","_");
+
+ return clean_name;
+}
+
QString NamedObject::descriptiveName() const {
if (_manualDescriptiveName.isEmpty()) {
return _automaticDescriptiveName();
--- branches/work/kst/portto4/kst/src/libkst/namedobject.h #1083714:1083715
@@ -79,7 +79,8 @@
};
// name system: see object names devel doc
- QString Name() const; // eg GYRO1:V1
+ QString Name() const; // eg GYRO1 (V1)
+ QString CleanedName() const; // all \_ replaced with _
QString descriptiveName() const; // eg GYRO1: automatic or manual
QString shortName() const; // eg V1: always automatically generated
virtual QString descriptionTip() const = 0; // description for tooltips
--- branches/work/kst/portto4/kst/src/libkstapp/applicationsettings.cpp #1083714:1083715
@@ -25,6 +25,9 @@
namespace Kst {
+const double A4Width = (29.7 - 3.0); // A4 with a 1.5 cm margin;
+const double A4Height = (21.0 - 3.0); // A4 with a 1.5 cm margin;
+
static ApplicationSettings *_self = 0;
void ApplicationSettings::cleanup() {
delete _self;
@@ -50,9 +53,6 @@
// several seconds delay when opening application on my system.
_useOpenGL = _settings->value("general/opengl", QVariant(QGLPixelBuffer::hasOpenGLPbuffers())).toBool();
- _refViewWidth = _settings->value("general/referenceviewwidth", QVariant(17)).toDouble();
- _refViewHeight = _settings->value("general/referenceviewheight", QVariant(13)).toDouble();
- _minFontSize = _settings->value("general/minimumfontsize", QVariant(7.0)).toDouble();
_maxUpdate = _settings->value("general/minimumupdateperiod", QVariant(200)).toInt();
_showGrid = _settings->value("grid/showgrid", QVariant(false)).toBool();
@@ -77,11 +77,13 @@
_backgroundBrush = QBrush(gradient);
}
- // FIXME: should use 'set as default' checkbox in label dialog, not here.
- QString fontString = _settings->value("defaultlabelproperties/defaultfont", QFont()).toString();
+ QString fontString = _settings->value("fonts/defaultfont", QFont()).toString();
_defaultFont.fromString(fontString);
- _defaultFontScale = _settings->value("defaultlabelproperties/defaultfontscale", QVariant(16)).toDouble();
- _defaultFontColor = QColor(_settings->value("defaultlabelproperties/defaultfontcolor", "black").toString());
+ _defaultFontScale = _settings->value("fonts/defaultfontscale", QVariant(13)).toDouble();
+ _defaultFontColor = QColor(_settings->value("fonts/defaultfontcolor", "black").toString());
+ _refViewWidth = _settings->value("fonts/referenceviewwidth", QVariant(A4Width)).toDouble();
+ _refViewHeight = _settings->value("fonts/referenceviewheight", QVariant(A4Height)).toDouble();
+ _minFontSize = _settings->value("fonts/minimumfontsize", QVariant(4.0)).toDouble();
_shareAxis = _settings->value("childviewoptions/shareaxis", QVariant(true)).toBool();
--- branches/work/kst/portto4/kst/src/libkstapp/commandlineparser.cpp #1083714:1083715
@@ -48,6 +48,10 @@
"kst datasource OPTIONS [datasource OPTIONS []]\n"
"\n"
"OPTIONS are read and interpreted in order. Except for data object options, all are applied to all future data objects, unless later overridden.\n"
+"Output Options:\n"
+" --print <filename> Print to file and exit.\n"
+" --landscape Pring in landscape mode (default is portrait).\n"
+" --png <filename> Render to a png image, and exit.\n"
"File Options:\n"
" -f <startframe> default: 'end' counts from end.\n"
" -n <numframes> default: 'end' reads to end of file\n"
@@ -130,7 +134,7 @@
_useLines(true), _usePoints(false), _overrideStyle(false), _sampleRate(1.0),
_numFrames(-1), _startFrame(-1),
_skip(0), _plotName(), _errorField(), _fileName(), _xField(QString("INDEX")),
- _pngFile(QString()), _plotItem(0) {
+ _pngFile(QString()), _printFile(QString()), _landscape(false), _plotItem(0) {
Q_ASSERT(QCoreApplication::instance());
_arguments = QCoreApplication::instance()->arguments();
@@ -547,6 +551,8 @@
*ok = _setStringArg(_pngFile, i18n("Usage: --png <filename>\n"));
} else if (arg == "--print") {
*ok = _setStringArg(_printFile, i18n("Usage: --print <filename>\n"));
+ } else if (arg == "--landscape") {
+ _landscape = true;
} else { // arg is not an option... must be a file
if (new_fileList) { // if the file list has been used, clear it.
_fileNames.clear();
--- branches/work/kst/portto4/kst/src/libkstapp/commandlineparser.h #1083714:1083715
@@ -28,8 +28,9 @@
bool processCommandLine(bool *ok);
QString kstFileName();
- QString pngFile() {return _pngFile;}
- QString printFile() {return _printFile;}
+ QString pngFile() const {return _pngFile;}
+ QString printFile() const {return _printFile;}
+ bool landscape() const {return _landscape;}
private:
bool _doAve;
bool _doSkip;
@@ -48,6 +49,7 @@
QString _xField;
QString _pngFile;
QString _printFile;
+ bool _landscape;
QStringList _fileNames;
QStringList _arguments;
--- branches/work/kst/portto4/kst/src/libkstapp/defaultlabelpropertiestab.cpp #1083714:1083715
@@ -13,7 +13,6 @@
namespace Kst {
-
const double USLetterWidth = (11.0 - 1.0)*2.54; // 11 inches with a 1/2" margin in cm
const double USLetterHeight = ((8.5 - 1)*2.54); // 8.5 inches, with a 1/2" margin, in cm.
const double A4Width = (29.7 - 3.0); // A4 with a 1.5 cm margin;
--- branches/work/kst/portto4/kst/src/libkstapp/defaultlabelpropertiestab.ui #1083714:1083715
@@ -31,6 +31,12 @@
</item>
<item row="3" column="1" colspan="5">
<widget class="QDoubleSpinBox" name="_labelFontScale">
+ <property name="toolTip">
+ <string>Size of default font when page is displayed at 'Reference View Size'.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Fonts are scaled with the size of window or page. This is the default font size when the window or page is resized to 'Reverence View Size'.</string>
+ </property>
<property name="decimals">
<number>1</number>
</property>
@@ -95,6 +101,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>On window resize, fonts will be displayed at least this large.</string>
+ </property>
</widget>
</item>
<item row="5" column="0">
@@ -108,7 +117,14 @@
</widget>
</item>
<item row="5" column="1" colspan="5">
- <widget class="QComboBox" name="_referenceViewSizeCombo"/>
+ <widget class="QComboBox" name="_referenceViewSizeCombo">
+ <property name="toolTip">
+ <string>When the window is this large, fonts will have stated size.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Fonts are scaled with the window or print size. When the window/print is this large, the font sizes stated will be accurate.</string>
+ </property>
+ </widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label">
--- branches/work/kst/portto4/kst/src/libkstapp/generaltab.ui #1083714:1083715
@@ -14,7 +14,7 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="2" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>&Period Between Updates (ms):</string>
@@ -27,7 +27,7 @@
</property>
</widget>
</item>
- <item row="2" column="1" colspan="2">
+ <item row="1" column="1" colspan="2">
<widget class="QSpinBox" name="_maxUpdate">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -35,6 +35,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>Dynamic files update this fast,. or slower.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Minimum time between updates when looking at dynamic files. If there is a lot of processing, it might take longer.</string>
+ </property>
<property name="minimum">
<number>10</number>
</property>
@@ -49,7 +55,7 @@
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="2" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -62,21 +68,14 @@
</property>
</spacer>
</item>
- <item row="1" column="1" colspan="2">
- <widget class="QComboBox" name="_referenceViewSizeCombo"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Reference View Size:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
<item row="0" column="1">
<widget class="QCheckBox" name="_useOpenGL">
+ <property name="toolTip">
+ <string>Render using openGL. This is not always better.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Rendering using OpenGL is faster on some architectures, but very buggy on others (depending on the video driver). This might help, or might cause things to go horribly wrong.</string>
+ </property>
<property name="text">
<string>Use Open&GL</string>
</property>
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1083714:1083715
@@ -254,7 +254,7 @@
ok = false;
}
if (!P.printFile().isEmpty()) {
- printFromCommandLine(P.printFile());
+ printFromCommandLine(P.printFile(), P.landscape());
ok = false;
}
if (!P.kstFileName().isEmpty()) {
@@ -378,9 +378,15 @@
}
}
-void MainWindow::printFromCommandLine(const QString &printFileName) {
+void MainWindow::printFromCommandLine(const QString &printFileName, bool landscape) {
QPrinter printer(QPrinter::ScreenResolution);
printer.setOutputFileName(printFileName);
+ if (landscape) {
+ printer.setOrientation(QPrinter::Landscape);
+ } else {
+ printer.setOrientation(QPrinter::Portrait);
+ }
+
printer.setPrintRange(QPrinter::AllPages);
printToPrinter(&printer);
}
@@ -393,7 +399,7 @@
QPrintDialog pd(&printer, this);
pd.setOption(QPrintDialog::PrintToFile);
- pd.setOption(QPrintDialog::PrintPageRange, false);
+ pd.setOption(QPrintDialog::PrintPageRange, true);
if (pd.exec() == QDialog::Accepted) {
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #1083714:1083715
@@ -83,7 +83,7 @@
void openFile(const QString &file);
void print();
void printToPrinter(QPrinter *printer);
- void printFromCommandLine(const QString &printFileName);
+ void printFromCommandLine(const QString &printFileName, bool landscape);
void exportGraphicsFile(const QString &filename, const QString &format, int w, int h, int display);
void clearDrawingMarker();
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #1083714:1083715
@@ -574,7 +574,7 @@
matchedPoint = QPointF(x, y);
bFirst = false;
minDistance = distance;
- curveName = curve->Name();
+ curveName = curve->CleanedName();
if (curve->color() == Qt::black) {
_invertHighlight = true;
}
@@ -582,7 +582,7 @@
} else if (Image* image = kst_cast<Image>(relation)) {
if (!bFoundImage && image->getNearestZ(position.x(), position.y(), imageZ)) {
bFoundImage = true;
- imageName = image->Name();
+ imageName = image->CleanedName();
}
}
}
More information about the Kst
mailing list