前の画面〕 〔クリックポイント〕 〔最新の一覧〕 〔全て読んだことにする〕〔全て読んだことにして終了〕 〔終了

2776 re(5):gnuplot を使おう。 その3 のアドレス変更
2014/5/29(木)16:41 - kakuto - 42-150-13-212.rev.home.ne.jp - 2564 hit(s)

引用する
現在のパスワード


松岡> 翻訳の有効化でなにかこつがあれば,教えてください。

おそらく mingw でそのまま使用可能なパッチを投稿します。
パッチとして正しく表示できないでしょうから,
読みとって下さい。
qtgnuplot_fr.qm と qtgnuplot_ja.qm を gnuplot/share/qt
に入れると仮定しています。
デフォルトの graphics system を opengl にしていますが,
そこは適当にして下さい。(あと,raster と native が可)。

--- gnuplot_qt.cpp.origWed Jan 18 05:53:54 2012
+++ gnuplot_qt.cppThu May 29 16:30:59 2014
@@ -45,8 +45,30 @@
 #include <QtCore>
 #include <signal.h>
 
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
 int main(int argc, char* argv[])
 {
+#if defined(_WIN32)
+static char *qt_gnuplot_data_dir = NULL;
+char buff[512];
+char *p;
+
+if(qt_gnuplot_data_dir == NULL) {
+  if(GetModuleFileNameA(NULL, (LPCH) buff, sizeof(buff))) {
+    p = strrchr(buff, '\\');
+    if(p != NULL) {
+             *p = '\0';
+      if(_stricmp(buff + strlen(buff)-4, "\\bin") == 0)
+        *(buff + strlen(buff) - 4) = '\0';
+      strcat(buff, "\\share\\qt");
+      qt_gnuplot_data_dir = _strdup(buff);
+    }
+  }
+}
+#endif
 signal(SIGINT, SIG_IGN); // Do not listen to SIGINT signals anymore
 
 #if QT_VERSION < 0x040700
@@ -60,6 +82,13 @@
 // This makes a huge difference to the speed of polygon rendering.
 // Alternatives are "native", "raster", "opengl"
 QApplication::setGraphicsSystem("raster");
+#else
+#if defined(_WIN32)
+p = getenv("QT_GRAPHICSSYSTEM");
+if(p == NULL) {
+  _putenv("QT_GRAPHICSSYSTEM=opengl");
+}
+#endif
 #endif
 
 QtGnuplotApplication application(argc, argv);
@@ -71,7 +100,11 @@
 
 // Load translations for the qt terminal
 QTranslator translator;
+#if defined(_WIN32)
+translator.load("qtgnuplot_" + QLocale::system().name(), qt_gnuplot_data_dir);
+#else
 translator.load("qtgnuplot_" + QLocale::system().name(), QTGNUPLOT_DATA_DIR);
+#endif
 application.installTranslator(&translator);
 
 // Start


〔ツリー構成〕

【2770】 gnuplot を使おう。 その3 のアドレス変更 2014/5/28(水)17:58 松岡 (157)
┣【2771】 re(1):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)13:11 kakuto (341)
┣【2772】 re(2):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)13:26 松岡 (684)
┣【2773】 re(3):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)13:45 松岡 (122)
┣【2774】 re(4):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)14:34 松岡 (170)
┣【2776】 re(5):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)16:41 kakuto (1890)
┣【2777】 re(6):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)17:19 松岡 (141)
┣【2779】 re(7):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)19:27 松岡 (323)
┣【2780】 re(8):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)19:38 kakuto (117)
┣【2775】 re(3):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)15:24 竹の (525)
┣【2778】 re(4):gnuplot を使おう。 その3 のアドレス変更 2014/5/29(木)17:34 松岡 (623)

前の画面〕 〔クリックポイント〕 〔最新の一覧〕 〔全て読んだことにする〕〔全て読んだことにして終了〕 〔終了

※ 『クリックポイント』とは一覧上から読み始めた地点を指し、ツリー上の記事を巡回しても、その位置に戻ることができます.