Skip to content

Commit

Permalink
Implemented new shortcut for report user
Browse files Browse the repository at this point in the history
  • Loading branch information
benapetr committed Sep 29, 2015
1 parent 831df52 commit 34011ec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions huggle/Localization/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@
<string name="user-history-fail">unable to retrieve history for user: $1</string>
<string name="userinfo-generic">User info</string>
<string name="userinfo-retrieve">Retrieve info</string>
<string name="shortcut-report-username">Report username</string>
<string name="shortcut-report-user">Report user</string>
<string name="shortcut-my-talk">My talk page</string>
<string name="shortcut-raw">Revert edit and warn a user</string>
<string name="shortcut-exit">Terminate Huggle in a usual way</string>
Expand Down
6 changes: 6 additions & 0 deletions huggle/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Configuration::Configuration()
this->MakeShortcut("main-revert-warn-and-stay", "shortcut-rw-stay", "Shift+Q");
this->MakeShortcut("main-tab", "shortcut-tab", "Ctrl+T");
this->MakeShortcut("main-browser-close-tab", "shortcut-browser-close-tab", "Ctrl+W");
this->MakeShortcut("main-user-report-name", "shortcut-report-username", "Alt+R");
this->MakeShortcut("main-user-report-user", "shortcut-report-user", "Ctrl+R");
}

Configuration::~Configuration()
Expand Down Expand Up @@ -648,6 +650,10 @@ Shortcut::Shortcut(QString name, QString description)
this->ID = HUGGLE_ACCEL_REVERT_STAY;
else if (name == "main-talk")
this->ID = HUGGLE_ACCEL_MAIN_TALK;
else if (name == "main-user-report-name")
this->ID = HUGGLE_ACCEL_USER_REPORT_USER_NAME;
else if (name == "main-user-report-user")
this->ID = HUGGLE_ACCEL_USER_REPORT;
else if (name.startsWith("main-revert-and-warn-"))
{
if (name == "main-revert-and-warn-0")
Expand Down
2 changes: 2 additions & 0 deletions huggle/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class QXmlStreamWriter;
#define HUGGLE_ACCEL_MAIN_OPEN 48
#define HUGGLE_ACCEL_CLOSE_TAB 200
#define HUGGLE_ACCEL_CREATE_NEW_TAB 206
#define HUGGLE_ACCEL_USER_REPORT_USER_NAME 300
#define HUGGLE_ACCEL_USER_REPORT 310

#define hcfg Huggle::Configuration::HuggleConfiguration

Expand Down
6 changes: 6 additions & 0 deletions huggle/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,12 @@ void MainWindow::ReloadShort(QString id)
case HUGGLE_ACCEL_MAIN_EXIT:
q = this->ui->actionExit;
break;
case HUGGLE_ACCEL_USER_REPORT_USER_NAME:
q = this->ui->actionReport_username;
break;
case HUGGLE_ACCEL_USER_REPORT:
q = this->ui->actionReport_user_2;
break;
}

if (q != nullptr)
Expand Down
3 changes: 0 additions & 3 deletions huggle/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -821,9 +821,6 @@
<property name="text">
<string notr="true">Report username</string>
</property>
<property name="shortcut">
<string>Alt+R</string>
</property>
</action>
<action name="actionShow_list_of_score_words">
<property name="text">
Expand Down

0 comments on commit 34011ec

Please sign in to comment.