Skip to content

Commit

Permalink
settings tab activation
Browse files Browse the repository at this point in the history
  • Loading branch information
sb0y committed Apr 22, 2015
1 parent c7e268c commit 3f415df
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void core::exportToWEB()

if ( settings->value ( "WEB/accessToken" ).toString().isEmpty() )
{
openSettingsDialog();
openSettingsDialog ( 1 );
return;
}

Expand All @@ -310,9 +310,10 @@ void core::showExportResult ( QString big, QString small, QString userID )
er->show();
}

void core::openSettingsDialog()
void core::openSettingsDialog ( int tabIndex )
{
settingsDialog *sd = new settingsDialog ( windows [ "main" ] );
sd->activateTab ( tabIndex );
windows [ "settingsDialog" ] = sd;
sd->show();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public slots:
void showAbout();
void exportToWEB();
void showExportResult ( QString, QString, QString );
void openSettingsDialog();
void openSettingsDialog ( int tabIndex = -1 );

void trayShotDisplay();
void trayShotWindow();
Expand Down
6 changes: 6 additions & 0 deletions src/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ void settingsDialog::processHTML()
{

}

void settingsDialog::activateTab ( int tabIndex )
{
if ( tabIndex != -1 )
ui->tabWidget->setCurrentIndex ( tabIndex );
}
1 change: 1 addition & 0 deletions src/settingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class settingsDialog : public QDialog
~settingsDialog();

void processHTML();
void activateTab ( int tabIndex );

private:
Ui::settingsDialog *ui;
Expand Down

0 comments on commit 3f415df

Please sign in to comment.