diff --git a/tools/sra-toolkit/config/sraconfigview.cpp b/tools/sra-toolkit/config/sraconfigview.cpp index 6174a0828..4f6c16c5b 100644 --- a/tools/sra-toolkit/config/sraconfigview.cpp +++ b/tools/sra-toolkit/config/sraconfigview.cpp @@ -532,8 +532,6 @@ SRAConfigView :: SRAConfigView ( QWidget *parent ) main_layout -> addWidget ( setup_workflow_group () ); main_layout -> addWidget ( setup_option_group () ); - //main_layout -> addWidget ( setup_workspace_group () ); - //main_layout -> addLayout ( setup_button_layout () ); setLayout ( main_layout ); @@ -591,6 +589,33 @@ void SRAConfigView :: init () bg_prioritize_http -> button ( 1 ) -> setChecked ( true ); } +QWidget * SRAConfigView::setup_workflow_group () +{ + QWidget *widget = new QWidget (); + widget -> setObjectName ( "workflow_widget" ); + widget -> setFixedHeight ( 70 ); + widget -> setFixedWidth ( size () . width () ); + + QHBoxLayout *layout = new QHBoxLayout (); + layout -> setAlignment ( Qt::AlignBottom | Qt::AlignRight ); + layout -> setSpacing ( 5 ); + + apply_btn = new QPushButton ( "Apply" ); + apply_btn -> setDisabled ( true ); + connect ( apply_btn, SIGNAL ( clicked () ), this, SLOT ( commit_config () ) ); + + discard_btn = new QPushButton ( "Revert" ); + discard_btn -> setDisabled ( true ); + connect ( discard_btn, SIGNAL ( clicked () ), this, SLOT ( reload_config () ) ); + + layout -> addWidget ( discard_btn ); + layout -> addWidget ( apply_btn ); + + widget -> setLayout ( layout ); + + return widget; +} + static QButtonGroup * make_no_yes_button_group ( QPushButton **p_no, QPushButton **p_yes ) { @@ -615,18 +640,6 @@ QButtonGroup * make_no_yes_button_group ( QPushButton **p_no, QPushButton **p_ye return group; } -QWidget * SRAConfigView::setup_workflow_group () -{ - QWidget *widget = new QWidget (); - widget -> setObjectName ( "workflow_widget" ); - widget -> setFixedHeight ( 70 ); - widget -> setFixedWidth ( size () . width () ); - - QHBoxLayout *layout = new QHBoxLayout (); - - return widget; -} - static QWidget * make_button_option_row ( QString name, QString desc, QPushButton *b1, QPushButton *b2 ) @@ -881,42 +894,6 @@ QGroupBox * SRAConfigView :: setup_workspace_group () return group; } */ -QVBoxLayout * SRAConfigView::setup_button_layout () -{ - QVBoxLayout *v_layout = new QVBoxLayout (); - - // 1 - QHBoxLayout *layout = new QHBoxLayout (); - layout -> setAlignment ( Qt::AlignTop | Qt::AlignRight ); - - QPushButton *advanced = new QPushButton ( "Advanced" ); - advanced -> setFixedWidth ( 150 ); - connect ( advanced, SIGNAL ( clicked () ), this, SLOT ( advanced_settings () ) ); - - layout -> addWidget ( advanced ); - v_layout -> addLayout ( layout ); - v_layout -> addStretch ( 1 ); - - // 2 - layout = new QHBoxLayout (); - layout -> setAlignment ( Qt::AlignBottom | Qt::AlignRight ); - layout -> setSpacing ( 5 ); - - apply_btn = new QPushButton ( "Apply" ); - apply_btn -> setDisabled ( true ); - connect ( apply_btn, SIGNAL ( clicked () ), this, SLOT ( commit_config () ) ); - - discard_btn = new QPushButton ( "Revert" ); - discard_btn -> setDisabled ( true ); - connect ( discard_btn, SIGNAL ( clicked () ), this, SLOT ( reload_config () ) ); - - layout -> addWidget ( discard_btn ); - layout -> addWidget ( apply_btn ); - - v_layout -> addLayout ( layout ); - - return v_layout; -} void SRAConfigView :: closeEvent ( QCloseEvent *ev ) { @@ -991,14 +968,12 @@ void SRAConfigView :: commit_config () void SRAConfigView :: reload_config () { model -> reload (); - //populate (); + init (); if ( ! model -> config_changed () ) { apply_btn -> setDisabled ( true ); - //apply_action -> setDisabled ( true ); discard_btn -> setDisabled ( true ); - //discard_action -> setDisabled ( true ); } } @@ -1007,69 +982,67 @@ void SRAConfigView :: modified_config () if ( model -> config_changed () ) // this wont trigger on workspace addition yet { apply_btn -> setDisabled ( false ); - //apply_action -> setDisabled ( false ); discard_btn -> setDisabled ( false ); - //discard_action -> setDisabled ( false ); } } -// TBD - still needs a menu item to be triggered. -- this is not a hard reset - it still keeps some user settings void SRAConfigView :: default_config () { model -> set_remote_enabled ( true ); model -> set_global_cache_enabled ( true ); model -> set_site_enabled ( true ); - //populate (); - - emit dirty_config (); -} + init (); -void SRAConfigView :: toggle_remote_enabled ( bool toggled ) -{ - model -> set_remote_enabled ( toggled ); emit dirty_config (); } void SRAConfigView :: toggle_remote_enabled ( int toggled ) { if ( toggled == 1 ) + { qDebug () << "remote_enabled: yes"; + model -> set_remote_enabled ( true ); + } else + { qDebug () << "remote_enabled: no"; -} + model -> set_remote_enabled ( false ); + } -void SRAConfigView :: toggle_local_caching ( bool toggled ) -{ - model -> set_global_cache_enabled ( toggled ); emit dirty_config (); } void SRAConfigView :: toggle_local_caching ( int toggled ) { if ( toggled == 1 ) + { qDebug () << "local_caching: yes"; + model -> set_global_cache_enabled ( true ); + } else + { qDebug () << "local_caching: no"; -} + model -> set_global_cache_enabled ( false ); + } -void SRAConfigView :: toggle_use_site ( bool toggled ) -{ - model -> set_site_enabled ( toggled ); emit dirty_config (); } void SRAConfigView :: toggle_use_site ( int toggled ) { if ( toggled == 1 ) + { qDebug () << "use_site: yes"; + model -> set_site_enabled ( true ); + + } else + { qDebug () << "use_site: no"; -} + model -> set_site_enabled ( false ); + } -void SRAConfigView :: toggle_use_proxy ( bool toggled ) -{ - model -> set_proxy_enabled ( toggled ); emit dirty_config (); } @@ -1078,27 +1051,33 @@ void SRAConfigView :: toggle_use_proxy ( int toggled ) if ( toggled == 1 ) { qDebug () << "use_proxy: yes"; + model -> set_proxy_enabled ( true ); proxyEditor -> setDisabled ( false ); } else { qDebug () << "use_proxy: no"; + model -> set_proxy_enabled ( false ); proxyEditor -> setDisabled ( true ); } -} -void SRAConfigView :: toggle_prioritize_http ( bool toggled ) -{ - model -> set_proxy_priority ( toggled ); emit dirty_config (); } void SRAConfigView :: toggle_prioritize_http ( int toggled ) { if ( toggled == 1 ) + { qDebug () << "prioritize_http: yes"; + model -> set_proxy_priority ( true ); + } else + { qDebug () << "prioritize_http: no"; + model -> set_proxy_priority ( false ); + } + + emit dirty_config (); } void SRAConfigView :: edit_import_path () diff --git a/tools/sra-toolkit/config/sraconfigview.h b/tools/sra-toolkit/config/sraconfigview.h index 117d1d316..4e8d0ff9c 100644 --- a/tools/sra-toolkit/config/sraconfigview.h +++ b/tools/sra-toolkit/config/sraconfigview.h @@ -73,12 +73,6 @@ private slots: void edit_public_path (); void edit_workspace_path (); - void toggle_remote_enabled ( bool toggled ); - void toggle_local_caching ( bool toggled ); - void toggle_use_site ( bool toggled ); - void toggle_use_proxy ( bool toggled ); - void toggle_prioritize_http ( bool toggled ); - void toggle_remote_enabled ( int toggled ); void toggle_local_caching ( int toggled ); void toggle_use_site ( int toggled ); @@ -120,8 +114,6 @@ private slots: QWidget* setup_workflow_group (); QWidget* setup_option_group (); - //QGroupBox* setup_workspace_group (); - QVBoxLayout *setup_button_layout(); WorkspaceItem *public_workspace; QVector protected_workspaces; diff --git a/tools/sra-toolkit/qss/official_style.qss b/tools/sra-toolkit/qss/official_style.qss index aff40a740..4d8223059 100644 --- a/tools/sra-toolkit/qss/official_style.qss +++ b/tools/sra-toolkit/qss/official_style.qss @@ -1,3 +1,7 @@ +#spacer_line +{ +color: rgba(153,153,204,1.0) ; +} /******************************************************************************* * Tool Bar @@ -17,6 +21,21 @@ background: rgba(0,0,0,0.9); } +/* +#tool_bar_button[type="home"]::hover +{ +background: rgba(153,153,204,0.2); +border: 1px; +} + +#tool_bar_button[type="home"]::checked +{ +background: rgba(153,153,204,0.2); +border: 1px; +} +*/ + + /******************************************************************************* * SRAToolView *******************************************************************************/ diff --git a/tools/sra-toolkit/sratoolbar.cpp b/tools/sra-toolkit/sratoolbar.cpp index 3d7a4c8eb..743047158 100644 --- a/tools/sra-toolkit/sratoolbar.cpp +++ b/tools/sra-toolkit/sratoolbar.cpp @@ -34,6 +34,7 @@ void SRAToolBar::init () home_button = new QPushButton (); home_button -> setObjectName ( "tool_bar_button" ); + home_button -> setProperty ( "type", "home" ); home_button -> setFixedHeight ( 70 ); home_button -> setCheckable ( true ); home_button -> setChecked ( true ); @@ -49,10 +50,23 @@ void SRAToolBar::init () expand_button = new QPushButton (); connect ( expand_button, SIGNAL ( clicked () ), this, SLOT ( expand () ) ); expand_button -> setObjectName ( "tool_bar_button" ); + expand_button -> setProperty ( "type", "expand" ); expand_button -> setFixedHeight ( 50 ); updateButtonIcons (); + QFrame *line = new QFrame (); + line -> setObjectName ( "spacer_line" ); + line -> setFrameShape ( QFrame::HLine ); + line -> setFixedHeight ( 2 ); + line -> setMinimumWidth ( width () * .8 ); + + QFrame *line2= new QFrame (); + line2 -> setObjectName ( "spacer_line" ); + line2 -> setFrameShape ( QFrame::HLine ); + line2 -> setFixedHeight ( 2 ); + line2 -> setMinimumWidth ( width () * .8 ); + toolBar -> addButton ( home_button ); toolBar -> setId ( home_button, 0 ); @@ -64,11 +78,18 @@ void SRAToolBar::init () QVBoxLayout *layout = new QVBoxLayout (); layout -> setMargin ( 0 ); - layout -> setSpacing ( 12 ); + layout -> setSpacing ( 0 ); layout -> addWidget ( home_button ); + layout -> addSpacing ( 20 ); + layout -> addWidget ( line ); + layout -> addSpacing ( 20 ); layout -> addWidget ( config_button ); + layout -> addSpacing ( 8 ); layout -> addWidget ( diagnostics_button ); + layout -> addSpacing ( 20 ); + layout -> addWidget ( line2 ); + layout -> addWidget ( expand_button, 0, Qt::AlignBottom ); setLayout ( layout ); @@ -81,28 +102,34 @@ void SRAToolBar :: updateButtonIcons () home_button -> setIcon ( QIcon ( img_path + "ncbi_logo_long.svg") . pixmap ( QSize ( 176, 48 ) ) ); home_button -> setIconSize ( QSize ( 192, 70 ) ); - config_button -> setIcon ( QIcon ( img_path + "ncbi_config_button_long.svg" ).pixmap ( QSize ( 176, 64 ) ) ); + config_button -> setIcon ( QIcon ( img_path + "ncbi_config_button_long.svg" ) + .pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_LONG, TOOLBAR_BUTTON_HEIGHT ) ) ); config_button -> setIconSize ( QSize ( TOOLBAR_BUTTON_WIDTH_LONG, TOOLBAR_BUTTON_HEIGHT ) ); - diagnostics_button -> setIcon ( QIcon ( img_path + "ncbi_diagnostics_button_long.svg" ).pixmap ( QSize ( 176, 64 ) ) ); + diagnostics_button -> setIcon ( QIcon ( img_path + "ncbi_diagnostics_button_long.svg" ) + .pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_LONG, TOOLBAR_BUTTON_HEIGHT ) ) ); diagnostics_button -> setIconSize ( QSize ( TOOLBAR_BUTTON_WIDTH_LONG, TOOLBAR_BUTTON_HEIGHT ) ); expand_button -> setIcon ( QIcon ( img_path + "ncbi_expand_toolbar_button.svg" ).pixmap ( QSize ( 32, 32 ) ) ); - expand_button -> setIconSize ( QSize ( 192, 70 ) ); + expand_button -> setIconSize ( QSize ( 192, 50 ) ); } else { - home_button -> setIcon ( QIcon ( img_path + "ncbi_helix_vertical_white.svg") . pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_WIDTH_SHORT ) ) ); - home_button -> setIconSize ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_WIDTH_SHORT ) ); + home_button -> setIcon ( QIcon ( img_path + "ncbi_helix_vertical_white.svg") + . pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_HEIGHT ) ) ); + home_button -> setIconSize ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_HEIGHT ) ); - config_button -> setIcon ( QIcon ( img_path + "ncbi_config_button_white.svg" ).pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_WIDTH_SHORT ) ) ); + config_button -> setIcon ( QIcon ( img_path + "ncbi_config_button_white.svg" ) + .pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_HEIGHT ) ) ); config_button -> setIconSize ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_HEIGHT ) ); - diagnostics_button -> setIcon ( QIcon ( img_path + "ncbi_diagnostics_button_white.svg" ).pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_WIDTH_SHORT ) ) ); + diagnostics_button -> setIcon ( QIcon ( img_path + "ncbi_diagnostics_button_white.svg" ) + .pixmap ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_HEIGHT ) ) ); diagnostics_button -> setIconSize ( QSize ( TOOLBAR_BUTTON_WIDTH_SHORT, TOOLBAR_BUTTON_HEIGHT ) ); - expand_button -> setIcon ( QIcon ( img_path + "ncbi_expand_toolbar_button.svg" ).pixmap ( QSize ( 32, 32 ) ) ); - expand_button -> setIconSize ( QSize ( 32, 32 ) ); + expand_button -> setIcon ( QIcon ( img_path + "ncbi_expand_toolbar_button.svg" ) + .pixmap ( QSize ( 32, 32 ) ) ); + expand_button -> setIconSize ( QSize ( 32, 50 ) ); } } diff --git a/tools/sra-toolkit/sratoolview.cpp b/tools/sra-toolkit/sratoolview.cpp index d67823512..ebd023a65 100644 --- a/tools/sra-toolkit/sratoolview.cpp +++ b/tools/sra-toolkit/sratoolview.cpp @@ -3,6 +3,8 @@ #include "config/sraconfigview.h" #include "diagnostics/sradiagnosticsview.h" +#include + #include @@ -54,10 +56,6 @@ void SRAToolView :: toolChanged ( int p_view ) void SRAToolView :: expand ( bool val ) { - if ( val ) - setFixedSize ( size () . width () + TOOLBAR_WIDTH_FACTOR, size () . height () ); - else - setFixedSize ( size () . width () - TOOLBAR_WIDTH_FACTOR, size () . height () ); }