13 #include <QMessageBox> 28 QObject::connect(
ui.actionAbout_Qt, SIGNAL(triggered(
bool)), qApp, SLOT(aboutQt()));
31 setWindowIcon(QIcon(
":/images/icon.png"));
32 ui.tab_manager->setCurrentIndex(0);
34 setWindowTitle(QApplication::translate(
"MainWindowDesign",
qnode->
nodeName().c_str(), 0, QApplication::UnicodeUTF8));
41 QObject::connect(
qnode, SIGNAL(rosShutdown()),
this, SLOT(close()));
46 if (
ui.checkbox_remember_settings->isChecked() ) {
59 msgBox.setText(
"Couldn't find the ros master.");
70 if (
ui.checkbox_use_environment->isChecked() ) {
74 ui.button_connect->setEnabled(
false);
78 ui.line_edit_master->text().toStdString(),
79 ui.line_edit_host->text().toStdString() )
83 ui.button_connect->setEnabled(
false);
84 ui.line_edit_master->setReadOnly(
true);
85 ui.line_edit_host->setReadOnly(
true);
97 ui.line_edit_master->setEnabled(enabled);
98 ui.line_edit_host->setEnabled(enabled);
111 ui.view_logging->scrollToBottom();
119 QMessageBox::about(
this, tr(
"About ..."),tr(
"<h2>PACKAGE_NAME Test Program 0.10</h2><p>Copyright Yujin Robot</p><p>This package needs an about description.</p>"));
127 QSettings settings(
"Qt-Ros Package",
qnode->
nodeName().c_str());
128 restoreGeometry(settings.value(
"geometry").toByteArray());
129 restoreState(settings.value(
"windowState").toByteArray());
130 QString master_url = settings.value(
"master_url",QString(
"http://192.168.1.2:11311/")).toString();
131 QString host_url = settings.value(
"host_url", QString(
"192.168.1.3")).toString();
132 QString topic_name = settings.value(
"topic_name", QString(
"/chatter")).toString();
133 ui.line_edit_master->setText(master_url);
134 ui.line_edit_host->setText(host_url);
135 bool remember = settings.value(
"remember_settings",
false).toBool();
136 ui.checkbox_remember_settings->setChecked(remember);
137 bool checked = settings.value(
"use_environment_variables",
false).toBool();
138 ui.checkbox_use_environment->setChecked(checked);
140 ui.line_edit_master->setEnabled(
false);
141 ui.line_edit_host->setEnabled(
false);
146 QSettings settings(
"Qt-Ros Package",
qnode->
nodeName().c_str());
147 settings.setValue(
"geometry", geometry());
148 settings.setValue(
"master_url",
ui.line_edit_master->text());
149 settings.setValue(
"host_url",
ui.line_edit_host->text());
150 settings.setValue(
"use_environment_variables",QVariant(
ui.checkbox_use_environment->isChecked()));
151 settings.setValue(
"windowState", saveState());
152 settings.setValue(
"remember_settings",QVariant(
ui.checkbox_remember_settings->isChecked()));
159 QMainWindow::closeEvent(event);
void on_button_connect_clicked(bool check)
void showNoMasterMessage()
MainWindow(QNode *node, QWidget *parent=0)
void closeEvent(QCloseEvent *event)
QStringListModel * loggingModel()
void on_checkbox_use_environment_stateChanged(int state)
Qt based gui for eros_qtalker.
void on_actionAbout_triggered()
const std::string & nodeName()