Author: kmachalkova
Date: Tue Jun 23 15:35:51 2009
New Revision: 57705
URL: http://svn.opensuse.org/viewcvs/yast?rev=57705&view=rev
Log:
Set window title (with hostname - unchanged from
old CC)
Modified:
branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.cpp
branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.h
Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.cpp?rev=57705&r1=57704&r2=57705&view=diff
==============================================================================
--- branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.cpp (original)
+++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.cpp Tue Jun 23 15:35:51 2009
@@ -12,6 +12,10 @@
#include "main_window.h"
#include "i18n.h"
+#include
+#include
+#include
+
#include <QLayout>
#include <QLabel>
#include <QToolBar>
@@ -137,6 +141,7 @@
d->modview->addAction( addToF );
d->modview->setContextMenuPolicy( Qt::ActionsContextMenu );
+ setWinTitle();
statusBar()->showMessage( _("Ready") );
connect( d->groupview, SIGNAL( pressed( const QModelIndex & ) ),
@@ -263,6 +268,23 @@
settings.endGroup();
}
+void MainWindow::setWinTitle()
+{
+ QString title = _("YaST2 Control Center");
+ char hostname[ MAXHOSTNAMELEN+1 ];
+ if ( gethostname( hostname, sizeof( hostname )-1 ) == 0 )
+ {
+ hostname[ sizeof( hostname ) -1 ] = '\0'; // make sure it's terminated
+
+ if ( strlen( hostname ) > 0 && strcmp( hostname, "(none)" ) != 0 )
+ {
+ title += " @ ";
+ title += hostname;
+ }
+ }
+ setWindowTitle( title );
+}
+
void MainWindow::closeEvent (QCloseEvent *event)
{
writeSettings();
Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.h?rev=57705&r1=57704&r2=57705&view=diff
==============================================================================
--- branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.h (original)
+++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/main_window.h Tue Jun 23 15:35:51 2009
@@ -50,6 +50,7 @@
void writeSettings();
void readSettings();
+ void setWinTitle();
};
#endif
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org