[PATCH RFC] Make the info box look as it did in 3.1

Dirk Hohndel dirk at hohndel.org
Thu Nov 14 13:07:27 UTC 2013


I like it.

Applied (not pushed yet)

/D

On Thu, 2013-11-14 at 20:58 +0100, Anton Lundin wrote:
> In the Gtk version there were no option to disable the showing of time
> in the mouse over, so this removes that option to limit the amount of
> clutter in the settings panel.
> 
> This also renames the time and temperature to match the names they used
> to have. T -> @, Temp -> T
> 
> Signed-off-by: Anton Lundin <glance at acc.umu.se>
> ---
>  pref.h                |  1 -
>  profile.c             |  9 ++-------
>  qt-ui/mainwindow.cpp  |  1 -
>  qt-ui/preferences.cpp |  3 ---
>  qt-ui/preferences.ui  | 11 -----------
>  subsurfacestartup.c   |  1 -
>  6 files changed, 2 insertions(+), 24 deletions(-)
> 
> diff --git a/pref.h b/pref.h
> index 29c9df2..9e0d320 100644
> --- a/pref.h
> +++ b/pref.h
> @@ -36,7 +36,6 @@ struct preferences {
>  	short show_invalid;
>  	short unit_system;
>  	struct units units;
> -	short show_time;
>  	short show_sac;
>  };
>  enum unit_system_values { METRIC, IMPERIAL, PERSONALIZE };
> diff --git a/profile.c b/profile.c
> index 5d9cb51..c0520bc 100644
> --- a/profile.c
> +++ b/profile.c
> @@ -1193,12 +1193,7 @@ static void plot_string(struct plot_data *entry, char *buf, int bufsize,
>  	double depthvalue, tempvalue, speedvalue;
>  
>  	depthvalue = get_depth_units(entry->depth, NULL, &depth_unit);
> -	snprintf(buf, bufsize, translate("gettextFromC","D:%.1f %s"), depthvalue, depth_unit);
> -
> -	if (prefs.show_time) {
> -		memcpy(buf2, buf, bufsize);
> -		snprintf(buf, bufsize, translate("gettextFromC","%s\nT:%d:%02d"), buf2, FRACTION(entry->sec, 60));
> -	}
> +	snprintf(buf, bufsize, translate("gettextFromC","@:%d:%02d\nD:%.1f %s"), FRACTION(entry->sec, 60), depthvalue, depth_unit);
>  	if (GET_PRESSURE(entry)) {
>  		pressurevalue = get_pressure_units(GET_PRESSURE(entry), &pressure_unit);
>  		memcpy(buf2, buf, bufsize);
> @@ -1207,7 +1202,7 @@ static void plot_string(struct plot_data *entry, char *buf, int bufsize,
>  	if (entry->temperature) {
>  		tempvalue = get_temp_units(entry->temperature, &temp_unit);
>  		memcpy(buf2, buf, bufsize);
> -		snprintf(buf, bufsize, translate("gettextFromC","%s\nTemp:%.1f %s"), buf2, tempvalue, temp_unit);
> +		snprintf(buf, bufsize, translate("gettextFromC","%s\nT:%.1f %s"), buf2, tempvalue, temp_unit);
>  	}
>  	speedvalue = get_vertical_speed_units(abs(entry->speed), NULL, &vertical_speed_unit);
>  	memcpy(buf2, buf, bufsize);
> diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
> index 3fe6d23..b2180d1 100644
> --- a/qt-ui/mainwindow.cpp
> +++ b/qt-ui/mainwindow.cpp
> @@ -619,7 +619,6 @@ void MainWindow::readSettings()
>  	GET_INT("gflow", gflow);
>  	GET_INT("gfhigh", gfhigh);
>  	set_gf(prefs.gflow, prefs.gfhigh);
> -	GET_BOOL("show_time", show_time);
>  	GET_BOOL("show_sac", show_sac);
>  	s.endGroup();
>  
> diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
> index f359017..eb7eb73 100644
> --- a/qt-ui/preferences.cpp
> +++ b/qt-ui/preferences.cpp
> @@ -75,7 +75,6 @@ void PreferencesDialog::setUiFromPrefs()
>  	ui.fontsize->setValue(prefs.font_size);
>  	ui.defaultfilename->setText(prefs.default_filename);
>  	ui.displayinvalid->setChecked(prefs.show_invalid);
> -	ui.show_time->setChecked(prefs.show_time);
>  	ui.show_sac->setChecked(prefs.show_sac);
>  	ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
>  	ui.vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS);
> @@ -121,7 +120,6 @@ void PreferencesDialog::setPrefsFromUi()
>  	prefs.font_size = ui.fontsize->value();
>  	prefs.default_filename = strdup(ui.defaultfilename->text().toUtf8().data());
>  	prefs.display_invalid_dives = ui.displayinvalid->isChecked();
> -	SP(show_time, ui.show_time);
>  	SP(show_sac, ui.show_sac);
>  }
>  
> @@ -149,7 +147,6 @@ void PreferencesDialog::syncSettings()
>  	SB("calcalltissues", ui.all_tissues);
>  	s.setValue("gflow", ui.gflow->value());
>  	s.setValue("gfhigh", ui.gfhigh->value());
> -	SB("show_time", ui.show_time);
>  	SB("show_sac", ui.show_sac);
>  	s.endGroup();
>  
> diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui
> index 960c31c..7e071fa 100644
> --- a/qt-ui/preferences.ui
> +++ b/qt-ui/preferences.ui
> @@ -724,17 +724,6 @@
>               </layout>
>              </item>
>              <item>
> -             <layout class="QHBoxLayout" name="horizontalLayout_11">
> -              <item>
> -               <widget class="QCheckBox" name="show_time">
> -                <property name="text">
> -                 <string>Show time</string>
> -                </property>
> -               </widget>
> -              </item>
> -             </layout>
> -            </item>
> -            <item>
>               <layout class="QHBoxLayout" name="horizontalLayout_11b">
>                <item>
>                 <widget class="QCheckBox" name="show_sac">
> diff --git a/subsurfacestartup.c b/subsurfacestartup.c
> index 8530b2f..1cf52e3 100644
> --- a/subsurfacestartup.c
> +++ b/subsurfacestartup.c
> @@ -27,7 +27,6 @@ struct preferences default_prefs = {
>  	.gfhigh = 75,
>  	.font_size = 14.0,
>  	.show_invalid = FALSE,
> -	.show_time = FALSE,
>  	.show_sac = FALSE,
>  };
>  




More information about the subsurface mailing list