paches for Tags and Picture handling on the profile

Anton Lundin glance at acc.umu.se
Thu Jul 10 15:15:22 PDT 2014


On 10 July, 2014 - Tomaz Canabrava wrote:

> correct ones: I'm doing the rest of the code now ( to make the
> pictures actually appear / disappear on the canvas )
> 

Still very much _in_planner in there, and with the same Date:

Emailed the wrong file? =)


//Anton

> On Thu, Jul 10, 2014 at 6:33 PM, Tomaz Canabrava <tcanabrava at kde.org> wrote:
> > my mistake. :)
> >
> > On Thu, Jul 10, 2014 at 3:04 PM, Anton Lundin <glance at acc.umu.se> wrote:
> >> On 10 July, 2014 - Tomaz Canabrava wrote:
> >>
> >>> I still need to hoock the toggle on the image button to actually hide
> >>> / show the pictures.
> >>
> >>> From a461294b2d6117721fa4e83742821ecac945d78e Mon Sep 17 00:00:00 2001
> >>> From: Tomaz Canabrava <tomaz.canabrava at intel.com>
> >>> Date: Thu, 10 Jul 2014 13:50:49 -0300
> >>> Subject: [PATCH 5/6] Added the toggle picture button and hoocked it up
> >>>
> >>> This patch adds the toggle picture button and hoocks
> >>> it up with the rest of the code. I'v also changed a call
> >>> from ProfileWidget because it caused errors on the ui
> >>> generated code, where it would try to call an still-to-be
> >>> instantiated object.
> >>>
> >>> Signed-off-by: Tomaz Canabrava <tomaz.canabrava at intel.com>
> >>> ---
> >>>  pref.h                           |  1 +
> >>>  qt-ui/mainwindow.cpp             |  7 +++++++
> >>>  qt-ui/mainwindow.h               |  2 +-
> >>>  qt-ui/mainwindow.ui              | 31 +++++++++++++++++++++++++++----
> >>>  qt-ui/profile/profilewidget2.cpp |  1 -
> >>>  subsurfacestartup.c              |  3 ++-
> >>>  6 files changed, 38 insertions(+), 7 deletions(-)
> >>>
> >>> diff --git a/pref.h b/pref.h
> >>> index a22206d..bfc120c 100644
> >>> --- a/pref.h
> >>> +++ b/pref.h
> >>> @@ -63,6 +63,7 @@ struct preferences {
> >>>       char *proxy_pass;
> >>>       bool doo2breaks;
> >>>       bool drop_stone_mode;
> >>> +     bool show_pictures_in_planner;
> >>
> >> Why name it _in_planner?
> >>
> >> As far as i understood it got nothing with the planner to do. Maybe call
> >> it show_pictures_in_profile?
> >>
> >> //Anton
> >>
> >>
> >> --
> >> Anton Lundin    +46702-161604

> From a461294b2d6117721fa4e83742821ecac945d78e Mon Sep 17 00:00:00 2001
> From: Tomaz Canabrava <tomaz.canabrava at intel.com>
> Date: Thu, 10 Jul 2014 13:50:49 -0300
> Subject: [PATCH 5/6] Added the toggle picture button and hoocked it up
> 
> This patch adds the toggle picture button and hoocks
> it up with the rest of the code. I'v also changed a call
> from ProfileWidget because it caused errors on the ui
> generated code, where it would try to call an still-to-be
> instantiated object.
> 
> Signed-off-by: Tomaz Canabrava <tomaz.canabrava at intel.com>
> ---
>  pref.h                           |  1 +
>  qt-ui/mainwindow.cpp             |  7 +++++++
>  qt-ui/mainwindow.h               |  2 +-
>  qt-ui/mainwindow.ui              | 31 +++++++++++++++++++++++++++----
>  qt-ui/profile/profilewidget2.cpp |  1 -
>  subsurfacestartup.c              |  3 ++-
>  6 files changed, 38 insertions(+), 7 deletions(-)
> 
> diff --git a/pref.h b/pref.h
> index a22206d..bfc120c 100644
> --- a/pref.h
> +++ b/pref.h
> @@ -63,6 +63,7 @@ struct preferences {
>  	char *proxy_pass;
>  	bool doo2breaks;
>  	bool drop_stone_mode;
> +	bool show_pictures_in_planner;
>  };
>  enum unit_system_values {
>  	METRIC,
> diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
> index 6a212ae..bb65ada 100644
> --- a/qt-ui/mainwindow.cpp
> +++ b/qt-ui/mainwindow.cpp
> @@ -93,6 +93,7 @@ MainWindow::MainWindow() : QMainWindow(),
>  #endif
>  
>  	ui.mainErrorMessage->hide();
> +	ui.newProfile->setEmptyState();
>  	initialUiSetup();
>  	readSettings();
>  	ui.ListWidget->reload(DiveTripModel::TREE);
> @@ -1334,6 +1335,12 @@ void MainWindow::on_profScaled_clicked(bool triggered)
>  	TOOLBOX_PREF_PROFILE(zoomed_plot);
>  }
>  
> +void MainWindow::on_profTogglePicture_clicked(bool triggered)
> +{
> +	prefs.show_pictures_in_planner = triggered;
> +	TOOLBOX_PREF_PROFILE(show_pictures_in_planner);
> +}
> +
>  #undef TOOLBOX_PREF_PROFILE
>  
>  void MainWindow::on_actionExport_triggered()
> diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
> index 014fbb4..3e7cad6 100644
> --- a/qt-ui/mainwindow.h
> +++ b/qt-ui/mainwindow.h
> @@ -142,7 +142,7 @@ slots:
>  	void on_profRuler_clicked(bool triggered);
>  	void on_profSAC_clicked(bool triggered);
>  	void on_profScaled_clicked(bool triggered);
> -
> +	void on_profTogglePicture_clicked(bool triggered);
>  	void on_actionExport_triggered();
>  
>  protected:
> diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
> index 2360dd8..d8ad99c 100644
> --- a/qt-ui/mainwindow.ui
> +++ b/qt-ui/mainwindow.ui
> @@ -109,7 +109,7 @@
>           <property name="spacing">
>            <number>0</number>
>           </property>
> -         <item row="14" column="0">
> +         <item row="15" column="0">
>            <spacer name="verticalSpacer">
>             <property name="orientation">
>              <enum>Qt::Vertical</enum>
> @@ -466,6 +466,9 @@
>             </property>
>            </widget>
>           </item>
> +         <item row="0" column="1" rowspan="16">
> +          <widget class="ProfileWidget2" name="newProfile"/>
> +         </item>
>           <item row="1" column="0">
>            <widget class="QToolButton" name="profPn2">
>             <property name="toolTip">
> @@ -492,8 +495,28 @@
>             </property>
>            </widget>
>           </item>
> -         <item row="0" column="1" rowspan="15">
> -          <widget class="ProfileWidget2" name="newProfile"/>
> +         <item row="14" column="0">
> +          <widget class="QToolButton" name="profTogglePicture">
> +           <property name="text">
> +            <string>...</string>
> +           </property>
> +           <property name="icon">
> +            <iconset resource="../subsurface.qrc">
> +             <normaloff>:/pictures</normaloff>:/pictures</iconset>
> +           </property>
> +           <property name="iconSize">
> +            <size>
> +             <width>24</width>
> +             <height>24</height>
> +            </size>
> +           </property>
> +           <property name="checkable">
> +            <bool>true</bool>
> +           </property>
> +           <property name="autoRaise">
> +            <bool>true</bool>
> +           </property>
> +          </widget>
>           </item>
>          </layout>
>         </widget>
> @@ -638,7 +661,7 @@ p, li { white-space: pre-wrap; }
>       <x>0</x>
>       <y>0</y>
>       <width>1682</width>
> -     <height>19</height>
> +     <height>27</height>
>      </rect>
>     </property>
>     <widget class="QMenu" name="menuFile">
> diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
> index ee80d59..fe19c7b 100644
> --- a/qt-ui/profile/profilewidget2.cpp
> +++ b/qt-ui/profile/profilewidget2.cpp
> @@ -100,7 +100,6 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
>  	setupItemOnScene();
>  	addItemsToScene();
>  	scene()->installEventFilter(this);
> -	setEmptyState();
>  	connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
>  
>  	QAction *action = NULL;
> diff --git a/subsurfacestartup.c b/subsurfacestartup.c
> index 58291d2..df4c01f 100644
> --- a/subsurfacestartup.c
> +++ b/subsurfacestartup.c
> @@ -41,7 +41,8 @@ struct preferences default_prefs = {
>  	.bottompo2 = 1400,
>  	.decopo2 = 1600,
>  	.doo2breaks = false,
> -	.drop_stone_mode = false
> +	.drop_stone_mode = false,
> +	.show_pictures_in_planner = true
>  };
>  
>  int run_survey;
> -- 
> 2.0.1
> 

> From c5a60d533f3fad12426215f270222a7ecb3c7f21 Mon Sep 17 00:00:00 2001
> From: Tomaz Canabrava <tomaz.canabrava at intel.com>
> Date: Thu, 10 Jul 2014 13:53:06 -0300
> Subject: [PATCH 6/6] Correctly sets the 'enabled' flag on the picture button
> 
> Forgot to add this one, oops.
> 
> Signed-off-by: Tomaz Canabrava <tomaz.canabrava at intel.com>
> ---
>  qt-ui/mainwindow.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
> index bb65ada..8c86901 100644
> --- a/qt-ui/mainwindow.cpp
> +++ b/qt-ui/mainwindow.cpp
> @@ -241,6 +241,7 @@ void MainWindow::setToolButtonsEnabled(bool enabled)
>  	ui.profRuler->setEnabled(enabled);
>  	ui.profScaled->setEnabled(enabled);
>  	ui.profHR->setEnabled(enabled);
> +	ui.profTogglePicture->setEnabled(enabled);
>  }
>  
>  bool MainWindow::okToClose(QString message)
> -- 
> 2.0.1
> 


-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list